Skip to content

Commit

Permalink
Use bc to support floating point PX4_SIM_SPEED_FACTOR
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Schilling authored and julianoes committed Jul 3, 2019
1 parent dce1dda commit d139bc5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ROMFS/px4fmu_common/init.d-posix/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d139bc5

Please sign in to comment.