A-LOAM配置过程

A-LOAM配置过程

工作环境:Ubuntu 18.04 + ROS Melodic + eigen 3.3.4 + PCL 1.8.1 + ceres 2.0

安装 ceres(参考链接

1)下载:

git clone https://ceres-solver.googlesource.com/ceres-solver

2)依赖项准备:

# 确保已经安装CMake
sudo apt-get install cmake
# 安装google-glog + gflags,应该是输出代码提示消息的一个google开源库
sudo apt-get install libgoogle-glog-dev libgflags-dev
# 安装BLAS & LAPACK
sudo apt-get install libatlas-base-dev
# 安装Eigen3
sudo apt-get install libeigen3-dev
# 安装SuiteSparse and CXSparse (可选的)
sudo apt-get install libsuitesparse-dev

3)安装过程

# 如果是下载的压缩包,使用tar命令进行解包
tar zxf ceres-solver-2.0.0.tar.gz
# 在解包的路径下建立一个文件夹,命名为ceres-bin
mkdir ceres-bin
# 切换到ceres-bin中
cd ceres-bin
# 进行编译
cmake ../ceres-solver-2.0.0
make -j3
# 测试
make test
# Optionally install Ceres, it can also be exported using CMake which
# allows Ceres to be used without requiring installation, see the documentation
# for the EXPORT_BUILD_DIR option for more information.
# 安装,上面提示说也可以不安装,但是我们还是安装吧
make install

4)ceres已经安装完成了,使用下面一句话进行测试是否成功。

bin/simple_bundle_adjuster ../ceres-solver-2.0.0/data/problem-16-22106-pre.txt

出现类似如下的结果,则说明安装成功。

iter      cost      cost_change  |gradient|   |step|    tr_ratio  tr_radius  ls_iter  iter_time  total_time
   0  4.185660e+06    0.00e+00    1.09e+08   0.00e+00   0.00e+00  1.00e+04       0    7.59e-02    3.37e-01
   1  1.062590e+05    4.08e+06    8.99e+06   5.36e+02   9.82e-01  3.00e+04       1    1.65e-01    5.03e-01
   2  4.992817e+04    5.63e+04    8.32e+06   3.19e+02   6.52e-01  3.09e+04       1    1.45e-01    6.48e-01
   3  1.899774e+04    3.09e+04    1.60e+06   1.24e+02   9.77e-01  9.26e+04       1    1.43e-01    7.92e-01
   4  1.808729e+04    9.10e+02    3.97e+05   6.39e+01   9.51e-01  2.78e+05       1    1.45e-01    9.36e-01
   5  1.803399e+04    5.33e+01    1.48e+04   1.23e+01   9.99e-01  8.33e+05       1    1.45e-01    1.08e+00
   6  1.803390e+04    9.02e-02    6.35e+01   8.00e-01   1.00e+00  2.50e+06       1    1.50e-01    1.23e+00

Ceres Solver v2.0.0 Solve Report
----------------------------------
                                     Original                  Reduced
Parameter blocks                        22122                    22122
Parameters                              66462                    66462
Residual blocks                         83718                    83718
Residual                               167436                   167436

Minimizer                        TRUST_REGION

Dense linear algebra library            EIGEN
Trust region strategy     LEVENBERG_MARQUARDT

                                        Given                     Used
Linear solver                     DENSE_SCHUR              DENSE_SCHUR
Threads                                     1                        1
Linear solver threads                       1                        1
Linear solver ordering              AUTOMATIC                22106, 16

Cost:
Initial                          4.185660e+06
Final                            1.803390e+04
Change                           4.167626e+06

Minimizer iterations                        6
Successful steps                            6
Unsuccessful steps                          0

Time (in seconds):
Preprocessor                            0.261

  Residual evaluation                   0.082
  Jacobian evaluation                   0.412
  Linear solver                         0.442
Minimizer                               1.051

Postprocessor                           0.002
Total                                   1.357

Termination:                      CONVERGENCE (Function tolerance reached. |cost_change|/cost: 1.769766e-09 <= 1.000000e-06)

安装 PCL(参考链接

若已经安装了 ROS 那么PCL是默认已经安装好了的。但是如果没有安装可以通过以下两种方式。
第一种(缺点是好像不能选择版本)

sudo apt install libpcl-dev

第二种,下载对应PCL版本的源文件,进行编译安装,下载地址
网上有很多教程,这里就不再叙述了。(作者安装的是pcl 1.8.1)

安装 LOAM(参考链接

	# 切换到工作空间下的src文件夹
    cd ~/catkin_ws/src
    # 下载源文件
    git clone https://github.com/HKUST-Aerial-Robotics/A-LOAM.git
    # 回到上一级目录,即 catkin_ws
    cd ../
    # 使用catkin工具进行编译
    catkin_make
    # 激活当前的环境,可以使用 source ./devel/setup.bash
    source ~/catkin_ws/devel/setup.bash

测试

下载样例数据集,大概700-800 M,下载链接(NSH indoor outdoor )。

	# 启动 loam, 选择VLP_16,因为样例数据是16线的
    roslaunch aloam_velodyne aloam_velodyne_VLP_16.launch
    # 切换到自己数据的路径,播放这个bag样例
    rosbag play YOUR_DATASET_FOLDER/nsh_indoor_outdoor.bag

测试过程中rviz界面中会出现相应的路径和全局地图。
同时还可以使用kitti数据集进行测试。

    roslaunch aloam_velodyne aloam_velodyne_HDL_64.launch
    roslaunch aloam_velodyne kitti_helper.launch

猜你喜欢

转载自blog.csdn.net/wxc_1998/article/details/118654328