mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
mc_pos_control: do not warn when going into failsafe while disarmed
It's possible to get invalid or no setpoints from navigator while disarmed.
This commit is contained in:
@@ -254,7 +254,7 @@ private:
|
||||
* to true, the failsafe will be initiated immediately.
|
||||
*/
|
||||
void failsafe(vehicle_local_position_setpoint_s &setpoint, const PositionControlStates &states, const bool force,
|
||||
const bool warn);
|
||||
bool warn);
|
||||
|
||||
/**
|
||||
* Reset setpoints to NAN
|
||||
@@ -921,8 +921,13 @@ MulticopterPositionControl::limit_thrust_during_landing(vehicle_attitude_setpoin
|
||||
|
||||
void
|
||||
MulticopterPositionControl::failsafe(vehicle_local_position_setpoint_s &setpoint, const PositionControlStates &states,
|
||||
const bool force, const bool warn)
|
||||
const bool force, bool warn)
|
||||
{
|
||||
// do not warn while we are disarmed, as we might not have valid setpoints yet
|
||||
if (!_control_mode.flag_armed) {
|
||||
warn = false;
|
||||
}
|
||||
|
||||
_failsafe_land_hysteresis.set_state_and_update(true, hrt_absolute_time());
|
||||
|
||||
if (!_failsafe_land_hysteresis.get_state() && !force) {
|
||||
|
||||
Reference in New Issue
Block a user