mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 19:53:34 +08:00
Tools: add PX4_SIM_SPEED_FACTOR as env variable
This adds the env variable PX4_SIM_SPEED_FACTOR to set the speed factor to run SITL at.
This commit is contained in:
+9
-1
@@ -66,10 +66,18 @@ done
|
|||||||
|
|
||||||
SIM_PID=0
|
SIM_PID=0
|
||||||
|
|
||||||
|
# Allow speed factor to bet set from environment.
|
||||||
|
if [[ -n "$PX4_SIM_SPEED_FACTOR" ]];
|
||||||
|
then
|
||||||
|
speed_factor=$PX4_SIM_SPEED_FACTOR
|
||||||
|
else
|
||||||
|
speed_factor=1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$program" == "jmavsim" ] && [ ! -n "$no_sim" ]
|
if [ "$program" == "jmavsim" ] && [ ! -n "$no_sim" ]
|
||||||
then
|
then
|
||||||
# Start Java simulator
|
# Start Java simulator
|
||||||
"$src_path"/Tools/jmavsim_run.sh -r 250 -f 1 &
|
"$src_path"/Tools/jmavsim_run.sh -r 250 -f $speed_factor &
|
||||||
SIM_PID=`echo $!`
|
SIM_PID=`echo $!`
|
||||||
elif [ "$program" == "gazebo" ] && [ ! -n "$no_sim" ]
|
elif [ "$program" == "gazebo" ] && [ ! -n "$no_sim" ]
|
||||||
then
|
then
|
||||||
|
|||||||
Reference in New Issue
Block a user