找不到“qpOASES”的软件包配置文件。

huangapple go评论90阅读模式
英文:

Could not find a package configuration file for "qpOASES"

问题

问题是qpOASES依赖项在ros_wrap_safe_motion之前未编译,因此找不到它。您可以如何解决这个问题?

解决此问题的一种方法是确保qpOASESros_wrap_safe_motion之前进行编译。您可以通过以下步骤来实现:

  1. 在catkin工作区的顶层CMakeLists.txt文件中,确保qpOASESros_wrap_safe_motion之前进行编译。您可以使用add_dependencies指令来指定依赖关系。例如:
add_dependencies(ros_wrap_safe_motion qpOASES)
  1. 确保在ros_wrap_safe_motion的CMakeLists.txt文件中,您正确地查找了qpOASES包。检查是否设置了qpOASES_DIRCMAKE_PREFIX_PATH,以便CMake能够找到qpOASES的配置文件。

这些步骤应该有助于确保qpOASES在编译ros_wrap_safe_motion之前进行编译,并解决依赖关系的问题。

英文:

I'm getting an error when compiling my code in dependency with qpOASES using catkin:

$ catkin build:

The Package qpOASES is already cloned inside the same catkin workspace

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

    qpOASESConfig.cmake
    qpoases-config.cmake

  Add the installation prefix of "qpOASES" to CMAKE_PREFIX_PATH or set
  "qpOASES_DIR" to a directory containing one of the above files.  If
  "qpOASES" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  CMakeLists.txt:25 (find_package)

CMakeLists.txt

cmake_minimum_required(VERSION 3.1)

#################
# CMake project
#################
project(ros_wrap_safe_motion)

## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++14)

set(CMAKE_BUILD_TYPE Release)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
SET(CMAKE_CXX_FLAGS "-std=c++14")
########################################################################################################################

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages

find_package(OpenCV REQUIRED)
find_package(PCL REQUIRED)

find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  sensor_msgs
  kdl_parser
  gazebo_ros
  cv_bridge
  trac_ik_lib
  image_transport
  qpOASES
  rviz_visual_tools
  eigen_conversions
  pcl_conversions
  pcl_ros
  )

find_package(gazebo REQUIRED)

# find_package(OpenCV REQUIRED)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ")
find_package(OpenCV 3.0 QUIET)

# find_package(PCL 1.11 REQUIRED)
# set(${PCL_INCLUDE_DIRS} /usr/local/include/pcl-1.11)

include_directories(
  include
  ${catkin_INCLUDE_DIRS}
  ${OpenCV_INCLUDE_DIRS}
  ${PCL_INCLUDE_DIRS}
)

link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
#Searching CUDA
find_package(CUDA)

#Include the FindCUDA script
include(FindCUDA)

if(NOT OpenCV_FOUND)
    find_package(OpenCV 2.4.3 QUIET)
    if(NOT OpenCV_FOUND)
        message(FATAL_ERROR "OpenCV > 2.4.3 not found.")
    endif()
endif()

include_directories(${INC_DIR} ${EIGEN3_INCLUDE_DIR} ${OpenCV_INCLUDE_DIRS})
link_directories(${LINK_DIR} ${OpenCV_LIBS})

catkin_package(
    INCLUDE_DIRS 
     include
    LIBRARIES 
      ros_wrap_safe_motion_library
    )

set_property(GLOBAL PROPERTY USE_FOLDERS ON)
include_directories("${PROJECT_BINARY_DIR}")
include_directories(
    include
    ${catkin_INCLUDE_DIRS}
    ${SDFormat_INCLUDE_DIRS}
    ${Boost_INCLUDE_DIRS}
    ${qpAOSES_INCLUDE_DIRS}
    ${rviz_visual_tools_INCLUDE_DIRS}
#    ${lpsolve_catkin_INCLUDE_DIRS}

    )
include_directories(${GAZEBO_INCLUDE_DIRS})
link_directories( ${GAZEBO_LIBRARY_DIRS} ${qpOASES_LIBRARY_DIRS} ${rviz_visual_tools_LIBRARY_DIRS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GAZEBO_CXX_FLAGS}")

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
# include
  ${catkin_INCLUDE_DIRS}
)

The problem is that the qpOASES dependency is not compiled before the ros_wrap_safe_motion, hence it can't find it.

How can I solve that?

答案1

得分: 0

将依赖项添加到package.xml文件中已经解决了我的问题。

英文:

Adding the dependency to the package.xml file:

<build_depend>qpOASES</build_depend>

Has solved the problem in my case

huangapple
  • 本文由 发表于 2023年6月8日 22:20:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76432829.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定