#ros #codegen #genmsg

bin+lib roslibrust_genmsg

A tool for generating source code from ROS message definitions

8 releases (breaking)

0.21.0 May 19, 2026
0.20.0 Mar 2, 2026
0.19.0 Jan 14, 2026
0.18.0 Nov 25, 2025
0.9.0 May 13, 2024

#379 in Robotics

Download history 42/week @ 2026-02-07 61/week @ 2026-02-14 52/week @ 2026-02-21 33/week @ 2026-02-28 63/week @ 2026-03-07 55/week @ 2026-03-14 39/week @ 2026-03-21 75/week @ 2026-03-28 28/week @ 2026-04-04 16/week @ 2026-04-11 3/week @ 2026-04-25 11/week @ 2026-05-02 22/week @ 2026-05-09 31/week @ 2026-05-16 22/week @ 2026-05-23

88 downloads per month

MIT license

225KB
4K SLoC

roslibrust_genmsg

A CLI application and library for generating ROS C++ headers using roslibrust_codegen as the backend.

Running the command line application:

roslibrust$ mkdir -p /tmp/sensor_msgs && \ 
cargo run --bin gencpp -- \
--msg assets/ros1_common_interfaces/common_msgs/sensor_msgs/msg/BatteryState.msg \
--package sensor_msgs \
-I std_msgs:assets/ros1_common_interfaces/std_msgs \
-I geometry_msgs:assets/ros1_common_interfaces/common_msgs/geometry_msgs \
-I sensor_msgs:assets/ros1_common_interfaces/common_msgs/sensor_msgs \
--output /tmp/sensor_msgs

Key Differences with the official CLI

  • The include paths must be to the top-level of the message package directory as roslibrust_codegen uses this to determine the ROS version.
  • The output is to a path instead of a file. Filenames are assumed based on message or service file name.
  • The include paths must include the package that the input message comes from as roslibrust_codegen does not currently expose an API for parsing a message given a message file path. Consequently, you'll want to include any dependencies of other messages in the package so that roslibrust_codegen can solve the dependency graph.

Dependencies

~5.5–10MB
~183K SLoC