From d139bc5a7c7394038260cb553a3eb12040c9be0c Mon Sep 17 00:00:00 2001 From: Fabian Schilling Date: Wed, 3 Jul 2019 11:06:06 +0200 Subject: [PATCH] Use bc to support floating point PX4_SIM_SPEED_FACTOR --- 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 4bd7df91ed..d0b3e248c1 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rcS +++ b/ROMFS/px4fmu_common/init.d-posix/rcS @@ -167,15 +167,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=$((PX4_SIM_SPEED_FACTOR * 10)) + COM_DL_LOSS_T_LONGER=$(echo "$PX4_SIM_SPEED_FACTOR * 10" | bc) 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=$((PX4_SIM_SPEED_FACTOR * 1)) + COM_RC_LOSS_T_LONGER=$(echo "$PX4_SIM_SPEED_FACTOR * 1" | 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=$((PX4_SIM_SPEED_FACTOR * 10)) + COM_OF_LOSS_T_LONGER=$(echo "$PX4_SIM_SPEED_FACTOR * 10" | 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