Skip to content
Snippets Groups Projects
Commit a394dd5b authored by Lorenz Meier's avatar Lorenz Meier
Browse files

Add gazebo, gazebo_iris and gazebo_vtol targets

parent bdcddd78
No related branches found
No related tags found
No related merge requests found
......@@ -184,7 +184,7 @@ clean:
# targets handled by cmake
cmake_targets = test upload package package_source debug debug_tui debug_ddd debug_io debug_io_tui debug_io_ddd check_weak \
run_cmake_config config gazebo gazebo_gdb gazebo_lldb jmavsim \
jmavsim_gdb jmavsim_lldb
jmavsim_gdb jmavsim_lldb gazebo_gdb_iris gazebo_lldb_vtol gazebo_iris gazebo_vtol
$(foreach targ,$(cmake_targets),$(eval $(call cmake-targ,$(targ))))
.PHONY: clean
......
......@@ -3,18 +3,27 @@
rc_script=$1
debugger=$2
program=$3
build_path=$4
model=$4
build_path=$5
curr_dir=`pwd`
echo SITL ARGS
echo rc_script: $rc_script
echo debugger: $debugger
echo program: $program
echo model: $model
echo build_path: $build_path
if [ "$#" != 4 ]
if [ "$model" == "" ] || [ "$model" == "none" ]
then
echo usage: sitl_run.sh rc_script debugger program build_path
echo "empty model, setting iris as default"
model="iris"
fi
if [ "$#" != 5 ]
then
echo usage: sitl_run.sh rc_script debugger program model build_path
echo ""
exit 1
fi
......@@ -54,9 +63,9 @@ then
cd Tools/sitl_gazebo/Build
cmake ..
make -j4
gzserver ../worlds/iris.world &
gzserver ../worlds/${model}.world &
SIM_PID=`echo $!`
gzclient&
gzclient &
GUI_PID=`echo $!`
else
echo "You need to have gazebo simulator installed!"
......@@ -78,10 +87,10 @@ else
./mainapp ../../../../${rc_script}_${program}
fi
if [ "$3" == "jmavsim" ]
if [ "$program" == "jmavsim" ]
then
kill -9 $SIM_PID
elif [ "$3" == "gazebo" ]
elif [ "$program" == "gazebo" ]
then
kill -9 $SIM_PID
kill -9 $GUI_PID
......
......@@ -26,27 +26,37 @@ endif()
add_custom_target(run_config
COMMAND Tools/sitl_run.sh "${config_sitl_rcS}" "${config_sitl_debugger}"
"${config_sitl_viewer}" "${CMAKE_BINARY_DIR}"
"${config_sitl_viewer}" "${config_sitl_model}" "${CMAKE_BINARY_DIR}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
USES_TERMINAL
)
add_dependencies(run_config mainapp)
foreach(viewer jmavsim gazebo)
foreach(viewer none jmavsim gazebo)
foreach(debugger none gdb lldb)
if (debugger STREQUAL "none")
set(_targ_name "${viewer}")
else()
set(_targ_name "${viewer}_${debugger}")
endif()
add_custom_target(${_targ_name}
COMMAND Tools/sitl_run.sh "${config_sitl_rcS}"
"${debugger}"
"${viewer}" "${CMAKE_BINARY_DIR}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
USES_TERMINAL
)
add_dependencies(${_targ_name} mainapp)
foreach(model none iris vtol)
if (debugger STREQUAL "none")
if (model STREQUAL "none")
set(_targ_name "${viewer}")
else()
set(_targ_name "${viewer}_${model}")
endif()
else()
if (model STREQUAL "none")
set(_targ_name "${viewer}___${debugger}")
else()
set(_targ_name "${viewer}_${model}_${debugger}")
endif()
endif()
add_custom_target(${_targ_name}
COMMAND Tools/sitl_run.sh "${config_sitl_rcS}"
"${debugger}"
"${viewer}" "${model}" "${CMAKE_BINARY_DIR}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
USES_TERMINAL
)
add_dependencies(${_targ_name} mainapp)
endforeach()
endforeach()
endforeach()
......
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