一.环境
ubuntu 20.04 noetic livox horizon RS-Hellos-16P
二.安装源码
安装过程参照github官方安装过程
https://github.com/jedeschaud/ct_icp
遇见的错误以及注意事项:
mkdir .cmake-build-superbuild && cd .cmake-build-superbuild #< Creates the cmake folder
cmake ../superbuild #< (1) Configure step
cmake --build . --config Release #< Build step (Downloads and install the dependencies), add -DWITH_VIZ3D=ON to install with the GUI
1.在运行第一步的第三行时,容易遇见网络问题,解决方法:可以打开梯子,我是这么做的,没有遇见网络报错,如果这样hai不行,可以参考下面这位博主的方法
2.运行时报错
CMake Error at /home/xxxx/ct_icp/install/googletest/lib/cmake/GTest/GTestTargets.cmake:42 (message):
Some (but not all) targets in this export set were already defined.Targets Defined: GTest::gtest, GTest::gtest_main
Targets not yet defined: GTest::gmock, GTest::gmock_main
Call Stack (most recent call first):
/home/xx/ct_icp/install/googletest/lib/cmake/GTest/GTestConfig.cmake:32 (include)
/home/xx/ct_icp/install/superbuild_import.cmake:35 (find_package)
/home/xxx/ct_icp/install/superbuild_import.cmake:94 (SLAM_DEFAULT_FIND_PACKAGE)
/home/xxx/ct_icp/install/CT_ICP/lib/cmake/cmake/superbuild_utils.cmake:27 (include)
slam_roscore/CMakeLists.txt:20 (SLAM_INCLUDE_SUPERBUILD)
-- Configuring incomplete, errors occurred!
See also "/home/xxx/ct_icp_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/xxxx/ct_icp_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
查阅资料发现是catkin的问题,在目录/opt/ros/noetic/bin/catkin_make 200行左右将标红的部分替换成你自己的cmake路径,应该为源码安装的路径
cmd = [
'/home/h/software/cmake-3.22/bin/cmake',
source_path,
]
3.报错
/Sophus/sophus/so2.cpp:32:26: error: lvalue required as left operand of assignment
unit_complex_.real() = 1.;/Sophus/sophus/so2.cpp:33:26: error: lvalue required as left operand of assignment
unit_complex_.imag() = 0.;
解决方法,将代码改成
unit_complex_.real(1.);
unit_complex_.imag(0.);
三.运行
根据自己的雷达点云类型选择启动文件,/velodyne_points为urban_loco_HK.launch,/rslidar_points为urban_loco_CAL.launch,在这里我使用的雷达是/rslidar_points的,所以我使用第二个launch文件。
打开终端播放录制好的数据包,再开一个终端运行
roslaunch ct_icp_odometry urban_loco_CAL.launch
运行效果如下
四.一些说明
官方自己的launch文件会要求你填入数据包,如果你想实时运行或者不想每次都修改路径,可以将rosbag包这个节点注释掉,主要修改两个文件,如下,注释掉bag包节点就行了,其余的不需要修改。
如果想要修改参数,提升效果,可以对launch文件中提到的相应的yaml文件进行调参。如下
还有一点需要注意的是,此算法应该是只显示当前帧的点云,没有保存全局地图的效果,如果需要保存全局pcd,可能需要使用CloudCompare等软件合成pcd。在rviz可以通过修改decay_time提高点云保存时间。最后贴一张运行好的效果。