mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08: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:
parent
d68e595514
commit
c0352027fb
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user