Ask Your Question
2

catkin rename package script - Implementation, Usefulness, Others?

asked 2014-04-01 01:09:03 -0500

eacousineau gravatar image

I've implemented a quick script to rename catkin packages (details in the README).

Does this script seem useful enough to incorporate into any core packages? Does anyone have any other existing solutions out there?

edit retag flag offensive close merge delete

Comments

The big problem with renaming a package is fixing all the references in other packages that depend on it. That is why it is best to think carefully about the name when starting out.

joq gravatar imagejoq ( 2014-04-01 04:09:20 -0500 )edit
1

In general you might want to use ${PROJECT_NAME} as much as possible in your CMake code. Then you have only two line where the package name is mentioned: in the package.xml as well as the project() in CMake.

Dirk Thomas gravatar imageDirk Thomas ( 2014-04-01 05:49:01 -0500 )edit

@joq - Yeah, this definitely should not be used to change a package name at a whim, but it helps for an inexperienced / rushed developer (e.g. a grad student :P) who prototyped a package for internal use and wants to then distribute it with a less ambiguous name at a later date. In addition, the script is built to fix the name references in other packages - depends tags, catkin dependencies, header files, include directories, etc.

eacousineau gravatar imageeacousineau ( 2014-04-01 12:32:30 -0500 )edit

@Dirk Thomas - Will do, thanks! I looked at [templates/CMakeLists.txt.in](https://github.com/ros-infrastructure/catkin_pkg/blob/master/src/catkin_pkg/templates/CMakeLists.txt.in), and it seems like `@{name}` is used in place of `${PROJECT_NAME}`. Would it be worthwhile to change that?

eacousineau gravatar imageeacousineau ( 2014-04-02 09:00:35 -0500 )edit

The referenced template already uses ${PROJECT_NAME} all over the place. So I don't think anything needs to be changed there.

Dirk Thomas gravatar imageDirk Thomas ( 2014-04-02 09:50:17 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2014-04-01 01:27:14 -0500

makokal gravatar image

Looks quite neat, maybe you want to send a message to ros-users mailing list with this.

edit flag offensive delete link more

Comments

Cool, will do. Thanks for the suggestion!

eacousineau gravatar imageeacousineau ( 2014-04-01 02:39:52 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2014-04-01 01:09:03 -0500

Seen: 1,549 times

Last updated: Apr 01 '14