ros2-types-derive
Derive macros for ROS2 TypeDescription and Ros2Msg traits.
Overview
This crate provides procedural macros that generate ROS2 type descriptions and message bindings automatically from Rust struct definitions.
Derive Macros
TypeDescription— Generates type descriptions for ROS2 type hash computationRos2Msg— Generates ROS2 message bindings (FFI withrclfeature, pure Rust otherwise)
Helper Macros
ros2_service!— Generates service wrapper typesros2_action!— Generates action wrapper types
Attributes
Container Attributes
#[ros2(package = "pkg_name")]— Specify the ROS2 package name#[ros2(interface_type = "msg|srv|action")]— Specify the interface type (default:"msg")
Field Attributes
#[ros2(ros2_type = "byte")]— Override field type (for byte, char, wstring)#[ros2(capacity = 255)]— Specify capacity for bounded strings/sequences#[ros2(default = "0")]— Specify default value
Example
use ;