mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
jMAVSim: use PX4_SIM_SPEED_FACTOR, not cli arg
In order to be consistent between Gazebo and jMAVSim we should be using the env variable PX4_SIM_SPEED_FACTOR in the same way. This enables vscode to set the speed using the env variable.
This commit is contained in:
+1
-1
Submodule Tools/jMAVSim updated: dc10a13c78...883413f8b9
@@ -33,9 +33,6 @@ while getopts ":b:d:p:qsr:f:i:l" opt; do
|
|||||||
r)
|
r)
|
||||||
extra_args="$extra_args -r $OPTARG"
|
extra_args="$extra_args -r $OPTARG"
|
||||||
;;
|
;;
|
||||||
f)
|
|
||||||
extra_args="$extra_args -f $OPTARG"
|
|
||||||
;;
|
|
||||||
l)
|
l)
|
||||||
extra_args="$extra_args -lockstep"
|
extra_args="$extra_args -lockstep"
|
||||||
;;
|
;;
|
||||||
|
|||||||
+1
-8
@@ -63,16 +63,9 @@ 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" ]; then
|
if [ "$program" == "jmavsim" ] && [ ! -n "$no_sim" ]; then
|
||||||
# Start Java simulator
|
# Start Java simulator
|
||||||
"$src_path"/Tools/jmavsim_run.sh -r 250 -f $speed_factor -l &
|
"$src_path"/Tools/jmavsim_run.sh -r 250 -l &
|
||||||
SIM_PID=`echo $!`
|
SIM_PID=`echo $!`
|
||||||
elif [ "$program" == "gazebo" ] && [ ! -n "$no_sim" ]; then
|
elif [ "$program" == "gazebo" ] && [ ! -n "$no_sim" ]; then
|
||||||
if [ -x "$(command -v gazebo)" ]; then
|
if [ -x "$(command -v gazebo)" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user