文章目录
- 前言
- 一、Could not find package ...
- 二、使用error: no match for ‘operator=’...
- 总结
前言
最近想要做有轨迹引导的多机器人编队,打算采用分布式的编队架构,实时的给每个机器人规划出目标位置,然后通过Fast_Planner生成避障路径,再通过改进的mpc进行跟踪。先记录下配置Fast_Planner时遇到的问题。
一、Could not find package …
如果出现这样的报错:
(1)通过:sudo apt-get install ros-melodic-提示缺少的包的名字
进行安装。
(2)如果上面的方法不管用,需要根据提示解决:
例如:CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by “NLopt”
with any of the following names:
NLoptConfig.cmake
nlopt-config.cmake
通过与github Fast_Planner原功能包进行对比,发现在(fast_planner/baspline_opt/CMakeList.txt)目录下
我的:/CMakeList.txt
cmake_minimum_required(VERSION 2.8.3)
project(bspline_opt)
find_package(NLopt REQUIRED)
set(NLopt_INCLUDE_DIRS ${NLOPT_INCLUDE_DIR})
find_package(Eigen3 REQUIRED)
find_package(PCL 1.7 REQUIRED)
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
visualization_msgs
cv_bridge
plan_env
)
catkin_package(
INCLUDE_DIRS include
LIBRARIES bspline_opt
CATKIN_DEPENDS plan_env
# DEPENDS system_lib
)
include_directories(
SYSTEM
include
${catkin_INCLUDE_DIRS}
${Eigen3_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${NLOPT_INCLUDE_DIR}
)
set(CMAKE_CXX_FLAGS "-std=c++14 ${CMAKE_CXX_FLAGS} -O3 -Wall")
add_library( bspline_opt
src/bspline_optimizer.cpp
)
target_link_libraries( bspline_opt
${catkin_LIBRARIES}
${NLOPT_LIBRARIES}
)
github Fast_Planner /CMakeList.txt
cmake_minimum_required(VERSION 2.8.3)
project(bspline_opt)
find_package(Eigen3 REQUIRED)
find_package(PCL 1.7 REQUIRED)
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
visualization_msgs
cv_bridge
nlopt
plan_env
)
catkin_package(
INCLUDE_DIRS include
LIBRARIES bspline_opt
CATKIN_DEPENDS plan_env
# DEPENDS system_lib
)
include_directories(
SYSTEM
include
${catkin_INCLUDE_DIRS}
${Eigen3_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
)
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS} -O3 -Wall")
add_library( bspline_opt
src/bspline_optimizer.cpp
)
target_link_libraries( bspline_opt
${catkin_LIBRARIES}
)
即去掉find_package(NLopt REQUIRED)
在后面find_package中加上nlopt。其他的根据提示缺什么包装什么即可,如果遇到有的包找不到就去原仓库中找一找。
二、使用error: no match for ‘operator=’…
如果出现这样的报错:
error: no match for ‘operator=’ (operand types are ‘Eigen::internal::enable_if<true, Eigen::IndexedView<Eigen::Matrix<double, -1, -1>, double, double> >::type {aka Eigen::IndexedView<Eigen::Matrix<double, -1, -1>, double, double>}’ and ‘double’)
i * (i - 1) * (i - 2) * j * (j - 1) * (j - 2) * pow(ts, i + j - 5) / (i + j - 5);
根据提示找到:fast_planner/poly_traj/include/poly_traj/polynomial_traj.h
根据提示的行数将for循环的圆括号里的double改为int,注意是两个!
总结
(未完待续)…