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

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

  • [1. 源由](#1. 源由)
  • [2. 编译&安装](#2. 编译&安装)
    • [Step 1:依赖库安装](#Step 1:依赖库安装)
    • [Step 2:LKH-3安装](#Step 2:LKH-3安装)
    • [Step 3:建立工程](#Step 3:建立工程)
    • [Step 4:编译工程](#Step 4:编译工程)
    • [Step 5:安装工程](#Step 5:安装工程)
  • [3. 问题汇总](#3. 问题汇总)
    • [3.1 组件ros-noetic-multi-map-server问题](#3.1 组件ros-noetic-multi-map-server问题)
    • [3.2 swarm_exploration/plan_env - OpenCV](#3.2 swarm_exploration/plan_env - OpenCV)
    • [3.3 uav_simulator/local_sensing - CUDA优化](#3.3 uav_simulator/local_sensing - CUDA优化)
    • [3.4 第二次重复编译错误](#3.4 第二次重复编译错误)
  • [4. 创建pcd环境](#4. 创建pcd环境)
  • [5. 总结](#5. 总结)

1. 源由

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

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

2. 编译&安装

注1:不清楚ROS版本的,请先查看下版本,注意要ROS而非ROS2。

bash 复制代码
$ rosversion --distro
noetic

注2:基于RACER最新github上的代码版本。

bash 复制代码
$ git log -n 1
commit ea774df1f1a40c0bc77dd8cbde74bfd9b8fb690f (HEAD -> main, origin/main, origin/HEAD)
Merge: d8487e2 dcd8a73
Author: Boyu Zhou <uv.boyuzhou@gmail.com>
Date:   Tue Apr 23 19:20:42 2024 +0800

    Merge pull request #22 from yinleung/patch-1

    Update README.md

Step 1:依赖库安装

bash 复制代码
$ 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。

bash 复制代码
$ wget http://akira.ruc.dk/~keld/research/LKH-3/LKH-3.0.6.tgz
$ tar xvfz LKH-3.0.6.tgz
$ cd LKH-3.0.6
$ make
$ sudo cp LKH /usr/local/bin

Step 3:建立工程

bash 复制代码
$ mkdir -p ${YOUR_WORKSPACE_PATH}/src
$ cd ${YOUR_WORKSPACE_PATH}/src
$ git clone git@github.com:SYSU-STAR/RACER.git

注:若存在网络问题,请使用git协议clone代码。git协议始终比https稳定,但需要注意ssh key的安装问题。

Step 4:编译工程

bash 复制代码
$ cd ${YOUR_WORKSPACE_PATH}
$ catkin_make

Step 5:安装工程

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

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

3. 问题汇总

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

bash 复制代码
[ 86%] Building CXX object RACER/uav_simulator/Utils/multi_map_server/CMakeFiles/multi_map_visualization.dir/src/multi_map_visualization.cc.o
/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
    5 | #include <multi_map_server/MultiOccupancyGrid.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
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
make[1]: *** [CMakeFiles/Makefile2:6342: RACER/uav_simulator/Utils/multi_map_server/CMakeFiles/multi_map_visualization.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

**解决方案:**安装组件ros-noetic-multi-map-server

bash 复制代码
$ sudo apt-get install ros-noetic-multi-map-server

3.2 swarm_exploration/plan_env - OpenCV

bash 复制代码
$ git diff swarm_exploration/plan_env/CMakeLists.txt
diff --git a/swarm_exploration/plan_env/CMakeLists.txt b/swarm_exploration/plan_env/CMakeLists.txt
index bafe24e..cf26968 100644
--- a/swarm_exploration/plan_env/CMakeLists.txt
+++ b/swarm_exploration/plan_env/CMakeLists.txt
@@ -63,10 +63,11 @@ add_library( plan_env
 target_link_libraries( plan_env
     ${catkin_LIBRARIES}
     ${PCL_LIBRARIES}
+    ${OpenCV_LIBS}
     )

 add_executable(obj_generator
     src/obj_generator.cpp
     )
 target_link_libraries(obj_generator
-    ${catkin_LIBRARIES})
\ No newline at end of file
+    ${catkin_LIBRARIES})

3.3 uav_simulator/local_sensing - CUDA优化

bash 复制代码
$ 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 bd28736..608f0fc 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)

3.4 第二次重复编译错误

bash 复制代码
/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
    6 | #include <lkh_tsp_solver/SolveTSP.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
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
make[2]: *** Waiting for unfinished jobs....
bash 复制代码
In file included from /home/daniel/SYSU-STAR/RACER/src/RACER/swarm_exploration/plan_env/src/sdf_map.cpp:3:
/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
    7 | #include <plan_env/ChunkStamps.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /home/daniel/SYSU-STAR/RACER/src/RACER/swarm_exploration/plan_env/src/multi_map_manager.cpp: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
    7 | #include <plan_env/ChunkStamps.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
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
make[2]: *** Waiting for unfinished jobs....
bash 复制代码
In file included from /home/daniel/SYSU-STAR/RACER/src/RACER/swarm_exploration/utils/lkh_tsp_solver/src2/tsp_node.cpp:6:
/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'?
   22 | typedef SolveTSPResponse Response;
      |         ^~~~~~~~~~~~~~~~
      |         SolveTSPRequest
/home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:24:1: error: 'Response' does not name a type
   24 | Response response;
      | ^~~~~~~~
/home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:27:9: error: 'Response' does not name a type
   27 | typedef Response ResponseType;
      |         ^~~~~~~~
/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'?
   93 | struct MD5Sum< ::lkh_tsp_solver::SolveTSPResponse>
      |                                  ^~~~~~~~~~~~~~~~
      |                                  SolveTSPRequest
/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'?
   93 | struct MD5Sum< ::lkh_tsp_solver::SolveTSPResponse>
      |                                  ^~~~~~~~~~~~~~~~
      |                                  SolveTSPRequest
/home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:93:50: error: template argument 1 is invalid
   93 | struct MD5Sum< ::lkh_tsp_solver::SolveTSPResponse>
      |                                                  ^
/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'?
  108 | struct DataType< ::lkh_tsp_solver::SolveTSPResponse>
      |                                    ^~~~~~~~~~~~~~~~
      |                                    SolveTSPRequest
/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'?
  108 | struct DataType< ::lkh_tsp_solver::SolveTSPResponse>
      |                                    ^~~~~~~~~~~~~~~~
      |                                    SolveTSPRequest
/home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:108:52: error: template argument 1 is invalid
  108 | struct DataType< ::lkh_tsp_solver::SolveTSPResponse>
      |                                                    ^
/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
   11 | bool tspCallback(lkh_tsp_solver::SolveTSP::Request& req, lkh_tsp_solver::SolveTSP::Response& res) {

解决方案:

  1. 重新编译,貌似不行,仍然出错
  2. 清理git代码库中出现在swarm_exploration/utils/下的文件后,正常编译
bash 复制代码
$ git status
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   swarm_exploration/plan_env/CMakeLists.txt
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_1.atsp
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_1.par
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_1.tour
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_2.atsp
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_2.par
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_2.tour
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_3.atsp
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_3.par
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_3.tour
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_4.atsp
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_4.par
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_4.tour
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_1.atsp
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_1.par
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_1.tour
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_2.atsp
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_2.par
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_2.tour
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_3.atsp
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_3.par
        modified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_3.tour
        modified:   uav_simulator/local_sensing/CMakeLists.txt

no changes added to commit (use "git add" and/or "git commit -a")
daniel@nvidia:~/SYSU-STAR/RACER/src/RACER$ git checkout swarm_exploration/utils
Updated 21 paths from the index
daniel@nvidia:~/SYSU-STAR/RACER/src/RACER$ git status
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   swarm_exploration/plan_env/CMakeLists.txt
        modified:   uav_simulator/local_sensing/CMakeLists.txt

no changes added to commit (use "git add" and/or "git commit -a")

4. 创建pcd环境

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

然后在 Rviz 中,使用 2D Nav Goal 工具(快捷键 G)来创建你的地图。两个连续点击的点形成一面墙。以下是一个示例:

  • 完成后,在另一个终端运行以下节点来保存地图:
bash 复制代码
$ source devel/setup.bash && rosrun map_generator map_recorder ~/

通常,一个名为 tmp.pcd 的文件会保存在 ~/. 你可以将 ~/ 替换为任何你想要的位置。最后,你可以按照这里提到的方法使用这个文件进行探索。

5. 总结

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

无法看到下面动态的模拟图像:

相关推荐
originalHSL5 分钟前
Load-Balanced-Online-OJ(负载均衡式在线OJ)
linux·c++·git·vscode·http·https·json
mit6.82440 分钟前
[Redis#0] iredis: linux上redis超好用的环境配置
linux·redis·后端
陌小呆^O^1 小时前
Cmakelist.txt之Linux-redis配置
linux·运维·redis
ernesto_ji1 小时前
Linux中,防火墙基本操作指令
linux·运维·网络
丶Darling.2 小时前
MIT 6.S081 | 操作系统 | Lab1: Xv6 and Unix utilities
linux·服务器·c语言·操作系统·unix·lab·mit 6.s081
Burfitt.Lee2 小时前
Linux:confluence8.5.9的部署(下载+安装+pojie)离线部署全流程 遇到的问题
linux·运维·服务器
vvw&2 小时前
使用 Nginx 在 Ubuntu 22.04 上安装 LibreNMS 开源网络监控系统
linux·运维·服务器·nginx·ubuntu·github·librenms
运维&陈同学2 小时前
【zookeeper02】消息队列与微服务之zookeeper单机部署
linux·服务器·分布式·微服务·zookeeper·云原生·消息队列·云计算
与君共勉121383 小时前
Jenkins-Git Parameter 插件实现指定版本的发布和回滚
linux·服务器·gitlab·jenkins
wusam3 小时前
CentOS8.5.2111(7)完整的Apache综合实验
linux·运维·apache