Skip to content
Snippets Groups Projects
Commit f387fe7e authored by Ramón Hernán Roche Quintana's avatar Ramón Hernán Roche Quintana Committed by Daniel Agar
Browse files

sitl_run.sh handle spaces in paths

launch script for jmavsim failed to start if there were any spaces in
paths, string handling in paths was improved and tested.
parent a4c4f356
No related branches found
No related tags found
No related merge requests found
......@@ -56,8 +56,8 @@ pkill -x gazebo || true
pkill -x px4 || true
pkill -x px4_$model || true
cp $src_path/Tools/posix_lldbinit $rootfs/.lldbinit
cp $src_path/Tools/posix.gdbinit $rootfs/.gdbinit
cp "$src_path/Tools/posix_lldbinit" "$rootfs/.lldbinit"
cp "$src_path/Tools/posix.gdbinit" "$rootfs/.gdbinit"
shift 6
for file in "$@"; do
......@@ -69,7 +69,7 @@ SIM_PID=0
if [ "$program" == "jmavsim" ] && [ ! -n "$no_sim" ]
then
# Start Java simulator
$src_path/Tools/jmavsim_run.sh -r 500 &
"$src_path"/Tools/jmavsim_run.sh -r 500 &
SIM_PID=`echo $!`
elif [ "$program" == "gazebo" ] && [ ! -n "$no_sim" ]
then
......@@ -78,9 +78,9 @@ then
if [[ -z "$DONT_RUN" ]]
then
# Set the plugin path so Gazebo finds our model and sim
source $src_path/Tools/setup_gazebo.bash ${src_path} ${build_path}
source "$src_path/Tools/setup_gazebo.bash" "${src_path}" "${build_path}"
gzserver --verbose ${src_path}/Tools/sitl_gazebo/worlds/${model}.world &
gzserver --verbose "${src_path}/Tools/sitl_gazebo/worlds/${model}.world" &
SIM_PID=`echo $!`
if [[ -n "$HEADLESS" ]]; then
......@@ -105,9 +105,9 @@ pushd "$rootfs" >/dev/null
set +e
if [[ ${model} == test_* ]] || [[ ${model} == *_generated ]]; then
sitl_command="$sitl_bin $no_pxh $src_path/ROMFS/px4fmu_test -s ${src_path}/posix-configs/SITL/init/test/${model} -t $src_path/test_data"
sitl_command="\"$sitl_bin\" $no_pxh \"$src_path\"/ROMFS/px4fmu_test -s \"${src_path}\"/posix-configs/SITL/init/test/${model} -t \"$src_path\"/test_data"
else
sitl_command="$sitl_bin $no_pxh $src_path/ROMFS/px4fmu_common -s etc/init.d-posix/rcS -t $src_path/test_data"
sitl_command="\"$sitl_bin\" $no_pxh \"$src_path\"/ROMFS/px4fmu_common -s etc/init.d-posix/rcS -t \"$src_path\"/test_data"
fi
echo SITL COMMAND: $sitl_command
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment