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

How do I temporarily swap out a core package with a locally compiled one?

asked 2021-04-08 05:02:35 -0500

Rufus gravatar image

updated 2021-04-08 07:57:24 -0500

Suppose I found and want to fix a bug in ros_comm. I've forked and cloned a local copy of ros_comm and implemented my fix. How do I go about testing my fix? More specifically, how can I temporarily swap out the current ros_comm installed in my system with my work in progress ros_comm without recompiling the whole ROS stack?

Naively putting ros_comm in the same workspace as my package for testing my fix (test_node) and building (and sourcing) them together doesn't work as it still uses the system installed ros_comm.

edit retag flag offensive close merge delete

Comments

Naively putting ros_comm in the same workspace as my package for testing my fix and building (and sourcing) them together doesn't work as it still uses the system installed ros_comm.

that is actually supposed to work, so perhaps you should add some more info on what you did exactly.

gvdhoorn gravatar image gvdhoorn  ( 2021-04-08 05:40:50 -0500 )edit

hmm that's strange, my test node in the same workspace is still linking to the system ros_comm package, not the custom ros_comm package in the local workspace... It seems to be related to this question

Rufus gravatar image Rufus  ( 2021-04-08 07:48:45 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2021-04-08 08:10:36 -0500

gvdhoorn gravatar image

updated 2021-04-08 09:35:41 -0500

So afaik, the way to do this would be to place your ros_comm fork in an underlay.

I'd missed you put everything together in the same workspace.

Your description ("first source, then rebuild") is sort-of the same, but less reproducible and less scalable.

See the docs on Catkin overlay (and realise what is an overlay from one perspective is an underlay from another).

edit flag offensive delete link more
1

answered 2021-04-08 07:59:22 -0500

Rufus gravatar image

It turns out, in order to get my custom ros_comm linked to test_node, I need to first build ros_comm, then source the workspace, then rebuild test_node.

Doing a full rebuild of everything at the same time (with catkin clean and catkin build) causes test_node to be linked to the system ros_comm instead of the local one.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2021-04-08 05:02:35 -0500

Seen: 74 times

Last updated: Apr 08 '21