From be35c4857be2483050d9a34987aeda3c6935b516 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Wed, 25 Dec 2019 00:41:43 +0100 Subject: [PATCH] SITL shell: Do math using the shell Bash or zsh from the last 10 years or so do math using the $((a + b)) syntax. This saves us from having bc as dependency. --- ROMFS/px4fmu_common/init.d-posix/rcS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d-posix/rcS b/ROMFS/px4fmu_common/init.d-posix/rcS index f59a959321..359119da48 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rcS +++ b/ROMFS/px4fmu_common/init.d-posix/rcS @@ -191,15 +191,15 @@ fi # Adapt timeout parameters if simulation runs faster or slower than realtime. if [ ! -z $PX4_SIM_SPEED_FACTOR ]; then - COM_DL_LOSS_T_LONGER=$(echo "$PX4_SIM_SPEED_FACTOR * 10" | bc) + COM_DL_LOSS_T_LONGER=$((PX4_SIM_SPEED_FACTOR * 2)) 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=$((PX4_SIM_SPEED_FACTOR * 2)) 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=$((PX4_SIM_SPEED_FACTOR * 2)) echo "COM_OF_LOSS_T set to $COM_OF_LOSS_T_LONGER" param set COM_OF_LOSS_T $COM_OF_LOSS_T_LONGER fi