ROS2: anything equivalent to topic_tools:ShapeShifter?

No, unfortunately we don’t have that yet. @karsten was working on it for this release, but we ran into some issues figuring out how to most efficiently get data in and out of the underlying DDS vendors without (de)serializing. The API we’ll provide will be relatively simple, something like rmw_publish_raw and rmw_take_raw and some wrapper like ShapeShifter in our C++ API, but it’s the “how” that’s held us up.

But we’re still looking at this issue and it’s in our critical path as we need it to implement rosbag and to implement “type masquerading”.

I’ll try to remember to reply here when we get the first version of that new API figured out.


The other thing I suppose you’ll need is a way to parse the “ROS IDL” files, e.g. .msg? We don’t currently have that in anything but Python. I see that you have one for ROS 1 in C++:

As part of your package, which is awesome :smile:, but it would likely need to be updated to support the new syntax we support in ROS 2 (see http://design.ros2.org/articles/interface_definition.html, specifically the part about bounded strings and arrays).

Also, it would be awesome to have a separate library for parsing the various interface files in C/C++, so it could be reused everywhere.

There’s also the possibility to have another, more machine friendly, version of the interfaces. For example, as part of generation at build time we could generate an xml or json file which represents the contents of the corresponding .msg file. Then you could lookup and load that file instead (with an xml or json library), which would save you from needing to writing parsing code, and instead you would only need to interpret the contents correctly.


This is a feature I’d really like to see well supported in both ROS 1 and ROS 2, it would be especially helpful in making the bridge between the two more convenient to use with non-standard types. So, once we get you unblocked by providing something like ShapeShifter, I’d be really interested in helping you with anything you’re missing to implement it.