mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-05 01:21:35 +08:00
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:
@@ -137,10 +137,13 @@ bool FlightTaskAuto::_evaluateTriplets()
|
|||||||
// Check if triplet is valid. There must be at least a valid altitude.
|
// 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)) {
|
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;
|
_prev_prev_wp = _triplet_prev_wp = _triplet_target = _triplet_next_wp = _position;
|
||||||
_type = WaypointType::position;
|
_type = WaypointType::loiter;
|
||||||
return false;
|
_yaw_setpoint = _yaw;
|
||||||
|
_yawspeed_setpoint = NAN;
|
||||||
|
_updateInternalWaypoints();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
_type = (WaypointType)_sub_triplet_setpoint.get().current.type;
|
_type = (WaypointType)_sub_triplet_setpoint.get().current.type;
|
||||||
|
|||||||
Reference in New Issue
Block a user