How to rebuild roscpp & rospy library?
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?
Asked by kite9240 on 2019-09-11 01:33:52 UTC
Answers
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 source
d 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.
Asked by gvdhoorn on 2019-09-11 02:56:33 UTC
Comments