ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A

ROS 1 API adapters to facilitate migration

Has anyone made much progress on an API adapter solution for ROS 1->2? I know the officially-blessed solution for migration is the ros1_bridge package, but this still requires that entire processes be moved over at once, which is a barrier for us. I recall there being discussions early on about some kind of compile-time adapter; I’m curious if anyone ever did a deeper exploration of this potential direction.

In particular, I’m wondering about a solution where roscpp is hollowed out so that the existing user-facing API implementation remains, but replacements implementations are introduced for TopicManager and ServiceManager which do the message translation and then publish via rclcpp.

The goal of the bridge is precisely not to have to move everything at once, but step by step, but maybe I am misreading your comment?

Here is how I am seeing a reasonable transition plan:

  • current state: (everything ROS 1)
  • step 1, add the bridge: (everything ROS 1) + bridge
  • step 2, port 1 node: (everything ROS 1 except the node ported to ROS 2) + bridge + (one ROS 2 node)
  • repeat until everything is ported: bridge + (everything in ROS2)
  • final step: stop running the bridge

Then, for the actual port, you can try using

This is using the clang Python API to try to apply source code transformations to migrate ROS 1 code to ROS 2 automatically. It can’t handle all cases, but it could help automating some of the process.

Ah, thanks for the point to ros2-migration-tools; that looks like it could be quite helpful.

Certainly ros1_bridge has its place; for a variety of reasons it’s not suitable as a migration path for our system, and the purpose of this thread is to understand if others have come to a similar conclusion about their systems and to what depth alternative approaches have been explored.

It looks like the last time this was discussed was a year and a half ago.

I heard rumors at the ROS-I America meeting about a second automated conversion tool from ROS 1 to ROS 2. It isn’t any magic, just a set of scripts/regex to automate a lot of the conversion grunt work. I am not sure if it is the same set of tooling or a second effort. I am going to follow up on it. I am curious if we could get a community initiative to build some tooling to help make the conversion effort a lot easier.

If you are in the process of doing a ROS 1 to ROS 2 conversion I would love to hear about your experiences and what you learned. I think in conjunction with the Foxy release I want to try and put together a best practices guide for those migrating deployed systems from ROS 1 to ROS 2.