Add utility scripts #2871
Replies: 4 comments
-
Let me share the script I use: #!/bin/bash
CMAKE_ARGS=("-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_EXPORT_COMPILE_COMMANDS=1")
ARGS=("--symlink-install") # --executor sequential")
MAP=$HOME/autoware/maps/planning_simulator_sample_map/
VEHICLE=sample_vehicle SENSOR=sample_sensor_kit
PKG=(grid_map_utils tier4_planning_rviz_plugin)
if [[ $# -gt 1 ]]; then
PKG=$2
fi
set -x # print the executed commands
case $1 in
bag)
ros2 launch autoware_launch logging_simulator.launch.xml map_path:="$MAP" vehicle_model:="$VEHICLE" sensor_model:="$SENSOR" localization:=false
;;
test)
colcon test --packages-select "$PKG" --event-handlers console_direct+
;;
sim)
ros2 launch autoware_launch planning_simulator.launch.xml map_path:="$MAP" vehicle_model:="$VEHICLE" sensor_model:="$SENSOR" use_sim_time:=true
;;
debug)
colcon build --cmake-args ${CMAKE_ARGS[@]} -DCMAKE_BUILD_TYPE=Debug --packages-select ${PKG[@]} ${ARGS[@]}
;;
debug2)
colcon build --cmake-args ${CMAKE_ARGS[@]} -DCMAKE_BUILD_TYPE=RelWithDebInfo --packages-select ${PKG[@]} ${ARGS[@]}
;;
clean)
for pkg in "${PKG[@]}"
do
rm -rf install/$pkg build/$pkg
done
;;
build)
ARGS+=("--catkin-skip-building-tests")
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Release")
CMD=""
if [[ $# -gt 1 ]]; then
CMD="--packages-up-to ${PKG[@]}"
fi
colcon build $CMD --cmake-args ${CMAKE_ARGS[@]} ${ARGS[@]}
;;
*)
if [[ $# -gt 0 ]]; then
PKG=$@
fi
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release ${CMAKE_ARGS[@]} --packages-select ${PKG[@]} ${ARGS[@]}
;;
esac |
Beta Was this translation helpful? Give feedback.
-
For fish shell users, I'd recommend my plugins for better ROS life.
For example, if you just type |
Beta Was this translation helpful? Give feedback.
-
@isamu-takagi |
Beta Was this translation helpful? Give feedback.
-
Close this discussion as a tools repository will be created. |
Beta Was this translation helpful? Give feedback.
-
In Autoware, there are commands that are used frequently, so it would be convenient if this was a script. For example, update a workspace. I've seen some people get an error because they forgot one of the following:
In addition, colcon build.
How about adding these to the directory something like
tools
orutils
? And are there any other commands you would like to script?Beta Was this translation helpful? Give feedback.
All reactions