目录
我们需要调整它的大小,需要终端重新配置大小,将postBuffer值配置成合适的大小。比如:500M
一.安装A-LOAM和ceres-solver
1.初始化工作空间
mkdir ALOAM_ws
cd ALOAM_ws
wstool init src
2.从原作者的gitee上下载安装A_LOAM代码
GitHub - HKUST-Aerial-Robotics/A-LOAM: Advanced implementation of LOAM
或者
cd src
git clone https://github.com/HKUST-Aerial-Robotics/A-LOAM.git
!问题报错:
curl的postBuffer的默认值太小
wlm@wlm-virtual-machine:~/ALOAM_ws/src$ git clone https://github.com/HKUST-Aerial-Robotics/A-LOAM.git
正克隆到 'A-LOAM'...
remote: Enumerating objects: 481, done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: 过早的文件结束符(EOF)
fatal: index-pack 失败
我们需要调整它的大小,需要终端重新配置大小,将postBuffer值配置成合适的大小。比如:500M
git config --global http.postBuffer 524288000
3.获取ceres-solver源码
wget ceres-solver.org/ceres-solver-1.13.0.tar.gz
tar xvf ceres-solver-1.13.0.tar.gz
cd ceres-solver-1.13.0
mkdir build
cd build
cmake ..
make
然后测试是否通过,并下载
make test
sudo make install
二.安装Eigen3、PCL
1、Eigen3
wget https://gitlab.com/libeigen/eigen/-/archive/3.2.10/eigen-3.2.10.tar.gz
tar xvf eigen-3.2.10.tar.gz
cd eigen-3.2.10
mkdir build
cd build
cmake ..
sudo make install
2、PCL
sudo apt install libpcl-dev
三.下载资源包、编译
1.在src外面的文件夹下
catkin_make
成功如下:
wlm@wlm-virtual-machine:~/ALOAM_ws$ catkin_make
Base path: /home/wlm/ALOAM_ws
Source space: /home/wlm/ALOAM_ws/src
Build space: /home/wlm/ALOAM_ws/build
Devel space: /home/wlm/ALOAM_ws/devel
Install space: /home/wlm/ALOAM_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/wlm/ALOAM_ws/build"
####
####
#### Running command: "make -j2 -l2" in "/home/wlm/ALOAM_ws/build"
####
Consolidate compiler generated dependencies of target kittiHelper
[ 12%] Building CXX object A-LOAM/CMakeFiles/alaserMapping.dir/src/laserMapping.cpp.o
[ 25%] Building CXX object A-LOAM/CMakeFiles/kittiHelper.dir/src/kittiHelper.cpp.o
[ 37%] Linking CXX executable /home/wlm/ALOAM_ws/devel/lib/aloam_velodyne/kittiHelper
[ 37%] Built target kittiHelper
[ 50%] Linking CXX executable /home/wlm/ALOAM_ws/devel/lib/aloam_velodyne/alaserMapping
[ 50%] Built target alaserMapping
[ 62%] Building CXX object A-LOAM/CMakeFiles/alaserOdometry.dir/src/laserOdometry.cpp.o
[ 75%] Linking CXX executable /home/wlm/ALOAM_ws/devel/lib/aloam_velodyne/alaserOdometry
[ 75%] Built target alaserOdometry
[ 87%] Building CXX object A-LOAM/CMakeFiles/ascanRegistration.dir/src/scanRegistration.cpp.o
[100%] Linking CXX executable /home/wlm/ALOAM_ws/devel/lib/aloam_velodyne/ascanRegistration
[100%] Built target ascanRegistration
但是我第一次catkin_make报错如下(只截取了报错部分):
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 2 packages in topological order:
-- ~~ - ceres-solver (plain cmake)
-- ~~ - aloam_velodyne
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkin_workspace.cmake:100 (message):
This workspace contains non-catkin packages in it, and catkin cannot build
a non-homogeneous workspace without isolation. Try the
'catkin_make_isolated' command instead.
Call Stack (most recent call first):
CMakeLists.txt:69 (catkin_workspace)
-- Configuring incomplete, errors occurred!
See also "/home/wlm/ALOAM_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/wlm/ALOAM_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
第二次又报错如下:
[ 12%] Building CXX object A-LOAM/CMakeFiles/alaserMapping.dir/src/laserMapping.cpp.o
[ 25%] Building CXX object A-LOAM/CMakeFiles/kittiHelper.dir/src/kittiHelper.cpp.o
c++: internal compiler error: 已杀死 (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
A-LOAM/CMakeFiles/alaserMapping.dir/build.make:75: recipe for target 'A-LOAM/CMakeFiles/alaserMapping.dir/src/laserMapping.cpp.o' failed
make[2]: *** [A-LOAM/CMakeFiles/alaserMapping.dir/src/laserMapping.cpp.o] Error 4
CMakeFiles/Makefile2:1025: recipe for target 'A-LOAM/CMakeFiles/alaserMapping.dir/all' failed
make[1]: *** [A-LOAM/CMakeFiles/alaserMapping.dir/all] Error 2
make[1]: *** 正在等待未完成的任务....
[ 37%] Linking CXX executable /home/wlm/ALOAM_ws/devel/lib/aloam_velodyne/kittiHelper
[ 37%] Built target kittiHelper
Makefile:145: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j2 -l2" failed
解决:借鉴大佬的:
将四个.cpp文件中的/camera_init修改为camera_init
这四个.cpp文件在src/A-LOAM中
改完后我再次编译了一下,结果如下,成功了:
wlm@wlm-virtual-machine:~/ALOAM_ws$ catkin_make
Base path: /home/wlm/ALOAM_ws
Source space: /home/wlm/ALOAM_ws/src
Build space: /home/wlm/ALOAM_ws/build
Devel space: /home/wlm/ALOAM_ws/devel
Install space: /home/wlm/ALOAM_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/wlm/ALOAM_ws/build"
####
####
#### Running command: "make -j2 -l2" in "/home/wlm/ALOAM_ws/build"
####
Consolidate compiler generated dependencies of target kittiHelper
[ 12%] Building CXX object A-LOAM/CMakeFiles/alaserMapping.dir/src/laserMapping.cpp.o
[ 25%] Building CXX object A-LOAM/CMakeFiles/kittiHelper.dir/src/kittiHelper.cpp.o
[ 37%] Linking CXX executable /home/wlm/ALOAM_ws/devel/lib/aloam_velodyne/kittiHelper
[ 37%] Built target kittiHelper
[ 50%] Linking CXX executable /home/wlm/ALOAM_ws/devel/lib/aloam_velodyne/alaserMapping
[ 50%] Built target alaserMapping
[ 62%] Building CXX object A-LOAM/CMakeFiles/alaserOdometry.dir/src/laserOdometry.cpp.o
[ 75%] Linking CXX executable /home/wlm/ALOAM_ws/devel/lib/aloam_velodyne/alaserOdometry
[ 75%] Built target alaserOdometry
[ 87%] Building CXX object A-LOAM/CMakeFiles/ascanRegistration.dir/src/scanRegistration.cpp.o
[100%] Linking CXX executable /home/wlm/ALOAM_ws/devel/lib/aloam_velodyne/ascanRegistration
[100%] Built target ascanRegistration
2.下载数据集
下载样例数据集,大概700-800 M,下载链接:
3.建图
在ALOAM_ws文件夹下运行
source ~/ALOAM_ws/devel/setup.bash
roslaunch aloam_velodyne aloam_velodyne_VLP_16.launch
rosbag play刚刚下载的数据集:
rosbag play nsh_indoor_outdoor.bag
测试过程中rviz界面中会出现相应的路径和全局地图。
同时还可以使用kitti数据集进行测试。
roslaunch aloam_velodyne aloam_velodyne_HDL_64.launch
roslaunch aloam_velodyne kitti_helper.launch
四.图像结果
因为网络问题,数据包未下下来,所以没有运行编译rosbag play,只是没有数据出来,结果如下:是三维的,大功告成!