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

error finding dependent interface package in the same workspace

asked 2022-06-22 03:06:26 -0500

CharlesOnera gravatar image

Hi,

I am using ROS2 Galactic on Ubuntu 20.04.

In my workspace, I have a first package defining a set of messages; I have tried with an official package to be sure this step is working, so let's say it's the "geographic_msgs" package. I then have a second package that defines messages that use the geographic_msgs messages. Let's call this package "my_project_interfaces". This package uses the exact same package.xml and CMakeLists structure and macros as the basic geographic_msgs package. I then have a third package (my_project_nodes) that depends on my_project_interfaces. When colcon building my workspace, I have the following error when configuring my_project_nodes:

Could not find a package configuration file provided by "geographic_msgs" with any of the following names:

geographic_msgsConfig.cmake
geographic_msgs-config.cmake

I have tried several macros for exporting targets in the my_project_interfaces CMakeLists, but could not fix the problem.

Adding geographic_msgs to my_project_nodes as a dependency explicitly is not an option (this code is actually generated from models). Any hint?

Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-06-22 03:58:16 -0500

ljaniec gravatar image

updated 2022-06-22 04:00:39 -0500

Do you have geographic_msgs package installed? sudo apt-get install ros-galactic-geographic-msgs ? Do you use rosdep for dependencies in building from source? You should use rosdep install --from-paths src --ignore-src in your ros2_ws/ folder.


I found this tutorial really helpful during preparing my package with interfaces:

I hope you can find the missing elements in your configuration so that everything works properly. If you find them, please share them there too :)

edit flag offensive delete link more

Comments

geographic_msgs is already in my workspace, so I have the package! The problem is that my_project_nodes (that depends on my_project_interfaces that itself depends on geographic_msgs) does not find geographic_msgs in my workspace!

and that is the issue I want to solve (i.e., correctly exporting the dependencies in the CMakeLists)

CharlesOnera gravatar image CharlesOnera  ( 2022-06-22 04:31:12 -0500 )edit

Could you prepare a minimal (non-)working example of these packages and post it somewhere? It could make debugging easier for us :) Can you build my_project_interfaces separately (colcon build --packages-select ...) without problems? Sometimes you need to have fields like geometry_msgs/PoseStamped in your message definition, not just PoseStamped, maybe that's it?

ljaniec gravatar image ljaniec  ( 2022-06-22 05:06:11 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-06-22 03:06:26 -0500

Seen: 292 times

Last updated: Jun 22 '22