-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to support standard messages with zero-copy transports #2201
Comments
I don't think we should do this, or, at least, we should not do this by default. I definitely understand the desire to want these things to be bounded for the zero-copy case. But silently making them bounded in the background is going to lead to a lot of confused users later on. There are a number of ways I could see us going here:
There may be other ways to go. But I think we should have a conversation about this, either in the ROS 2 weekly meeting or in the client libraries working group, as may potentially have wide-ranging implications. |
This is the type of approach that we are investigating.
This seems problematic to me.
Definitely! |
We have been working on a PoC for this. See ros2/rosidl#758 and ros2/rosidl_typesupport_fastrtps#106 for the relevant changes. I'm attaching a ZIP file prepared by my colleague @EduPonz with a The ZIP also contains two .repos files for VCS, one with the three repos that are needed for the feature, and another one for re-building the common interfaces and the demos so you can see the feature in action. Please do let us know what you think! |
@allenh1 I've seen this blog post of yours, and I think it aligns with the work being done here. Are you planning on open-sourcing the work described in that post? |
@MiguelCompany At the moment, there is no plan to open source the work described in that post. Our implementation relies on a number of assumptions we can make about the memory layout of the typesupport representation for the C++ messages. Specifically, it relies on them being the same. So any middleware without a way to ensure the typesupport representation is the same memory layout as the C++ generated messages will encounter issues. The other important detail is the I think a great first step would be to modify the One thing to keep in mind here is that the C++ messages, as well as the generated typesupport representation of the message, both depend on the same vector implementation. This implementation is then a dependency of the middlewares, as well as the message packages, so |
@clalancette Could you take a look at the PoC mentioned in #2201 (comment)? Would be nice to check whether the approach seems correct before going further with the implementation |
Hi @clalancette ! May I know how to change rosidl mode for zero-copy use cases? Thank you! |
I think what @clalancette said in #2201 (comment) is only proposal which is not implemanted yet. |
Hi guys, I would like to try it with |
Most of the available RMW implementations now support some sort of zero-copy transport for multiple processes in the same machine.
However, to use this feature, there's an important limitation: the size of the messages must be known at compile time, so they can't contain variable-length sequences.
This effectively makes it impossible to use the vast majority of ROS 2 standard messages: indeed, the presence of a header (with its string
frame_id
field) doesn't respect the requirement.We are working with eProsima to find a solution to this problem.
Our plan is to modify the rosidl code and allow to automatically bound the unbounded elements.
For example: assume that all strings are capped at X characters.
This approach wouldn't affect the application code, that would still work with strings.
It would work under the hood when a message with a string would need to be published via shared memory.
We are discussing different implementations, with an upper bound that can be defined either at runtime or at build time and with different possible fallback mechanisms (i.e. what to do if the string exceeds the upper bound?).
We would like to gather feedbacks from the community about this, which in our opinion is a required feature in order to enable multi-process ROS 2 applications.
The text was updated successfully, but these errors were encountered: