mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-17 17:00:35 +08:00
commander: Add parameter to control postal fallback after loss of navigation accuracy
Also remove else if branch that cannot be accessed.
This commit is contained in:
committed by
ChristophTobler
parent
b85c8fa135
commit
00a42abc69
@@ -1378,6 +1378,9 @@ int commander_thread_main(int argc, char *argv[])
|
||||
param_t _param_max_imu_acc_diff = param_find("COM_ARM_IMU_ACC");
|
||||
param_t _param_max_imu_gyr_diff = param_find("COM_ARM_IMU_GYR");
|
||||
|
||||
/* failsafe response to loss of navigation accuracy */
|
||||
param_t _param_posctl_nav_loss_act = param_find("COM_POSCTL_NAVL");
|
||||
|
||||
// These are too verbose, but we will retain them a little longer
|
||||
// until we are sure we really don't need them.
|
||||
|
||||
@@ -1757,6 +1760,7 @@ int commander_thread_main(int argc, char *argv[])
|
||||
float offboard_loss_timeout = 0.0f;
|
||||
int32_t offboard_loss_act = 0;
|
||||
int32_t offboard_loss_rc_act = 0;
|
||||
int32_t posctl_nav_loss_act = 0;
|
||||
|
||||
int32_t geofence_action = 0;
|
||||
|
||||
@@ -1906,6 +1910,9 @@ int commander_thread_main(int argc, char *argv[])
|
||||
param_get(_param_max_imu_acc_diff, &max_imu_acc_diff);
|
||||
param_get(_param_max_imu_gyr_diff, &max_imu_gyr_diff);
|
||||
|
||||
/* failsafe response to loss of navigation accuracy */
|
||||
param_get(_param_posctl_nav_loss_act, &posctl_nav_loss_act);
|
||||
|
||||
param_init_forced = false;
|
||||
}
|
||||
|
||||
@@ -3065,7 +3072,8 @@ int commander_thread_main(int argc, char *argv[])
|
||||
land_detector.landed,
|
||||
(link_loss_actions_t)rc_loss_act,
|
||||
offboard_loss_act,
|
||||
offboard_loss_rc_act);
|
||||
offboard_loss_rc_act,
|
||||
posctl_nav_loss_act);
|
||||
|
||||
if (status.failsafe != failsafe_old)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user