Skip to content

ROS2 CLI tool to generate ROS Wiki style documentation template for ROS2 nodes

License

Notifications You must be signed in to change notification settings

3473f/ros2autodoc

Repository files navigation

ros2autodoc

Colcon Build Ament Lint Maintainability

Overview

The ros2autodoc package provides a ROS2 command line interface tool to automatically generate documentation for ROS2 nodes. The tool outputs an initial documentation file detailing the interface (parameters, publishers, subscribers, services and actions) for a running ROS2 node. The package was tested with ROS2 Foxy, Humble and Iron.

Installation

  1. Install a recent ROS2 version.
  2. Make sure that colcon is installed:
sudo apt install python3-colcon-common-extensions
  1. Clone this repo into your workspace:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws
git clone https://github.com/3473f/ros2autodoc ./src
  1. Build the workspace:
colcon build
source install/setup.bash

Usage

$ ros2 autodoc generate --help

usage: ros2 autodoc generate [-h] [--package-name] [--output-dir] [--seperate-files] [node ...]

Automatically generate documentation for a ROS2 node

positional arguments:
  node              name of the nodes to be documented. If not specified, all running nodes from the package will be documented.

options:
  -h, --help        show this help message and exit
  --package-name    name of the package to be documented. If not specified, the package documentation will be left out.
  --output-dir      the directory where documentation should be written. If not specified, the file will be saved to the current
                    directory.
  --seperate-files  when this option is set, the node documentation will be written to separate files and no package documentation will
                    be generated.

Example

We are going to demonstrate the usage of this package using the turtlesim package included in ROS2.

First, run the turtlesim node:

ros2 run turtlesim turtlesim_node

Next, run the draw_square node in another terminal:

ros2 run turtlesim draw_square

Finally, generate the documentation for these two nodes by running this command in a new terminal:

ros2 autodoc generate turtlesim draw_square --package-name turtlesim

This should output the following README.md file to your current working directory.

About

ROS2 CLI tool to generate ROS Wiki style documentation template for ROS2 nodes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages