mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00: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.
|
||||
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user