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

How to find path to specific ros package in CMakeLists.txt

asked 2016-01-10 01:27:19 -0600

moyashi gravatar image

Hi there,

Is it possible to get path to specific ros package in CMakeLists.txt ?
If yes, how can I do it ?

There could be multiple directories with the same name like navigation. (navigation metapackage directory is in navigation directory) I'd like to find a path to navigation metapackage directory in this case.

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-01-26 05:58:30 -0600

mgruhler gravatar image

If you are using catkin, what you should as rosbuild will be eventually removed sometime, all ros packages can easily be found using find_package(catkin REQUIRED <PKG>), but you need to add the dependency to the package.xml as well.

There cannot be multiple packages with the same name on your path, or, more precisly, in one of the directories in your ROS_PACKAGE_PATH. in each "level", (i.e. workspace, /opt/ros, ...) you can only have one.

The names of directories have nothing to do with the package names. The exception is the directory name of the package itself, i.e. which contains the package.xml and the CMakeLists.txt. This is the name of your package and is also listed in the package.xml.

By convention, most repositories have the name of the meta-package they contain. But this does not need to be like that! So in your case, only having a dependency to navigation is fine.

HOWEVER you should never depend on a meta-package, but only on regular packages.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-01-10 01:27:19 -0600

Seen: 822 times

Last updated: Jan 26 '16