ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org
Ask Your Question
0

Finding your colcon built workspace's lib path using ros2

asked 2019-01-23 23:36:07 -0500

Obeseturtle gravatar image

Hi,

I was wondering if there was an equivalent to `catkin_find --lib --include in ros2.

I need this information to create a non ros package that includes ros publishers and subscribers.

Currently, I am using a workaround which is to use ros2 pkg prefix foo to find the messages created by the workspace and then move my way up the folders using ../.

I was wondering if there was a better way of doing this.

Also, if it is not to much trouble, cmake_ament no longer uses pkg-config to find packages. How can I add my workspace's libraries to the CMakelist? This is for the case of custom msgs and services.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-01-24 12:48:59 -0500

Dirk Thomas gravatar image

I am using a workaround which is to use ros2 pkg prefix foo to find the messages created by the workspace and then move my way up the folders using ../.

Why do you have to move up in this case?

The command will return the install prefix of the package foo. All files installed by that package will be in subdirectories, e.g. bin, include, lib, share.

If you need pkg-config like results you can invoke cmake --find-package ... to get information about include directories, libraries etc. (see Find-Package Tool Mode).

edit flag offensive delete link more

Comments

Thank you very much for your response.

Why do you have to move up in this case?

This was just a mistake on my part.

As you mentioned the include, lib. and shared could be found by using the prefix command. I will try using the suggested cmake --find-package command. Thank you again

Obeseturtle gravatar imageObeseturtle ( 2019-01-24 18:29:41 -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

2 followers

Stats

Asked: 2019-01-23 23:36:07 -0500

Seen: 41 times

Last updated: Jan 24