mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 07:03:33 +08:00
Commander: consistent hysteresis initialization
This commit is contained in:
committed by
Daniel Agar
parent
d10f9030ad
commit
955aad0dfb
@@ -787,8 +787,6 @@ Commander::Commander() :
|
|||||||
ModuleParams(nullptr),
|
ModuleParams(nullptr),
|
||||||
_failure_detector(this)
|
_failure_detector(this)
|
||||||
{
|
{
|
||||||
_auto_disarm_landed.set_hysteresis_time_from(false, _param_com_disarm_preflight.get() * 1_s);
|
|
||||||
|
|
||||||
_land_detector.landed = true;
|
_land_detector.landed = true;
|
||||||
|
|
||||||
// XXX for now just set sensors as initialized
|
// XXX for now just set sensors as initialized
|
||||||
@@ -2042,6 +2040,7 @@ Commander::run()
|
|||||||
_arm_requirements.geofence = _param_geofence_action.get() > geofence_result_s::GF_ACTION_NONE;
|
_arm_requirements.geofence = _param_geofence_action.get() > geofence_result_s::GF_ACTION_NONE;
|
||||||
|
|
||||||
_auto_disarm_killed.set_hysteresis_time_from(false, _param_com_kill_disarm.get() * 1_s);
|
_auto_disarm_killed.set_hysteresis_time_from(false, _param_com_kill_disarm.get() * 1_s);
|
||||||
|
_offboard_available.set_hysteresis_time_from(true, _param_com_of_loss_t.get() * 1_s);
|
||||||
|
|
||||||
// disable arm gesture if an arm switch is configured
|
// disable arm gesture if an arm switch is configured
|
||||||
if (param_man_arm_gesture != PARAM_INVALID && param_rc_map_arm_sw != PARAM_INVALID) {
|
if (param_man_arm_gesture != PARAM_INVALID && param_rc_map_arm_sw != PARAM_INVALID) {
|
||||||
@@ -2079,8 +2078,6 @@ Commander::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_offboard_available.set_hysteresis_time_from(true, _param_com_of_loss_t.get() * 1e6f);
|
|
||||||
|
|
||||||
param_init_forced = false;
|
param_init_forced = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user