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

Could not find a package configuration file - Custom ROS Package

asked 2020-12-14 05:47:32 -0600

Radeshwar gravatar image

Hi all,

I am using ros_melodic with two different custom package namely ugv_ik & ugv_lcu for my application, among which ugv_ik package uses one of the message files of ugv_lcu.

While I try building my workspace I am getting the following error.

CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):   
Could not find a package configuration file provided by "ugv_lcu" with any   
of the following names:

    ugv_lcuConfig.cmake
    ugv_lcu-config.cmake

  Add the installation prefix of "ugv_lcu" to CMAKE_PREFIX_PATH or set 
  "ugv_lcu_DIR" to a directory containing one of the above files.  If 
  "ugv_lcu" provides a separate development package or SDK, be sure it has 
   been installed. 

Call Stack (most recent call first):   
CMakeLists.txt:10 (find_package)"

I knew this problem has occured earlier for others too but what I have noticed so far is the same error has occured for standard packages and can be cleared by installing that particular package.

But how to fix this error in case of a customized ros package?

I have inculded the package name ugv_lcu in the CMakeList.txt of ugv_ik like given below:

find_package(catkin REQUIRED COMPONENTS
  ugv_lcu
  roscpp
  std_msgs
)

generate_messages(
   DEPENDENCIES
   std_msgs
   ugv_lcu
 )

catkin_package(
  INCLUDE_DIRS include
  LIBRARIES ugv_ik 
  CATKIN_DEPENDS roscpp std_msgs  ugv_lcu
  DEPENDS system_lib
)

And this is my package.xml

  <buildtool_depend>catkin</buildtool_depend>

  <build_depend>roscpp</build_depend>
  <build_depend>std_msgs</build_depend>
  <build_depend>message_generation</build_depend>

  <build_export_depend>roscpp</build_export_depend>
  <build_export_depend>std_msgs</build_export_depend>

  <depend>geometry_msgs</depend>

  <exec_depend>roscpp</exec_depend>
  <exec_depend>std_msgs</exec_depend>
  <exec_depend>message_runtime</exec_depend>

Kindly let me know, what am I missing and how to fix this issue.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-12-14 08:23:29 -0600

tryan gravatar image

It's possible the dependency (ugv_lcu) isn't built before the dependent package (ugv_ik). Include the dependency in your package.xml as mentioned in the catkin documentation.

edit flag offensive delete link more

Comments

I realized that there is a circular dependency between both the packages, so I had separated ugv_fk from ugv_ik and I got the below error.

Project 'ugv_fk' tried to find library 'ugv_lcu'.  The library is neither a
  target nor built/installed properly.  Did you compile project 'ugv_lcu'?
  Did you find_package() it before the subdirectory containing its code is
  included?
Call Stack (most recent call first):
  /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
  CMakeLists.txt:10 (find_package)

How do I add library for my ugv_lcu Package?

Radeshwar gravatar image Radeshwar  ( 2020-12-15 03:36:53 -0600 )edit

Yeah, it's best to avoid circular dependencies at the build level. See Circular exec_depend not possible #523 on the catkin_tools GitHub for example.

According to this ROS Q&A, the new error suggest you are trying to export a nonexistent library from the ugv_lcu package and should comment the line LIBRARIES ugv_lcu in its catkin_package call.

tryan gravatar image tryan  ( 2020-12-15 11:22:06 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2020-12-14 05:47:32 -0600

Seen: 1,653 times

Last updated: Dec 14 '20