Skip to content

Draft rosidl.0c REP#22

Open
hidmic wants to merge 3 commits intoopenrobotics:mainfrom
hidmic:rosidl0c
Open

Draft rosidl.0c REP#22
hidmic wants to merge 3 commits intoopenrobotics:mainfrom
hidmic:rosidl0c

Conversation

@hidmic
Copy link

@hidmic hidmic commented Jan 21, 2026

Connected to https://discourse.openrobotics.org/t/is-it-time-to-discuss-rosidl/49867. Pending ROS PMC sponsor assignment, if the PMC is willing.

Reference implementation pending design discussion (and resolution of some TBDs).

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic hidmic requested review from gbiggs and tfoote as code owners January 21, 2026 21:36
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic
Copy link
Author

hidmic commented Jan 27, 2026

@mjcarroll before building anything, it'd be good to reach some consensus. This needs a PMC sponsor too IIUC (if the group agrees this is worthwhile, of course).

@mjcarroll
Copy link

I would like to put this under the responsibility of the newly formed accelerated memory transport working group, since we have been having discussions about the rcl::Buffer approach there as well. Can we plan on adding this to the first agenda there?

We can rectify what is here against the proposed rcl::Buffer approach.

@hidmic
Copy link
Author

hidmic commented Jan 27, 2026

Sure thing. Who should we loop into this? Edit: pulling @ahcorde in.

Copy link

@MiguelCompany MiguelCompany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A very sound proposal.
Leaving two minor comments


- It is binary compatible. XCDRv1 serializes full sized data sequentially, and while big endian by default, it can be configured to operate in little endian like the vast majority of modern compute platforms.
- It is sufficiently descriptive. XCDRv1 serializes enough information (i.e. alignments, sizes) to recover the message if its structure is known.
- It ensures over-the-wire compatibility. At the time of writing of this REP, most RMW implementations, including all Tier 1 RMW implementations, use XCDRv1 as serialization format. Messages exchanged by processes using the proposed re-design and the original design will be mutually intelligible. TBD: should we be using XCDRv2? Append-only message extension would be easier to support.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding XCDRv2, it would have the following caveats:

  1. The maximum field alignment is 4 bytes, which might make access to 64-bit data types slower in some architectures.
  2. There is a possibility os breaking backwards wire-compatibility

Copy link
Author

@hidmic hidmic Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I saw the change in alignment. I get OMG was trying to reduce padding but I'm not that sure it was a smart move.


For the reference implementation, [XCDRv1](https://www.omg.org/spec/DDS-XTypes/1.3/PDF) is chosen as the serialization format (and thus as the in-memory representation for message views) for a number of reasons:

- It is binary compatible. XCDRv1 serializes full sized data sequentially, and while big endian by default, it can be configured to operate in little endian like the vast majority of modern compute platforms.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Care should be taken when receiving a payload in an endianness that differs from the one in which the application is running

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this should be trivial. Endianness is specified in the payload. That said, I think we can switch to little endian everywhere with no consequences other than performance degradation for cross-distribution communication (which is not guaranteed to work anyways IIRC) if we have to deserialize. I honestly tried to find a rationale for big endian protocols and I couldn't find any other than that's how it has always been for network protocols.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I honestly tried to find a rationale for big endian protocols and I couldn't find any other than that's how it has always been for network protocols.

My understanding is that "it's always been done that way", but it seems like the tides are shifting towards little endian for the same reason that we are considering it here: protobuf, flatbuffers, capnproto, parquet, arrow, can't all be wrong, right?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that "it's always been done that way", but it seems like the tides are shifting towards little endian for the same reason that we are considering it here: protobuf, flatbuffers, capnproto, parquet, arrow, can't all be wrong, right?

The TCP/IP protocol uses big-endian as "network byte order". My guess is that it was standardized by people using IBM machines back in the day, and ended up being the default endianness for other applications built on top of TCP/IP as well.

@@ -0,0 +1,349 @@
---
layout: post
REP: 0157:2026
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename the file to match: rep-0157:2026.md.


`rosidl` is one the oldest subsystems of ROS 2. [Initial research](https://design.ros2.org/articles/serialization.html) dates back to 2013. C and C++ message generators were first released with Alpha 1, each with their own runtime representations. Language-specific, member-based interfaces were simple enough to implement and verifiably performant. The first few DDS based middlewares had their own vendor-specific IDL to comply with, for interoperability and full feature support, and their own wire formats, thus some data processing (ie. copy, conversion, serialization) cost had to be paid one way or another and it was deemed affordable.

`rosidl` design hasn't changed substantially since then. Unfortunately, even if well suited for ROS 2 systems distributed over many hosts in a network, its simplicity sacrifices performance for the fairly common single host topology.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`rosidl` design hasn't changed substantially since then. Unfortunately, even if well suited for ROS 2 systems distributed over many hosts in a network, its simplicity sacrifices performance for the fairly common single host topology.
`rosidl` design hasn't changed substantially since then. Unfortunately, even if well suited for ROS systems distributed over many hosts in a network, its simplicity sacrifices performance for the fairly common single host topology.

Please change all instances of "ROS 2" to "ROS".


# Motivation

`rosidl` is one the oldest subsystems of ROS 2. [Initial research](https://design.ros2.org/articles/serialization.html) dates back to 2013. C and C++ message generators were first released with Alpha 1, each with their own runtime representations. Language-specific, member-based interfaces were simple enough to implement and verifiably performant. The first few DDS based middlewares had their own vendor-specific IDL to comply with, for interoperability and full feature support, and their own wire formats, thus some data processing (ie. copy, conversion, serialization) cost had to be paid one way or another and it was deemed affordable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave this single instance of "ROS 2" as-is, as it is denoting historical information.


# Motivation

`rosidl` is one the oldest subsystems of ROS 2. [Initial research](https://design.ros2.org/articles/serialization.html) dates back to 2013. C and C++ message generators were first released with Alpha 1, each with their own runtime representations. Language-specific, member-based interfaces were simple enough to implement and verifiably performant. The first few DDS based middlewares had their own vendor-specific IDL to comply with, for interoperability and full feature support, and their own wire formats, thus some data processing (ie. copy, conversion, serialization) cost had to be paid one way or another and it was deemed affordable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REP: 0157:2026
title: Minimal Overhead Messaging Support
author: Michel Hidalgo
PMC Sponsor: TBD
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to find a sponsor before this proposal can become a Draft REP.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gbiggs @hidmic I'd be glad to sponsor this


# Abstract

This REP proposes a re-design of the `rosidl` messaging system to broaden the scope of application of zero-copy transports, including those that deal with seggregated memory models.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a little more information about what the REP is specifying.

---
layout: post
REP: 0157:2026
title: Minimal Overhead Messaging Support
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the title more specific, e.g. "Minimal Overhead Messaging Support Using..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants