Linux 35.5 + JetPack v5.1.3@FC-Planner编译安装
- 1. 源由
- 2. 编译&安装
- Step 1:依赖库安装
- Step 2:克隆工程
- Step 3:编译工程
- Step 4:LKH编译
- Step 5:安装工程
- 3. 问题汇总
- 3.1 Killed signal terminated program cc1plus
- 3.2 swarm_exploration/plan_env - OpenCV
- 3.3 FC-Planner替换LKH
- 3.4 程序异常退出
- 4. 总结
- 5. 附录
- 5.1 LKH-3安装
- 5.2 FC-Planner采用三方库(推荐)
- 5.3 YSU-STAR/FC-Planner
1. 源由
FC-Planner是一种复杂三维场景快速空中覆盖规划框架。
这个就是非常吸引人的东东,因为之前有简单呃呃了解过手持式三维光学扫描:(当然应该不仅限这几家,很多国外公司)
- 思看科技(杭州)
- 先临三维(杭州)
- 海克斯康(青岛)
据了解手持式三维扫描主要是光学的扫描和建模,主要是精度和误差方面的问题。
而这个可以大面积、体积下的进行3D重建,对于今后的三维空间重建,包括虚拟化AR/VR都会有很大的处境,尤其是快速建模方面。
PS:相信大家在异形上看到过普罗米修斯那集,哪个探测球,就是利用这种三维技术,快速对外星飞船进行了3D重建。
2. 编译&安装
注1:不清楚ROS版本的,请先查看下版本,注意要ROS而非ROS2。
$ rosversion --distro
noetic
注2:基于FC-Planner最新github上的代码版本。
$ git log -n 1
commit bf57e48414b9de547b18d294f665d23cb3986fee (HEAD -> master, origin/master, origin/HEAD)
Author: Chen-Albert-FENG <chen835110460@qq.com>
Date: Thu May 23 01:19:29 2024 +0800[pref]: remove deprecated functions
Step 1:依赖库安装
$ sudo apt-get install cpufrequtils libompl-dev
Step 2:克隆工程
$ git clone https://github.com/HKUST-Aerial-Robotics/FC-Planner.git
注:若存在网络问题,请使用git协议clone代码。git协议始终比https稳定,但需要注意ssh key的安装问题。
Step 3:编译工程
$ cd FC-Planner
$ catkin config -DCMAKE_BUILD_TYPE=Release
$ catkin build --cmake-args -Wno-dev
Step 4:LKH编译
这里埋下一个伏笔:因为笔者一开始并未注意这个,而且在RACER上面,这个LKH3.0.6版本已经安装,所以压根没有运行下面以下命令。
$ cd src/hierarchical_coverage_planner/solution/LKH
$ make
人总是有固定的思维逻辑,并且人总是容易忽视一些感觉自己知道的事情。如果严格的按照CheckList思想来做,这里就已经出问题了。
注:如果遇到了这个问题,可以参考补充里面笔者的处理方法。或者根据3.2章节的内容进行代码版本确认。
Step 5:安装工程
略,因为暂时不涉及软件的部署应用,相关模拟命令参考:
- 运行Rviz虚拟环境
$ source devel/setup.bash && roslaunch hierarchical_coverage_planner rviz.launch
- 运行模拟程序
$ source devel/setup.bash && roslaunch hierarchical_coverage_planner mbs.launch
- 操作:先点击[2D Nav Goal]操作;然后点击[2D Pose Estimate]操作。
3. 问题汇总
3.1 Killed signal terminated program cc1plus
[ 91%] Building CXX object hierarchical_coverage_planner/CMakeFiles/hcplanner_exec.dir/src/hcplanner.cpp.o
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[2]: *** [hierarchical_coverage_planner/CMakeFiles/hcplanner_exec.dir/build.make:63: hierarchical_coverage_planner/CMakeFiles/hcplanner_exec.dir/src/hcplanner.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2916: hierarchical_coverage_planner/CMakeFiles/hcplanner_exec.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 92%] Linking CXX executable /home/daniel/HKUST/FC-Planner/FC-Planner/devel/lib/viewpoint_manager/viewpoint_manager_node
[ 93%] Linking CXX executable /home/daniel/HKUST/FC-Planner/FC-Planner/devel/lib/viewpoint_manager/skeleton_viewpoint_node
/usr/bin/ld: warning: libopencv_features2d.so.4.2, needed by /usr/lib/aarch64-linux-gnu/libopencv_calib3d.so.4.2.0, may conflict with libopencv_features2d.so.409
[ 93%] Built target skeleton_viewpoint_node
[ 93%] Built target viewpoint_manager_node
[ 95%] Building CXX object hierarchical_coverage_planner/CMakeFiles/hcplanner.dir/src/hcopp.cpp.o
[ 95%] Building CXX object hierarchical_coverage_planner/CMakeFiles/hcplanner.dir/src/hcsolver.cpp.o
[ 95%] Building CXX object hierarchical_coverage_planner/CMakeFiles/hcplanner.dir/src/hctraj.cpp.o
[ 96%] Linking CXX shared library /home/daniel/HKUST/FC-Planner/FC-Planner/devel/lib/libhcplanner.so
[ 96%] Built target hcplanner
make: *** [Makefile:141: all] Error 2
Invoking "make -j6 -l6" failed
解决方案: c++: fatal error: Killed signal terminated program cc1plus on Jetson Orin Nano #9
$ catkin_make -j1
3.2 swarm_exploration/plan_env - OpenCV
$ git diff FC-Planner/src/plan_env/CMakeLists.txt
diff --git a/FC-Planner/src/plan_env/CMakeLists.txt b/FC-Planner/src/plan_env/CMakeLists.txt
index 06cc294..14773af 100755
--- a/FC-Planner/src/plan_env/CMakeLists.txt
+++ b/FC-Planner/src/plan_env/CMakeLists.txt
@@ -47,4 +47,5 @@ add_library( plan_envtarget_link_libraries( plan_env${catkin_LIBRARIES}${PCL_LIBRARIES}
+ ${OpenCV_LIBS})
3.3 FC-Planner替换LKH
直接替换LKH3.0.6版本二进制:
$ pwd
/home/daniel/HKUST/FC-Planner/FC-Planner/src/hierarchical_coverage_planner/solution/LKH
$ cp /usr/local/bin/LKH LKH
3.4 程序异常退出
- c++: fatal error: Killed signal terminated program cc1plus on Jetson Orin Nano #9
- Jetson Orin Nano | FC-Planner Demo Exception Quit
**解决方案:**使用d47fe78和6d9b2d6之后的版本。
或者采用笔者的方法,将RACER下的LKH-3.0.6复制到对应的目录下替换LKH可执行文件,请参考:《Linux 35.5 + JetPack v5.1.3@RACER编译安装》
4. 总结
总体来说,非常高兴看到这个效果,后续逐步研究深入吧。
- How to change a different structure, such as a bridge to do the simulation? #10
- FC-Planner is extended to multi-UAV autonomous reconstruction as FC-Hetero
Jetson Orin Nano | FC-Planner simulation
5. 附录
5.1 LKH-3安装
LKH-3 是 LKH-2 的扩展,用于解决受约束的旅行商和车辆路径问题。
注:推荐LKH-3.0.6,当前最新版本LKH-3.0.9。
$ 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
5.2 FC-Planner采用三方库(推荐)
修改LKH相关脚本和路径(理论上,未尝试过):
./hierarchical_coverage_planner/src/hcsolver.cpp:97: string command_ = "cd " + GlobalSolver_ + " && ./LKH " + GlobalPar_;
./hierarchical_coverage_planner/src/hcsolver.cpp:987: local_command_ = "cd " + GlobalSolver_ + " && ./LKH " + LocalParF_;
./hierarchical_coverage_planner/launch/pipe.launch:96: <param name="hcplanner/global_solver" value="$(find hierarchical_coverage_planner)/solution/LKH" type="string"/>
./hierarchical_coverage_planner/launch/mbs.launch:96: <param name="hcplanner/global_solver" value="$(find hierarchical_coverage_planner)/solution/LKH" type="string"/>
./hierarchical_coverage_planner/launch/christ.launch:97: <param name="hcplanner/global_solver" value="$(find hierarchical_coverage_planner)/solution/LKH" type="string"/>
5.3 YSU-STAR/FC-Planner
$ git log -n 1
commit 6c7677d46563cc2f2d2e771b07ffe2642ecd26b1 (HEAD -> master, origin/master, origin/HEAD)
Author: Chen-Albert-FENG <chen835110460@qq.com>
Date: Thu Jun 6 00:29:56 2024 +0800[docs]: add pacifico demo
上述git版本存在问题汇总里面同样的问题,估计后续的版本会更新吧。