ROS 2 Message Binding v0.1.0
The ROS 2 message binding defines how AsyncAPI messages map to ROS 2 message types and properties. This binding provides basic configuration for ROS 2 message-based communication.
Overview
Section titled “Overview”ROS 2 message bindings configure the message properties and data types used in ROS 2 communication. They define:
- Message Properties: Basic settings for ROS 2 messages
- Data Types: How AsyncAPI messages map to ROS 2 message types
- Communication Patterns: Message-based communication configurations
Properties
Section titled “Properties”| Property | Type | Required | Description |
|---|---|---|---|
bindingVersion |
string | No | The version of this binding. If omitted, ‘latest’ MUST be assumed. |
bindingVersion
Section titled “bindingVersion”The version of this binding. If omitted, ‘latest’ MUST be assumed.
Type: string
Default: "0.1.0"
Required: No
Examples
Section titled “Examples”Basic Message Configuration
Section titled “Basic Message Configuration”channels: sensorData: publish: message: bindings: ros2: bindingVersion: "0.1.0"Multiple Message Types
Section titled “Multiple Message Types”channels: cameraImage: publish: message: bindings: ros2: bindingVersion: "0.1.0"
lidarScan: publish: message: bindings: ros2: bindingVersion: "0.1.0"Service Message
Section titled “Service Message”channels: parameterService: subscribe: message: bindings: ros2: bindingVersion: "0.1.0"Use Cases
Section titled “Use Cases”Sensor Data Messages
Section titled “Sensor Data Messages”- Image Messages: Configure messages for camera image data
- Point Cloud Messages: Set up messages for lidar scan data
- IMU Messages: Define messages for inertial measurement unit data
- GPS Messages: Configure messages for GPS position data
Control Messages
Section titled “Control Messages”- Command Messages: Set up messages for robot control commands
- Status Messages: Define messages for robot status information
- Feedback Messages: Configure messages for control feedback
Service Messages
Section titled “Service Messages”- Request Messages: Configure messages for service requests
- Response Messages: Set up messages for service responses
- Parameter Messages: Define messages for parameter management
Message Types
Section titled “Message Types”Standard ROS 2 Messages
Section titled “Standard ROS 2 Messages”- Primitive Types: Basic data types (int, float, string, bool)
- Complex Types: Arrays, structures, and nested objects
- Time Types: Timestamps and duration values
- Geometric Types: Points, vectors, and transforms
Custom Message Types
Section titled “Custom Message Types”- Domain-Specific: Messages tailored to specific applications
- Vendor-Specific: Messages for specific hardware or software
- Protocol-Specific: Messages for specific communication protocols
Service Message Types
Section titled “Service Message Types”- Request Messages: Input parameters for service calls
- Response Messages: Output parameters for service calls
- Feedback Messages: Progress updates for long-running operations
Best Practices
Section titled “Best Practices”Message Design
Section titled “Message Design”- Use descriptive message names that indicate the data type
- Follow ROS 2 message naming conventions
- Keep messages focused on a single purpose
- Document message structure and field meanings
Data Type Selection
Section titled “Data Type Selection”- Choose appropriate primitive types for your data
- Use standard ROS 2 message types when possible
- Consider message size and performance implications
- Validate message compatibility across systems
Message Documentation
Section titled “Message Documentation”- Document message purpose and usage
- Provide examples of message content
- Specify data ranges and constraints
- Include unit information for numeric fields