问题
FUEL github链接:
https://github.com/HKUST-Aerial-Robotics/FUEL#creating-a-pcd-environment
按照说明安装nlopt且修改bspline_opt的CMakeLists.txt:
cmake_minimum_required(VERSION 2.8.3)
project(bspline_opt)
set(CMAKE_BUILD_TYPE "Release")
# set(CMAKE_CXX_FLAGS "-std=c++11")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall")
find_package(Eigen3 REQUIRED)
find_package(PCL 1.7 REQUIRED)
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
visualization_msgs
plan_env
active_perception
cv_bridge
# nlopt
)
find_package(NLopt REQUIRED)
set(NLopt_INCLUDE_DIRS ${NLOPT_INCLUDE_DIR})
catkin_package(
INCLUDE_DIRS include
LIBRARIES bspline_opt
CATKIN_DEPENDS plan_env active_perception
# DEPENDS system_lib
)
include_directories(
SYSTEM
include
${catkin_INCLUDE_DIRS}
${Eigen3_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${NLOPT_INCLUDE_DIR}
)
add_library( bspline_opt
src/bspline_optimizer.cpp
)
target_link_libraries( bspline_opt
${catkin_LIBRARIES}
${NLOPT_LIBRARIES}
# /usr/local/lib/libnlopt.so
)
运行launch文后在rviz中点击2D Nav Goal出现错误如图:
解决
在github讨论区寻找,寻找解决方法:
https://github.com/yzhangec/Exploration-with-Global-Consistency/issues/1
https://github.com/HKUST-Aerial-Robotics/FUEL/issues/44#issue-1362103418
1.依然选择编译安装nlopt并修改bspline_opt的CMakeLists.txt
cmake_minimum_required(VERSION 2.8.3)
project(bspline_opt)
set(CMAKE_BUILD_TYPE "Release")
# set(CMAKE_CXX_FLAGS "-std=c++11")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall")
find_package(Eigen3 REQUIRED)
find_package(PCL 1.7 REQUIRED)
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
visualization_msgs
plan_env
active_perception
cv_bridge
# nlopt
)
list(APPEND CMAKE_FIND_ROOT_PATH $(CMAKE_SOURCE_DIR))
set(CMAKE_PREFIX_PATH "/usr/local/lib/cmake/nlopt")
find_package(nlopt)
catkin_package(
INCLUDE_DIRS include
LIBRARIES bspline_opt
CATKIN_DEPENDS plan_env active_perception
# DEPENDS system_lib
)
include_directories(
SYSTEM
include
${catkin_INCLUDE_DIRS}
${Eigen3_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${NLOPT_INCLUDE_DIR}
)
add_library( bspline_opt
src/bspline_optimizer.cpp
)
target_link_libraries( bspline_opt
${catkin_LIBRARIES}
${NLOPT_LIBRARIES}
/usr/local/lib/libnlopt.so
)
2.修改fuel_planner/path_searching/src/kinodynamic_astar.cpp的653行:
// int idx = floor((time - time_origin_) * inv_time_resolution_);
return floor((time - time_origin_) * inv_time_resolution_);
两个都修改后无人机虽然不显示小飞机模型但可以正常探索: