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

Simultaneously Work on Packages of the Same Name

asked 2016-07-07 18:55:48 -0600

sbloch gravatar image

I'm simultaneously working on two projects with the same starting-point code: I've forked public repo A twice locally. I want to publish my modifications to A (let's call this A') to open-source my code. However, I want to make different changes to the same original package and just use those locally (let's call this A").

Obviously, when I call "catkin_make", I get an error for having multiple packages of the same name. Is there a way around this? Should I setup multiple catkin workspaces or is this bad practice? Do I have to systematically go through one of the packages and change every duplicate name to something else?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
4

answered 2016-07-07 21:04:09 -0600

ahendrix gravatar image

Having two different workspaces or renaming one of the variants of your package are the two most obvious solution to your problem. Both are reasonable; which one you choose really depends on why you have two copies of this package, and how you want to use them.

If your private version is making massive changes to the package or changing its functionality, it probably makes sense to rename it.

If you want to run nodes from both versions of the package at the same time, you should rename your private version.

If your private version will never be used at the same time as the open-source version, you can use it in a different catkin workspace without renaming it.

edit flag offensive delete link more
2

answered 2020-03-15 07:34:43 -0600

YugalSharma gravatar image

To rename a ROS package:

1.Simply rename its folder name.

2.Update the name in Package.xml file of the package.

3.Update the name in CMakeLists.txt file of the package.

Its Done, No need to build that package again after renaming.

edit flag offensive delete link more
0

answered 2021-01-10 10:41:59 -0600

htanwar922 gravatar image

updated 2021-01-10 19:20:03 -0600

To add to previous answers: reference

The package tends to use its files itself in launch/urdf/etcetera files, and other packages depending on the package may as well. For editing these dependencies:

find PKG-FOLDER \( -type d -name .git -prune \) -o -type f \
        -exec sed -i 's/old-pkg-name/new-pkg-name/g' {} +

This should replace all occurences of old-pkg-name in all files of PKG-FOLDER with new-pkg-name. Plus, if your files have names containing old-pkg-name, you may need to update these names too to maintain integrity.

find PKG-FOLDER \( \( -type d -name .git -prune \) -o -type f \) \
        -iwholename "*old-pkg-name*" \
        -exec rename s/old-pkg-name/new-pkg-name/ '{}' \;
edit flag offensive delete link more

Question Tools

Stats

Asked: 2016-07-07 18:55:48 -0600

Seen: 2,642 times

Last updated: Jan 10 '21