FlightTaskAuto: accept invalid triplet_setpoint (and interpret as loiter)

This will allow navigator to not output any setpoints while disarmed.
Otherwise the position controller outputs warnings in the form of:
Auto activation failed with error: Activation Failed

The risk here is that it could hide problems, where navigator sends invalid
triplets when it should not.
This commit is contained in:
Beat Küng
2020-01-23 13:34:31 +01:00
committed by Lorenz Meier
parent c0352027fb
commit e939f60a9e

View File

@@ -137,10 +137,13 @@ bool FlightTaskAuto::_evaluateTriplets()
// Check if triplet is valid. There must be at least a valid altitude.
if (!_sub_triplet_setpoint.get().current.valid || !PX4_ISFINITE(_sub_triplet_setpoint.get().current.alt)) {
// Best we can do is to just set all waypoints to current state and return false.
// Best we can do is to just set all waypoints to current state
_prev_prev_wp = _triplet_prev_wp = _triplet_target = _triplet_next_wp = _position;
_type = WaypointType::position;
return false;
_type = WaypointType::loiter;
_yaw_setpoint = _yaw;
_yawspeed_setpoint = NAN;
_updateInternalWaypoints();
return true;
}
_type = (WaypointType)_sub_triplet_setpoint.get().current.type;