[5d] Interpreting PL Logs

Logged precision landing variables can be found under the 'PL' heading.

bX/bY: Angle-to-target measurement in the body-frame reference BEFORE accounting for roll/pitch of copter.

eX/eY: Angle-to-target measurement in the earth-frame reference AFTER accounting for roll/pitch of copter.

pX/pY: Calculated distance of target from copter in earth-frame. Note that the distance calculation depends on the altitude measurement. Also, the altitude variable in this particular instance is range limited, such that a negative value or very small value is not used to calculate the position.

// get body-frame angles to target from backend
    if (!_backend->get_angle_to_target(_bf_angle_to_target.x, _bf_angle_to_target.y)) {
        _have_estimate = false;
    }

	float x_rad = _bf_angle_to_target.x - _ahrs.roll;
	float y_rad = -_bf_angle_to_target.y + _ahrs.pitch;

    // rotate to earth-frame angles
    _ef_angle_to_target.x = y_rad*_ahrs.cos_yaw() - x_rad*_ahrs.sin_yaw();
    _ef_angle_to_target.y = y_rad*_ahrs.sin_yaw() + x_rad*_ahrs.cos_yaw();

    // get current altitude (constrained to no lower than 50cm)
    float alt = max(alt_above_terrain_cm, 50.0f);

    // convert earth-frame angles to earth-frame position offset
    _target_pos_offset.x = alt*tanf(_ef_angle_to_target.x);
    _target_pos_offset.y = alt*tanf(_ef_angle_to_target.y);
    _target_pos_offset.z = 0;  // not used
172

The plot below shows 5 consecutive precision landings. A video of the flight is shown on the right. The green line indicates the altitude of the copter. The red line ('bX') indicates the angle-to-target measured by sensor in the x-direction, relative to the sensor.

1450

When the LAND mode is initiated, the copter begins moving toward the target, driving the angle measurement toward zero. Oscillations in the angle measurement are typically observed.

'Flat lines' in the bX/bY plot indicate periods of time when no target is detected. This may due to the target being out of range of the sensor, or out of the field of view of the sensor. In this test (below), the MarkOne beacon is detected at distances of over 15 meters.

Toward the end of the landing, the angle measurement may increase significantly and/or turn into a 'flat line'. This result is expected if the copter does not land directly on top of the marker (i.e., 5-30cm away). The detection angle can easily become very large when the sensor is very close to the marker. Also, the marker can easily escape the field of view of the sensor during the final ~10cm of descent.

1439