Robotics StackExchange | Archived questions

Could not find a package configuration file - Custom ROS Package

Hi all,

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

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.

Asked by Radeshwar on 2020-12-14 06:47:32 UTC

Comments

Answers

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.

Asked by tryan on 2020-12-14 09:23:29 UTC

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?

Asked by Radeshwar on 2020-12-15 04:36:53 UTC

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.

Asked by tryan on 2020-12-15 12:22:06 UTC