An opinionated ROS2 C++ node template, optimised for ISC.
- Clone repo inside your workspaces src directory (Ex. phnx_ws/src)
rosdep install --from-paths . --ignore-src -r -yto install depscolcon buildto make sure the repo builds before you mess with it- Replace the following in both file names and code exactly and consistently.
- yet_another_gps_publisher: Replace with the package name. Use snake case. Ex.
data_logger - yet_another_gps_publisher: Replace with the node name. Use Pascal case. Ex.
DataLogger
- yet_another_gps_publisher: Replace with the package name. Use snake case. Ex.
colcon buildagain. If it builds, you are done- Rename outer folder
- Review the optional dependencies, and remove what you do not need
Some common extra dependencies are included. Review them and remove what you don't need. These are marked with yet_another_gps_publisher.
- Unit tests
- ROS-Industrial github CI (will test units and lints)
- C++ formatting via clangformat
- A selection of sane lints
- A single node setup in a multithreaded executor
.
├── include
│ └── yet_another_gps_publisher
│ └── yet_another_gps_publisher_node.hpp
├── package.xml
├── README.md
├── src
│ ├── yet_another_gps_publisher.cpp
│ └── yet_another_gps_publisher.cpp
└── tests
└── unit.cpp
yet_another_gps_publisher_NODE_NAME_node: Source files for the ROS2 node object itself, and only itself
yet_another_gps_publisher_NODE_NAME.cpp: Source for the main function of the node, and only the main function
tests/unit.cpp: Example file for unit tests. This is linked to the node and ros, so both can be used