# ROS 1 API adapters to facilitate migration

**URL:** <https://discourse.openrobotics.org/t/ros-1-api-adapters-to-facilitate-migration/13118>\
**Category:** ROS General\
**Created:** [March 5, 2020, 6:47pm UTC](https://discourse.openrobotics.org/t/ros-1-api-adapters-to-facilitate-migration/13118 "2020-03-05T18:47:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Purvis](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/mike_purvis/32/264_2.png) [@Mike\_Purvis](https://discourse.openrobotics.org/u/Mike_Purvis)\
**Post date:** [March 5, 2020, 6:47pm UTC](https://discourse.openrobotics.org/t/ros-1-api-adapters-to-facilitate-migration/13118/1 "2020-03-05T18:47:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Thomas\_Moulard](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/thomas_moulard/32/3770_2.png) [@Thomas\_Moulard](https://discourse.openrobotics.org/u/Thomas_Moulard)\
**Post date:** [March 5, 2020, 8:20pm UTC](https://discourse.openrobotics.org/t/ros-1-api-adapters-to-facilitate-migration/13118/2 "2020-03-05T20:20:36Z")

</div>

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 [GitHub - awslabs/ros2-migration-tools: Tools for migrating packages from ROS1 to ROS2.](https://github.com/awslabs/ros2-migration-tools)

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.

---

<div class="post-metadata">

**Author:** ![Mike\_Purvis](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/mike_purvis/32/264_2.png) [@Mike\_Purvis](https://discourse.openrobotics.org/u/Mike_Purvis)\
**Post date:** [March 5, 2020, 9:25pm UTC](https://discourse.openrobotics.org/t/ros-1-api-adapters-to-facilitate-migration/13118/3 "2020-03-05T21:25:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gbiggs](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/gbiggs/32/30361_2.png) [@gbiggs](https://discourse.openrobotics.org/u/gbiggs)\
**Post date:** [March 6, 2020, 2:21am UTC](https://discourse.openrobotics.org/t/ros-1-api-adapters-to-facilitate-migration/13118/4 "2020-03-06T02:21:26Z")

</div>

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

> **[ROS1 shim library development proposal](https://discourse.ros.org/t/ros1-shim-library-development-proposal/5873/7)**
>
> Good questions. Short term, I have two issues I’d like to solve: 1) The ROS1 middleware has no security, and is therefore problematic in products. Many other issues I can address on a per-node basis, but security is reallu pervasive. 2) the ROS2...

---

<div class="post-metadata">

**Author:** ![Katherine\_Scott](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/katherine_scott/32/4434_2.png) [@Katherine\_Scott](https://discourse.openrobotics.org/u/Katherine_Scott)\
**Post date:** [March 6, 2020, 9:10pm UTC](https://discourse.openrobotics.org/t/ros-1-api-adapters-to-facilitate-migration/13118/5 "2020-03-06T21:10:40Z")

</div>

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.
