Ask Your Question
0

Renaming a package

asked Feb 22

jlo gravatar image jlo
165 4 19

updated Feb 23

Hi there, I created a package named 'A'. After a while, I wanted to create package 'B' that would be exactly the same as A, just changing some parts of the source code. Is there a way I can:

  1. Rename the package A (so that roscd will recognize the new name for A)
  2. Copy-paste A's folder, rename it and make roscd recognize it (as let's say, package 'B')

Otherwise, the only solution I can think of is roscreating the packages again. I'm sure there's a wiser alternative.

Thanks! :)

Update: felix_k's answer works, but you have to execute 'rospack profile', so that ROS can register you have changed the names. Great! Thanks everybody.

delete close flag offensive retag edit

Comments

2

For most simple packages you only have to rename the folder, adjust the name in the manifest and python's load_manifest('...') lines. And any docs/src where it's hard coded, but that could be automatically textually replaced.

felix k (Feb 22)edit

It doesn't work. I have changed the folder's name and the name in the manifest.xml, but when I operate a terminal and write "roscd ROS<tab>" instead of "ROSnew" (the new name") it still uses the old one "ROSold". Any other ideas :/? I'm sure something has to be updated for the system to get it.

jlo (Feb 23)edit
2

On my system (using zsh), I have to run "rospack profile" for roscd tab completion to work after moving a new package into the ROS path. If you type in "roscd ROSnew" (without tab completion), it should work anyway.

Martin Günther (Feb 24)edit

1 Answer

Sort by » oldest newest most voted
2

answered Feb 22

kwc gravatar image kwc
7078 23 67 117
http://kwc.org/

felix_k's comment is the correct answer. Be care to not copy any build artifacts, and make sure to change any package/namespace declarations in your code to match.

link delete flag offensive edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

Question tools

Follow

subscribe to rss feed

Stats

Asked: Feb 22

Seen: 86 times

Last updated: Feb 23