Skip to content

ROS 2 Protocol Bindings

The ROS 2 (Robot Operating System 2) protocol bindings for AsyncAPI enable seamless integration between ROS 2 robotics systems and event-driven architectures. These bindings provide comprehensive configuration options for ROS 2 nodes, Quality of Service (QoS) policies, and middleware implementations.

ROS 2 is a set of software libraries and tools for building robot applications. It provides a flexible framework for writing robot software with support for multiple programming languages, real-time systems, and distributed computing. The ROS 2 bindings in AsyncAPI allow you to:

  • Configure ROS 2 nodes and their roles (publisher, subscriber, service, action)
  • Define Quality of Service (QoS) policies for reliable communication
  • Specify middleware implementations (FastRTPS, CycloneDDS, etc.)
  • Set up domain IDs for network isolation
  • Integrate robotics systems with event-driven architectures
  • Publisher/Subscriber: Configure publish-subscribe communication patterns
  • Service Client/Server: Set up request-response service patterns
  • Action Client/Server: Configure long-running action patterns
  • Node Identification: Specify ROS 2 node names and roles
  • Reliability: Choose between best_effort and reliable delivery
  • Durability: Configure volatile or transient_local message persistence
  • History: Set queue depth with keep_last, keep_all, or unknown
  • Deadline: Define maximum time between messages
  • Lifespan: Set message expiration time
  • Liveliness: Configure automatic or manual liveliness monitoring
  • Lease Duration: Set publisher liveliness timeout
  • FastRTPS: Default DDS implementation
  • CycloneDDS: Alternative DDS implementation
  • OpenDDS: Additional DDS option
  • Custom Implementations: Support for other RMW implementations
  • Sensor Data Streaming: Configure publishers for sensor data (camera, lidar, IMU)
  • Command Processing: Set up subscribers for robot control commands
  • Service Integration: Define service clients/servers for parameter management
  • Action Coordination: Configure action clients/servers for complex behaviors
  • Multi-Robot Systems: Use domain IDs to isolate different robot groups
  • Real-time Communication: Configure QoS policies for time-sensitive data
  • Reliable Messaging: Ensure critical messages are delivered reliably
  • Network Optimization: Tune middleware settings for performance
  1. Choose Your Version: Select the appropriate ROS 2 binding version
  2. Configure Nodes: Define your ROS 2 nodes and their roles
  3. Set QoS Policies: Configure quality of service for your use case
  4. Specify Middleware: Choose your preferred RMW implementation
  5. Test Integration: Validate your configuration with ROS 2 tools
channels:
sensorData:
publish:
bindings:
ros2:
bindingVersion: "0.1.0"
node: "/sensor_node"
role: "publisher"
qosPolicies:
reliability: "reliable"
durability: "volatile"
history: "keep_last"
channels:
parameterService:
subscribe:
bindings:
ros2:
bindingVersion: "0.1.0"
node: "/parameter_server"
role: "service_server"
qosPolicies:
reliability: "reliable"
durability: "transient_local"
  • ROS 2 Community: Join the ROS 2 community for robotics discussions
  • AsyncAPI Community: Connect with AsyncAPI users and contributors
  • Documentation Issues: Report documentation issues or improvements
  • Feature Requests: Suggest new binding features or improvements

Versions and changes

Generated from the binding JSON Schemas: every field each version added or removed.

VersionWhat changedPages
0.1.0latest

First version: server binding, operation binding.

server, channel, operation, message

Fields in version 0.1.0

Server binding

FieldTypeDescription
domainIdintegerAll ROS 2 nodes use domain ID 0 by default. To prevent interference between different groups of computers running ROS 2 on the same network, a group can be set with a unique domain ID
rmwImplementationstringSpecifies the ROS 2 middleware implementation to be used. This determines the underlying middleware implementation that handles communication

Server binding 0.1.0: examples and details

Operation binding

FieldTypeDescription
noderequiredstringThe name of the ROS 2 node that implements this operation
qosPoliciesobject
qosPolicies.deadlineintegerThe expected maximum amount of time between subsequent messages being published to a topic. -1 means infinite
qosPolicies.durabilitystring
transient_localvolatile
Persistence specification that determines message availability for late-joining subscribers
qosPolicies.historystring
keep_lastkeep_allunknown
Policy parameter that defines the maximum number of samples maintained in the middleware queue
qosPolicies.leaseDurationintegerThe maximum period of time a publisher has to indicate that it is alive before the system considers it to have lost liveliness. -1 means infinite
qosPolicies.lifespanintegerThe maximum amount of time between the publishing and the reception of a message without the message being considered stale or expired. -1 means infinite
qosPolicies.livelinessstring
automaticmanual
Defines the mechanism by which the system monitors and determines the operational status of communication entities within the network
qosPolicies.reliabilitystring
best_effortreliable
Specifies the communication guarantee model that determines whether message delivery confirmation between publisher and subscriber is required
rolerequiredstring
publisheraction_clientservice_clientsubscriberaction_serverservice_server
Specifies the ROS 2 type of the node for this operation

Operation binding 0.1.0: examples and details

Validate with JSON Schema

Point your editor, CI or AI agent at these schemas to validate the ROS 2 bindings of version 0.1.0. They come from the AsyncAPI JSON Schema registry.

Questions

How do I describe a ROS 2 publisher or subscriber in AsyncAPI?

With the ROS 2 operation binding: role, node and qosPolicies (reliability, history, durability, lifespan, deadline, liveliness). The server binding sets rmwImplementation and domainId.