This repo provides a template for setting up:
- GitHub CI
- "main" branch runs in a ROS 2 Humble container
- Codecov badges
- Colcon workspace structure
- C++ library that depends on other system libraries such as OpenCV and rclcpp.
- The library is self-contained
- In real life, we download source code of third-party modules all the time and often just stick the modules as-is into our colcon workspace.
- ROS 2 package that depends on a C++ library built in the same colcon workspace
- Establishing package dependency within the colcon workspace.
- ie. the ROS 2 package will not be built before all of its dependent C++ libraries are built first
- Multiple subscriptions within a ROS2 node all listening to the same topic.
- Only one callback function is needed.
- More efficient than to have N callback functions.
- More efficient than to have N ROS nodes.
- Unit test and integration test.
- Doxygen setup
- ROS2 launch file
- Bash scripts that can be invoked by the "ros2 run ..." command
colcon graph --dot | dot -Tpng -o depGraph.png
open depGraph.png
rm -rf build/ install/
colcon build
source install/setup.bash
ros2 launch my_controller run_demo.launch.py
rm -rf build/ install/
colcon build --cmake-args -DCOVERAGE=1
source install/setup.bash
colcon test
First make sure we have run the unit test already.
colcon test
ros2 run my_controller generate_coverage_report.bash
open build/my_controller/test_coverage/index.html
colcon build \
--event-handlers console_cohesion+ \
--packages-select my_model \
--cmake-target "test_coverage" \
--cmake-arg -DUNIT_TEST_ALREADY_RAN=1
open build/my_model/test_coverage/index.html
./do-tests.bash
./do-docs.bash