ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.