Linux 35.5 + JetPack v5.1.3@RACER编译安装

打印 上一主题 下一主题

主题 635|帖子 635|积分 1905

1. 源由

鉴于以下两个自动导航规划路径的软件在模拟环节都有差别程度的segfault,那么只能在尝试下他们的后任继承代码。


  • Linux 35.5 + JetPack v5.1.3@Fast-Planner编译安装
  • Linux 35.5 + JetPack v5.1.3@FUEL编译安装
现在就顺着代码指向或者历史路径找到了RACER, RApid Collaborative ExploRation。这是一种完全分散的方法,用于使用一支四旋翼飞行器队伍举行探索任务。所提出的系统具有针对不稳固通信的鲁棒性,以及高度的调和性。四旋翼团队采用异步和有限通信运作,不需要任何中央控制。为了充分发挥系统的潜力,团队的覆盖路径和工作负载分配举行了优化平静衡。
2. 编译&安装

注1:不清楚ROS版本的,请先查看下版本,留意要ROS而非ROS2。
  1. $ rosversion --distro
  2. noetic
复制代码
注2:基于RACER最新github上的代码版本。
  1. $ git log -n 1
  2. commit ea774df1f1a40c0bc77dd8cbde74bfd9b8fb690f (HEAD -> main, origin/main, origin/HEAD)
  3. Merge: d8487e2 dcd8a73
  4. Author: Boyu Zhou <uv.boyuzhou@gmail.com>
  5. Date:   Tue Apr 23 19:20:42 2024 +0800
  6.     Merge pull request #22 from yinleung/patch-1
  7.     Update README.md
复制代码
Step 1:依赖库安装

  1. $ sudo apt-get install libarmadillo-dev ros_${ROS_VERSION_NAME}_nlopt libelf-dev libdw-dev
复制代码
Step 2:LKH-3安装

LKH-3 是 LKH-2 的扩展,用于解决受约束的旅行商和车辆路径问题。
注:保举LKH-3.0.6,当前最新版本LKH-3.0.9。
  1. $ wget http://akira.ruc.dk/~keld/research/LKH-3/LKH-3.0.6.tgz
  2. $ tar xvfz LKH-3.0.6.tgz
  3. $ cd LKH-3.0.6
  4. $ make
  5. $ sudo cp LKH /usr/local/bin
复制代码
Step 3:建立工程

  1. $ mkdir -p ${YOUR_WORKSPACE_PATH}/src
  2. $ cd ${YOUR_WORKSPACE_PATH}/src
  3. $ git clone git@github.com:SYSU-STAR/RACER.git
复制代码
注:若存在网络问题,请使用git协议clone代码。git协议始终比https稳固,但需要留意ssh key的安装问题。
Step 4:编译工程

  1. $ cd ${YOUR_WORKSPACE_PATH}
  2. $ catkin_make
复制代码
Step 5:安装工程

略,因为暂时不涉及软件的摆设应用,相关模拟命令参考:


  • 运行Rviz虚拟环境
  1. $  source devel/setup.bash && roslaunch exploration_manager rviz.launch
复制代码


  • 运行模拟程序
  1. $ source devel/setup.bash && roslaunch exploration_manager swarm_exploration.launch
复制代码
3. 问题汇总

3.1 组件ros-noetic-multi-map-server问题

  1. [ 86%] Building CXX object RACER/uav_simulator/Utils/multi_map_server/CMakeFiles/multi_map_visualization.dir/src/multi_map_visualization.cc.o
  2. /home/daniel/HKUST/RACER/src/RACER/uav_simulator/Utils/multi_map_server/src/multi_map_visualization.cc:5:10: fatal error: multi_map_server/MultiOccupancyGrid.h: No such file or directory
  3.     5 | #include <multi_map_server/MultiOccupancyGrid.h>
  4.       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  5. compilation terminated.
  6. make[2]: *** [RACER/uav_simulator/Utils/multi_map_server/CMakeFiles/multi_map_visualization.dir/build.make:63: RACER/uav_simulator/Utils/multi_map_server/CMakeFiles/multi_map_visualization.dir/src/multi_map_visualization.cc.o] Error 1
  7. make[1]: *** [CMakeFiles/Makefile2:6342: RACER/uav_simulator/Utils/multi_map_server/CMakeFiles/multi_map_visualization.dir/all] Error 2
  8. make[1]: *** Waiting for unfinished jobs....
复制代码
**解决方案:**安装组件ros-noetic-multi-map-server
  1. $ sudo apt-get install ros-noetic-multi-map-server
复制代码
3.2 swarm_exploration/plan_env - OpenCV

  1. $ git diff swarm_exploration/plan_env/CMakeLists.txt
  2. diff --git a/swarm_exploration/plan_env/CMakeLists.txt b/swarm_exploration/plan_env/CMakeLists.txt
  3. index bafe24e..cf26968 100644
  4. --- a/swarm_exploration/plan_env/CMakeLists.txt
  5. +++ b/swarm_exploration/plan_env/CMakeLists.txt
  6. @@ -63,10 +63,11 @@ add_library( plan_env
  7. target_link_libraries( plan_env
  8.      ${catkin_LIBRARIES}
  9.      ${PCL_LIBRARIES}
  10. +    ${OpenCV_LIBS}
  11.      )
  12. add_executable(obj_generator
  13.      src/obj_generator.cpp
  14.      )
  15. target_link_libraries(obj_generator
  16. -    ${catkin_LIBRARIES})
  17. \ No newline at end of file
  18. +    ${catkin_LIBRARIES})
复制代码
3.3 uav_simulator/local_sensing - CUDA优化

  1. $ git diff uav_simulator/local_sensing/CMakeLists.txt
  2. diff --git a/uav_simulator/local_sensing/CMakeLists.txt b/uav_simulator/local_sensing/CMakeLists.txt
  3. index bd28736..608f0fc 100644
  4. --- a/uav_simulator/local_sensing/CMakeLists.txt
  5. +++ b/uav_simulator/local_sensing/CMakeLists.txt
  6. @@ -3,8 +3,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
  7. SET(CMAKE_BUILD_TYPE Release) # Release, RelWithDebInfo
  8. SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
  9. -#set(ENABLE_CUDA true)
  10. -set(ENABLE_CUDA false)
  11. +set(ENABLE_CUDA true)
  12. +#set(ENABLE_CUDA false)
  13. if(ENABLE_CUDA)
  14.    find_package(CUDA REQUIRED)
  15. @@ -17,7 +17,8 @@ if(ENABLE_CUDA)
  16. #       -gencode arch=compute_50,code=sm_50;
  17. #       -gencode arch=compute_52,code=sm_52;
  18. #       -gencode arch=compute_60,code=sm_60;
  19. -      -gencode arch=compute_61,code=sm_61;
  20. +#       -gencode arch=compute_61,code=sm_61;
  21. +        -gencode arch=compute_87,code=sm_87;
  22.    )
  23.    SET(CUDA_PROPAGATE_HOST_FLAGS OFF)
复制代码
3.4 第二次重复编译错误

  1. /home/daniel/SYSU-STAR/RACER/src/RACER/swarm_exploration/utils/lkh_tsp_solver/src2/tsp_node.cpp:6:10: fatal error: lkh_tsp_solver/SolveTSP.h: No such file or directory
  2.     6 | #include <lkh_tsp_solver/SolveTSP.h>
  3.       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. compilation terminated.
  5. make[2]: *** [RACER/swarm_exploration/utils/lkh_tsp_solver/CMakeFiles/tsp_node.dir/build.make:1428: RACER/swarm_exploration/utils/lkh_tsp_solver/CMakeFiles/tsp_node.dir/src2/tsp_node.cpp.o] Error 1
  6. make[2]: *** Waiting for unfinished jobs....
复制代码
  1. In file included from /home/daniel/SYSU-STAR/RACER/src/RACER/swarm_exploration/plan_env/src/sdf_map.cpp:3:
  2. /home/daniel/SYSU-STAR/RACER/src/RACER/swarm_exploration/plan_env/include/plan_env/multi_map_manager.h:7:10: fatal error: plan_env/ChunkStamps.h: No such file or directory
  3.     7 | #include <plan_env/ChunkStamps.h>
  4.       |          ^~~~~~~~~~~~~~~~~~~~~~~~
  5. compilation terminated.
  6. In file included from /home/daniel/SYSU-STAR/RACER/src/RACER/swarm_exploration/plan_env/src/multi_map_manager.cpp:2:
  7. /home/daniel/SYSU-STAR/RACER/src/RACER/swarm_exploration/plan_env/include/plan_env/multi_map_manager.h:7:10: fatal error: plan_env/ChunkStamps.h: No such file or directory
  8.     7 | #include <plan_env/ChunkStamps.h>
  9.       |          ^~~~~~~~~~~~~~~~~~~~~~~~
  10. compilation terminated.
  11. make[2]: *** [RACER/swarm_exploration/plan_env/CMakeFiles/plan_env.dir/build.make:128: RACER/swarm_exploration/plan_env/CMakeFiles/plan_env.dir/src/multi_map_manager.cpp.o] Error 1
  12. make[2]: *** Waiting for unfinished jobs....
复制代码
  1. In file included from /home/daniel/SYSU-STAR/RACER/src/RACER/swarm_exploration/utils/lkh_tsp_solver/src2/tsp_node.cpp:6:
  2. /home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:22:9: error: ‘SolveTSPResponse’ does not name a type; did you mean ‘SolveTSPRequest’?
  3.    22 | typedef SolveTSPResponse Response;
  4.       |         ^~~~~~~~~~~~~~~~
  5.       |         SolveTSPRequest
  6. /home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:24:1: error: ‘Response’ does not name a type
  7.    24 | Response response;
  8.       | ^~~~~~~~
  9. /home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:27:9: error: ‘Response’ does not name a type
  10.    27 | typedef Response ResponseType;
  11.       |         ^~~~~~~~
  12. /home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:93:34: error: ‘SolveTSPResponse’ is not a member of ‘lkh_tsp_solver’; did you mean ‘SolveTSPRequest’?
  13.    93 | struct MD5Sum< ::lkh_tsp_solver::SolveTSPResponse>
  14.       |                                  ^~~~~~~~~~~~~~~~
  15.       |                                  SolveTSPRequest
  16. /home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:93:34: error: ‘SolveTSPResponse’ is not a member of ‘lkh_tsp_solver’; did you mean ‘SolveTSPRequest’?
  17.    93 | struct MD5Sum< ::lkh_tsp_solver::SolveTSPResponse>
  18.       |                                  ^~~~~~~~~~~~~~~~
  19.       |                                  SolveTSPRequest
  20. /home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:93:50: error: template argument 1 is invalid
  21.    93 | struct MD5Sum< ::lkh_tsp_solver::SolveTSPResponse>
  22.       |                                                  ^
  23. /home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:108:36: error: ‘SolveTSPResponse’ is not a member of ‘lkh_tsp_solver’; did you mean ‘SolveTSPRequest’?
  24.   108 | struct DataType< ::lkh_tsp_solver::SolveTSPResponse>
  25.       |                                    ^~~~~~~~~~~~~~~~
  26.       |                                    SolveTSPRequest
  27. /home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:108:36: error: ‘SolveTSPResponse’ is not a member of ‘lkh_tsp_solver’; did you mean ‘SolveTSPRequest’?
  28.   108 | struct DataType< ::lkh_tsp_solver::SolveTSPResponse>
  29.       |                                    ^~~~~~~~~~~~~~~~
  30.       |                                    SolveTSPRequest
  31. /home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:108:52: error: template argument 1 is invalid
  32.   108 | struct DataType< ::lkh_tsp_solver::SolveTSPResponse>
  33.       |                                                    ^
  34. /home/daniel/SYSU-STAR/RACER/src/RACER/swarm_exploration/utils/lkh_tsp_solver/src2/tsp_node.cpp:11:84: error: ‘lkh_tsp_solver::SolveTSP::Response’ has not been declared
  35.    11 | bool tspCallback(lkh_tsp_solver::SolveTSP::Request& req, lkh_tsp_solver::SolveTSP::Response& res) {
复制代码
解决方案:

  • 重新编译,貌似不可,仍然堕落
  • 清算git代码库中出现在swarm_exploration/utils/下的文件后,正常编译
  1. $ git status
  2. On branch main
  3. Your branch is up to date with 'origin/main'.
  4. Changes not staged for commit:
  5.   (use "git add <file>..." to update what will be committed)
  6.   (use "git restore <file>..." to discard changes in working directory)
  7.         modified:   swarm_exploration/plan_env/CMakeLists.txt
  8.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_1.atsp
  9.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_1.par
  10.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_1.tour
  11.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_2.atsp
  12.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_2.par
  13.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_2.tour
  14.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_3.atsp
  15.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_3.par
  16.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_3.tour
  17.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_4.atsp
  18.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_4.par
  19.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_4.tour
  20.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_1.atsp
  21.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_1.par
  22.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_1.tour
  23.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_2.atsp
  24.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_2.par
  25.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_2.tour
  26.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_3.atsp
  27.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_3.par
  28.         modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_3.tour
  29.         modified:   uav_simulator/local_sensing/CMakeLists.txt
  30. no changes added to commit (use "git add" and/or "git commit -a")
  31. daniel@nvidia:~/SYSU-STAR/RACER/src/RACER$ git checkout swarm_exploration/utils
  32. Updated 21 paths from the index
  33. daniel@nvidia:~/SYSU-STAR/RACER/src/RACER$ git status
  34. On branch main
  35. Your branch is up to date with 'origin/main'.
  36. Changes not staged for commit:
  37.   (use "git add <file>..." to update what will be committed)
  38.   (use "git restore <file>..." to discard changes in working directory)
  39.         modified:   swarm_exploration/plan_env/CMakeLists.txt
  40.         modified:   uav_simulator/local_sensing/CMakeLists.txt
  41. no changes added to commit (use "git add" and/or "git commit -a")
复制代码
4. 创建pcd环境



  • 运行Rviz虚拟环境
  1. $ cd ${YOUR_WORKSPACE_PATH}
  2. $ source devel/setup.bash && roslaunch exploration_manager rviz.launch
复制代码


  • 然后运行map_generator
  1. $ cd ${YOUR_WORKSPACE_PATH}
  2. $ source devel/setup.bash && rosrun map_generator click_map
复制代码
然后在 Rviz 中,使用 2D Nav Goal 工具(快捷键 G)来创建你的地图。两个一连点击的点形成一面墙。以下是一个示例:



  • 完成后,在另一个终端运行以下节点来保存地图:
  1. $ source devel/setup.bash && rosrun map_generator map_recorder ~/
复制代码
通常,一个名为 tmp.pcd 的文件会保存在 ~/. 你可以将 ~/ 替换为任何你想要的位置。最后,你可以按照这里提到的方法使用这个文件举行探索。
5. 总结

总的来说,仍然存在一些问题,模拟器无法使用: latest code on jetson orin got stucked, any idea? #23
无法看到下面动态的模拟图像:


免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

前进之路

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表