Skip to content

Style Guide

Jerome Justin edited this page Aug 3, 2022 · 1 revision

Coding Style

Google C++ style guide

ROS2 Package and Node Naming Convention

  • Package name should be named like ros2_<some>_pkg where <some> is a short descriptive name of the package

  • Package name must ros2 as prefix so its easier to distinguid between ros1 and ros2 packages that may be designed for similar tasks

  • All publisher or subscriber nodes must be named in this format <some>_publisher_node or <some>_subscriber_node

  • All action nodes must be named in this format <some>_action_client_node or <some>_action_server_node

  • All service nodes must be named in this format <some>_service_client_node or <some>_service_server_node

  • Where <some> is a short descriptive name of the task the node does. Example: Fibonacci or AddTwoInts

  • To invoke a node you can run the python script from its root folder like below must end with _node postfix. This makes it easier to distinguish which files are node files without opening them.

Linting

Clone this wiki locally