Browse Source

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.
sbg
Beat Küng 5 years ago committed by Lorenz Meier
parent
commit
e939f60a9e
  1. 9
      src/lib/flight_tasks/tasks/Auto/FlightTaskAuto.cpp

9
src/lib/flight_tasks/tasks/Auto/FlightTaskAuto.cpp

@ -137,10 +137,13 @@ bool FlightTaskAuto::_evaluateTriplets() @@ -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;

Loading…
Cancel
Save