How can I apply patches to packages with Colcon and ROS2?

asked 2021-12-30 07:29:33 -0500

allsey87 gravatar image

I am building ROS2 from source and have to make some small changes to the source code that are really only applicable to my use case. At the moment, I am cloning the packages into my src directory as submodules, but this approach doesn't lend itself to applying patches to the checked out versions of those modules. Is there a clean/semi-automated way of applying patches to ROS2 packages before building with Colcon? I have checked vcstool and several Colcon packages but can't find an obvious solution to this problem.

edit retag flag offensive close merge delete


I'm not aware of anything ROS-specific available for this workflow.

In the end, C++ based packages almost invariably use CMake. Python based packages a (or the more modern equivalents). Any other packages will use whatever is 'native' to the scripting/programming language (if supported by Colcon).

I'd suggest checking what would be natural to CMake-based dev environments and use that. Similar with Python and others.

gvdhoorn gravatar image gvdhoorn  ( 2022-01-04 03:58:47 -0500 )edit