Style Guide

This project uses the ROS2 style guide as a base. The following section describes alterations to said style guide.

The ROS2 style guide can be found at: https://docs.ros.org/en/jazzy/The-ROS2-Project/Contributing/Code-Style-Language-Versions.html

Directory Naming Conventions

The following naming conventions only hold true for directories in the src directory.

  • Use snake_case for packages.

  • Use the cpm_lab_ prefix for packages, e.g. cpm_lab_path_tracking.

  • Use kebab-case for directories that group packages, e.g. high-level-controller. These directories are usually git submodules.

  • Do not use the cpm_lab_ prefix for directories inside a package, like launch, config or component.

File Naming Conventions

  • Use snake_case for file names.

  • Use node as a suffix for files containing a ROS2 node, e.g. path_tracking_node.cpp in the cpm_lab_path_tracking package. The name of the executable should be the same as the file name without the .cpp or .py suffix.

  • Name the default launch file of a package default.launch.xml and its default parameters config/default.yaml.

Package Layout

C++ packages follow this layout:

  • component/: the ROS2 node as composable component, including the parameter handling.

  • include/<package>/ and src/: the ROS-independent library code.

  • config/default.yaml: the default parameters, loaded by the launch file.

  • launch/default.launch.xml: starts the component in a container.

  • test/: unit tests.

Every package has a CHANGELOG.rst, which is updated for every release.