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

rosbuild_find_ros_package() in catkin build

asked 2015-03-09 08:57:26 -0500

Huy Cong gravatar image

Hello everyone,

I recently try to port some of our old fuerte packages (which worked with rosbuild) to indigo (with catkin sysbuild). I already set up catkin build environment, now I must update the old macros of CMakeLists.txt to make it work with catkin following this guide: http://wiki.ros.org/catkin/migrating_...

But there are some functions that are deprecated and do not have its equivalent, like this one: rosbuild_find_ros_package({package_name}) DO NOT DO THIS

in rosbuild, this helps export the {package_name}_PACKAGE_PATH to make the search for files in package easier, but in catkin it dont exists.

There is something in catkin that I find similar, which is : find_package() But it results only in finding the packages that are already install (which can be found in install or install_isolated directory), if my package aren't build, it can't be found.

So are there any options to search, and export the path of unbuild packages (i.e package in src directory) under catkin sysbuild?

Thanks for any help,

Best regards

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-03-09 09:52:18 -0500

Dirk Thomas gravatar image

No, with catkin you always have to build your packages before you can use / find them.

Have you tried building your package before and was there a problem in that case too?

edit flag offensive delete link more

Comments

In fact, I want to browse a .cmake file which found under {package_name}, but I don't want to explicit the path (which is long & not portable), in catkin is there an easy way to search for a file under a source package that we already know the name?

Huy Cong gravatar image Huy Cong  ( 2015-03-09 11:27:33 -0500 )edit

After calling find_package(foo) you can use the variable foo_DIR which will point to the cmake folder of the package. You probably want to install other CMake files into that location.

Dirk Thomas gravatar image Dirk Thomas  ( 2015-03-09 11:54:52 -0500 )edit

But this means that I have to build that package before (since find_package didn't work with src package)? Is there any way to organize the order of build packages, because it seems that I have no control over it...

Huy Cong gravatar image Huy Cong  ( 2015-03-10 03:33:38 -0500 )edit

Yes, you must build a package before being able to use / find it. The order of the build is defined by the package dependencies. So if you want B to build after A because it needs to find A you should also define a dependency on B in As manifest.

Dirk Thomas gravatar image Dirk Thomas  ( 2015-03-10 10:01:14 -0500 )edit

Thank you, I'm reorganizing my packages thanks to packages.xml, now I'm able to move on

Huy Cong gravatar image Huy Cong  ( 2015-03-11 06:29:11 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-03-09 08:57:26 -0500

Seen: 332 times

Last updated: Mar 09 '15