Ask Your Question
0

transfer compiled code from ros kinetic to ros melodic

asked 2021-01-06 02:01:25 -0500

chandra8992 gravatar image

I have a compiled code for some packages built in ROS kinetic. I don't have the source code anymore. Is it possible to make this compiled code work in ROS Melodic. please help me on this.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-01-06 03:26:32 -0500

gvdhoorn gravatar image

Is it possible to make this compiled code work in ROS Melodic.

No, most likely not.

First: executing binaries compiled against older versions of dependencies is tricky in general, even without ROS.

There are definitely ways to improve binary compatibility, but they depend as much on the OS as on the way you build your own binaries.

So the general answer to this is "it could work, but don't expect it to".

A complicating factor when using ROS (1, perhaps in 2 this has already improved, I haven't checked) is the fact that there is no ABI compatibility guarantee. This means that even within a single ROS distribution, there is no guarantee that binaries built previously will still work after updating (some of your) other ROS packages.

This is the main reason behind the advice to always rebuild your workspace after upgrading ROS packages.

As to your question specifically: you're not only switching ROS versions (ie: from Kinetic to Melodic), but also OS versions (Ubuntu Xenial to Ubuntu Bionic). This implies important things such as the C++ standard library, Boost and many other dependencies are also different between the two versions, leading to even more opportunities for things not working any more.

In the end, my answer would probably be: "it's unlikely to work, but the only way to know for sure would be to try it".

What you could consider instead would be to use container technology (such as Docker), to run the binaries you still have on their originating OS and ROS version. You could use the ros:kinetic image for instance, mount the workspace containing the binaries you mention you have and execute them in that container.

That should avoid binary incompatibilities as much as possible, but (as I wrote earlier), could still run into issues due to the lack of ABI compatibility guarantee.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-01-06 02:01:25 -0500

Seen: 205 times

Last updated: Jan 06 '21