mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
commander: unify offboard timeouts
The implementation before this change had two timeouts, a hard-coded timeout of 0.5 seconds as well as a by param configurable timeout with certain failsafe actions set. This change aims to fix two problems: 1. The hard-coded offboard timeout can be triggered easily with sped up lockstep simulation. Since i t is hard-coded it can't be adapted to the speed factor. 2. The offboard signal can time out but no action will be taken just yet. This means we end up in an in-between stage where no warning or failsafe action has happened yet, even though certain flags are set to a timeout state. This patch aims to fix this by unifying the two timeouts to the existing configurable param. The convoluted double timeout logic is replaced by a simple hysteresis. For anyone that has previously not changed the default timeout param (0), the param will now be changed to 0.5 seconds which reflects the previously hardcoded time. For anyone with a specific timeout configured, the behaviour should remain the same. Also, going forward, timeouts lower than 0.5 seconds should be possible.
This commit is contained in:
@@ -135,7 +135,6 @@ then
|
||||
param set COM_DISARM_LAND 0.5
|
||||
param set COM_OBL_ACT 2
|
||||
param set COM_OBL_RC_ACT 0
|
||||
param set COM_OF_LOSS_T 5
|
||||
param set COM_RC_IN_MODE 1
|
||||
|
||||
param set EKF2_AID_MASK 1
|
||||
@@ -199,11 +198,11 @@ if [ ! -z $PX4_SIM_SPEED_FACTOR ]; then
|
||||
echo "COM_DL_LOSS_T set to $COM_DL_LOSS_T_LONGER"
|
||||
param set COM_DL_LOSS_T $COM_DL_LOSS_T_LONGER
|
||||
|
||||
COM_RC_LOSS_T_LONGER=$(echo "$PX4_SIM_SPEED_FACTOR * 1" | bc)
|
||||
COM_RC_LOSS_T_LONGER=$(echo "$PX4_SIM_SPEED_FACTOR * 0.5" | bc)
|
||||
echo "COM_RC_LOSS_T set to $COM_RC_LOSS_T_LONGER"
|
||||
param set COM_RC_LOSS_T $COM_RC_LOSS_T_LONGER
|
||||
|
||||
COM_OF_LOSS_T_LONGER=$(echo "$PX4_SIM_SPEED_FACTOR * 10" | bc)
|
||||
COM_OF_LOSS_T_LONGER=$(echo "$PX4_SIM_SPEED_FACTOR * 0.5" | bc)
|
||||
echo "COM_OF_LOSS_T set to $COM_OF_LOSS_T_LONGER"
|
||||
param set COM_OF_LOSS_T $COM_OF_LOSS_T_LONGER
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user