Linux 35.5 + JetPack v5.1.3@FUEL编译安装
- 1. 源由
- 2. 编译&安装
- Step 1:依赖库安装
- Step 2:建立工程
- Step 3:编译工程
- Step 4:安装工程
- 3. 问题汇总
- 3.1 fuel_planner/exploration_manager - dw
- 3.2 fuel_planner/plan_env - OpenCV库
- 3.3 fuel_planner/plan_manage - dw库
- 3.4 uav_simulator/local_sensing - CUDA优化
- 4. 创建pcd环境
- 5. 总结
- 6 补充
1. 源由
香港HKUST Aerial Robotics Group开发了一系列基础技术,使空中无人机能够在复杂环境中自主运行。研究涵盖了空中自主导航建模比较完整技术栈,重点在于状态估计、地图绘制、轨迹规划、多机协调以及使用低成本传感和计算组件进行测试平台开发,其代码也被开源在Github - HKUST-Aerial-Robotics。
若能很好的借鉴并应用上述技术,在实际领域进行应用拓展,将会对无人机的应用得到显著提升,进而突破闭源商业系统的垄断地位。
从HKUST维护的Fast-Planner情况看,可能更偏向学术,有很多兼容性问题,也没有足够的人力维护;不过貌似HKUST - FUEL可能是更加新的版本。
- segfault in fast_planner_node on jetson orin Linux 35.5.0 #175
- 对视野范围外的障碍物留有余量的算法求开源,即fastplanner第三篇论文的内容 #162
因此,在《Linux 35.5 + JetPack v5.1.3@Fast-Planner编译安装》基础上,开始FUEL编译安装。
2. 编译&安装
Step 1:依赖库安装
$ sudo apt-get install libarmadillo-dev ros_${ROS_VERSION_NAME}_nlopt
Step 2:建立工程
$ mkdir -p ${YOUR_WORKSPACE_PATH}/src
$ cd ${YOUR_WORKSPACE_PATH}/src
$ git clone https://github.com/HKUST-Aerial-Robotics/FUEL.git
注:若存在网络问题,请使用git协议clone代码。git协议始终比https稳定,但需要注意ssh key的安装问题。
Step 3:编译工程
$ cd ${YOUR_WORKSPACE_PATH}
$ catkin_make
Step 4:安装工程
略,因为暂时不涉及软件的部署应用,相关模拟命令参考:
- 运行Rviz虚拟环境
$ cd ${YOUR_WORKSPACE_PATH}
$ source devel/setup.bash && roslaunch exploration_manager rviz.launch
- 运行模拟程序
$ cd ${YOUR_WORKSPACE_PATH}
$ source devel/setup.bash && roslaunch exploration_manager exploration.launch
3. 问题汇总
$ git log -n 1
commit de2bc5d2e256f2cf5de8e3a60196e55e3854e45b (HEAD -> main, origin/main, origin/HEAD)
Author: Boyu Zhou <405540572@qq.com>
Date: Wed Aug 2 15:43:35 2023 +0800
Update README.md
注1:以上为本次checkout版本,版本差异,可能会导致问题的差异。
注2:FUEL编译是在Fast-Planner基础上进行的,因此有些组件已经默认安装了;如果全新安装,请参考:《Linux 35.5 + JetPack v5.1.3@Fast-Planner编译安装》。
3.1 fuel_planner/exploration_manager - dw
$ git diff fuel_planner/exploration_manager/CMakeLists.txt
diff --git a/fuel_planner/exploration_manager/CMakeLists.txt b/fuel_planner/exploration_manager/CMakeLists.txt
index 189293c..44b7003 100755
--- a/fuel_planner/exploration_manager/CMakeLists.txt
+++ b/fuel_planner/exploration_manager/CMakeLists.txt
@@ -47,7 +47,6 @@ add_executable(exploration_node
)
target_link_libraries(exploration_node
${catkin_LIBRARIES}
- # -ldw
)
# add_library(exploration_manager
@@ -66,4 +65,4 @@ target_link_libraries(write_tsp
add_executable(load_obj test/load_obj.cpp)
target_link_libraries(load_obj
${catkin_LIBRARIES} ${PCL_LIBRARIES}
-)
\ No newline at end of file
+)
3.2 fuel_planner/plan_env - OpenCV库
$ git diff fuel_planner/plan_env/CMakeLists.txt
diff --git a/fuel_planner/plan_env/CMakeLists.txt b/fuel_planner/plan_env/CMakeLists.txt
index 7402df4..198950f 100755
--- a/fuel_planner/plan_env/CMakeLists.txt
+++ b/fuel_planner/plan_env/CMakeLists.txt
@@ -49,6 +49,7 @@ add_library( plan_env
target_link_libraries( plan_env
${catkin_LIBRARIES}
${PCL_LIBRARIES}
+ ${OpenCV_LIBS}
)
add_executable(obj_generator
3.3 fuel_planner/plan_manage - dw库
$ git diff fuel_planner/plan_manage/CMakeLists.txt
diff --git a/fuel_planner/plan_manage/CMakeLists.txt b/fuel_planner/plan_manage/CMakeLists.txt
index 3de89b0..5e2de40 100755
--- a/fuel_planner/plan_manage/CMakeLists.txt
+++ b/fuel_planner/plan_manage/CMakeLists.txt
@@ -49,7 +49,6 @@ add_executable(fast_planner_node
)
target_link_libraries(fast_planner_node
${catkin_LIBRARIES}
- -ldw
)
add_library(plan_manage
@@ -59,7 +58,7 @@ add_library(plan_manage
target_link_libraries(plan_manage ${catkin_LIBRARIES})
add_executable(traj_server src/traj_server.cpp)
-target_link_libraries(traj_server ${catkin_LIBRARIES} -ldw)
+target_link_libraries(traj_server ${catkin_LIBRARIES})
# add_dependencies(traj_server ${${PROJECT_NAME}_EXPORTED_TARGETS})
# benchmark node
@@ -88,4 +87,4 @@ add_executable(proc_msg2
target_link_libraries( proc_msg2
${catkin_LIBRARIES}
${PCL_LIBRARIES}
- )
\ No newline at end of file
+ )
3.4 uav_simulator/local_sensing - CUDA优化
$ git diff uav_simulator/local_sensing/CMakeLists.txt
diff --git a/uav_simulator/local_sensing/CMakeLists.txt b/uav_simulator/local_sensing/CMakeLists.txt
index a126b2e..982b82f 100644
--- a/uav_simulator/local_sensing/CMakeLists.txt
+++ b/uav_simulator/local_sensing/CMakeLists.txt
@@ -3,8 +3,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
SET(CMAKE_BUILD_TYPE Release) # Release, RelWithDebInfo
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-# set(ENABLE_CUDA true)
-set(ENABLE_CUDA false)
+set(ENABLE_CUDA true)
+#set(ENABLE_CUDA false)
if(ENABLE_CUDA)
find_package(CUDA REQUIRED)
@@ -17,7 +17,8 @@ if(ENABLE_CUDA)
# -gencode arch=compute_50,code=sm_50;
# -gencode arch=compute_52,code=sm_52;
# -gencode arch=compute_60,code=sm_60;
- -gencode arch=compute_61,code=sm_61;
+# -gencode arch=compute_61,code=sm_61;
+ -gencode arch=compute_87,code=sm_87;
)
SET(CUDA_PROPAGATE_HOST_FLAGS OFF)
4. 创建pcd环境
- 运行Rviz虚拟环境
$ cd ${YOUR_WORKSPACE_PATH}
$ source devel/setup.bash && roslaunch exploration_manager rviz.launch
- 然后运行map_generator
$ cd ${YOUR_WORKSPACE_PATH}
$ source devel/setup.bash && rosrun map_generator click_map
然后在 Rviz 中,使用 2D Nav Goal 工具(快捷键 G)来创建你的地图。两个连续点击的点形成一面墙。以下是一个示例:
- 完成后,在另一个终端运行以下节点来保存地图:
$ source devel/setup.bash && rosrun map_generator map_recorder ~/
通常,一个名为 tmp.pcd 的文件会保存在 ~/. 你可以将 ~/ 替换为任何你想要的位置。最后,你可以按照这里提到的方法使用这个文件进行探索。
5. 总结
- 依然存在segfault 等问题: segfault in nlopt_set_precond_max_objective, which is from ros-noetic-nlopt #72
- 从Fork角度看:貌似该版本相较于Fast-Planner更新,且短期内有人维护
- 另外,可以考虑尝试FC-Planner和RACER。其实这个是一个系列的开发代码,各种尝试就能找到一些类似的问题(这也是版本管理的重要性)。
总体来说,都能编译通过,虽然执行存在各种问题,待查!!!
期望能尽快看到类似模拟效果:
6 补充
当前版本Readme.md文件仍然没有更新,其实生成的CMakeLists.txt
已经含有set(CMAKE_CXX_STANDARD 14)
。
daniel@nvidia:~/HKUST/FUEL/src$ pwd
/home/daniel/HKUST/FUEL/src
daniel@nvidia:~/HKUST/FUEL/src$ cat CMakeLists.txt
# toplevel CMakeLists.txt for a catkin workspace
# catkin/cmake/toplevel.cmake
cmake_minimum_required(VERSION 3.0.2)
project(Project)
set(CATKIN_TOPLEVEL TRUE)
set(CMAKE_CXX_STANDARD 14)
# search for catkin within the workspace
set(_cmd "catkin_find_pkg" "catkin" "${CMAKE_SOURCE_DIR}")
execute_process(COMMAND ${_cmd}
RESULT_VARIABLE _res
OUTPUT_VARIABLE _out
ERROR_VARIABLE _err
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE
)
if(NOT _res EQUAL 0 AND NOT _res EQUAL 2)
# searching fot catkin resulted in an error
string(REPLACE ";" " " _cmd_str "${_cmd}")
message(FATAL_ERROR "Search for 'catkin' in workspace failed (${_cmd_str}): ${_err}")
endif()
# include catkin from workspace or via find_package()
if(_res EQUAL 0)
set(catkin_EXTRAS_DIR "${CMAKE_SOURCE_DIR}/${_out}/cmake")
# include all.cmake without add_subdirectory to let it operate in same scope
include(${catkin_EXTRAS_DIR}/all.cmake NO_POLICY_SCOPE)
add_subdirectory("${_out}")
else()
# use either CMAKE_PREFIX_PATH explicitly passed to CMake as a command line argument
# or CMAKE_PREFIX_PATH from the environment
if(NOT DEFINED CMAKE_PREFIX_PATH)
if(NOT "$ENV{CMAKE_PREFIX_PATH}" STREQUAL "")
if(NOT WIN32)
string(REPLACE ":" ";" CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
else()
set(CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
endif()
endif()
endif()
# list of catkin workspaces
set(catkin_search_path "")
foreach(path ${CMAKE_PREFIX_PATH})
if(EXISTS "${path}/.catkin")
list(FIND catkin_search_path ${path} _index)
if(_index EQUAL -1)
list(APPEND catkin_search_path ${path})
endif()
endif()
endforeach()
# search for catkin in all workspaces
set(CATKIN_TOPLEVEL_FIND_PACKAGE TRUE)
find_package(catkin QUIET
NO_POLICY_SCOPE
PATHS ${catkin_search_path}
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
unset(CATKIN_TOPLEVEL_FIND_PACKAGE)
if(NOT catkin_FOUND)
message(FATAL_ERROR "find_package(catkin) failed. catkin was neither found in the workspace nor in the CMAKE_PREFIX_PATH. One reason may be that no ROS setup.sh was sourced before.")
endif()
endif()
catkin_workspace()