Ask Your Question
8

Adding a dependency after roscreate-pkg

asked 2011-02-23 07:19:39 -0500

Murph gravatar image

If I use roscreate-pkg to create my package, but then later decide to add another dependency (in this case, rospy), is there a simple way to get things setup correctly? Or do I now have to do those steps by hand?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
8

answered 2011-02-23 07:27:38 -0500

Eric Perko gravatar image

In order to add a new dependency to an existing package, just edit the package's manifest.xml file.

You'll have to add a line like <depend package="package_name" />.

For example, to add a dependency to rospy, you would add the line <depend package="rospy" />.

edit flag offensive delete link more

Comments

According to: http://www.ros.org/wiki/roscreate "For common dependencies like roscpp and rospy, roscreate-pkg may create some additional common directory structures." - Do I need to create these?
Murph gravatar imageMurph ( 2011-02-24 02:06:43 -0500 )edit
Those directory structures are for convenience, e.g. 'src', 'include'. They are not required.
kwc gravatar imagekwc ( 2011-02-24 02:47:01 -0500 )edit

So, e.g. rosdep is useless here?!

nbro gravatar imagenbro ( 2018-04-07 19:02:20 -0500 )edit

There is no need to change the file "CMakeLists.txt"? (adding the new dependency to the find_package()?

morann gravatar imagemorann ( 2018-08-19 04:38:19 -0500 )edit
2

@morann: note the date of the answer: 2011. Things have changed since then, and rosmake worked differently from how Catkin works.

Please refer to the catkin documentation for up-to-date information.

gvdhoorn gravatar imagegvdhoorn ( 2018-08-19 04:58:43 -0500 )edit

@gvdhoorn Your link doesn't directly answer the question, though. Could you write a new answer?

tsbertalan gravatar imagetsbertalan ( 2019-02-25 09:32:55 -0500 )edit

I would say it actually does: see C++ catkin library dependencies fi, and all the other pages.

gvdhoorn gravatar imagegvdhoorn ( 2019-02-25 09:36:35 -0500 )edit

@gvdhoorn "See all the pages in the documentation" is not an answer (and I suppose you didn't try to make it one). Yes, OP could look through the documentation, and your link is helpful for that; thanks. But if the tl;dr is "there's no easy tool, so add to CMakeLists.txt and package.xml", say so!

tsbertalan gravatar imagetsbertalan ( 2019-02-25 22:51:28 -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

1 follower

Stats

Asked: 2011-02-23 07:19:39 -0500

Seen: 6,864 times

Last updated: Feb 23 '11