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

How to rebuild roscpp & rospy library?

asked 2019-09-11 01:33:52 -0500

kite9240 gravatar image

I want to modify the roscpp and rospy source file for several tests.

For example, logging thread ID of the poll manager thread, which is child of the node, by modifying poll_manager.cpp( source of roscpp library ).

I use ros melodic and I want to know how can I rebuild the ros system libraries(roscpp and rospy). How can I do this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-09-11 02:56:33 -0500

gvdhoorn gravatar image

updated 2019-09-11 03:03:21 -0500

The typical approach would be to place a clone of ros_comm in a Catkin workspace and build it.

That's it. Whenever the workspace is active (ie: you've sourced the setup.bash in the devel folder (or install, if you've configured Catkin to create an install space), your local copy of all packages in ros_comm will be used.

You could also opt to just place rospy and roscpp in a workspace. That would avoid building all the other packages as well.

However, there is a potential problem here: roscpp consists of (a number of) C++ libraries. When installing packages provided by the ROS buildfarm, all packages depending on roscpp will be ABI compatible with it.

If you build your local version of roscpp and start changing parts of it, you may (inadvertently) break that ABI compatibility. This could lead to issues when trying to run binaries from dependents of roscpp as they will not be "up to date" with the changes in your local roscpp copy.

If you want to make sure this cannot happen, the best course of action would be to build all packages that you want to use with your custom version of roscpp from source as well. You could place them in the same workspace, and they will automatically use the roscpp in that workspace.

Alternatives could be to either be very careful about what you change, or run an ABI compatibility checker (such as abi-compliance-checker or a similar tool) to verify you haven't broken something.

edit flag offensive delete link more

Question Tools


Asked: 2019-09-11 01:33:52 -0500

Seen: 464 times

Last updated: Sep 11 '19