####仅作为笔记
环境:
Ubuntu 64-bit 18.04. #在ubuntu16.04上测试出现轨迹漂移问题,在ubuntu18.04上暂未出现任何问题
Ceres Solver
PCL
Trajectory visualization
- Ceres Slover
sudo apt-get install liblapack-dev libsuitesparse-dev libcxsparse3.1.2 libgflags-dev
sudo apt-get install libgoogle-glog-dev libgtest-dev
#github上下载压缩文件
https://github.com/ceres-solver/ceres-solver
tar -xzvf ceres-solves tar.gz
cd ceres-solves
mkdir build && cd build
camke .. && make -j4
sudo make install
- PCL 1.8.0
sudo apt-get update
sudo apt-get install git build-essential linux-libc-dev
sudo apt-get install cmake cmake-gui
sudo apt-get install libusb-1.0-0-dev libusb-dev libudev-dev
sudo apt-get install mpi-default-dev openmpi-bin openmpi-common
sudo apt-get install libflann1.8 libflann-dev
sudo apt-get install libeigen3-dev
sudo apt-get install libboost-all-dev
sudo apt-get install libqhull* libgtest-dev
sudo apt-get install freeglut3-dev pkg-config
sudo apt-get install libxmu-dev libxi-dev
sudo apt-get install mono-complete
sudo apt-get install libopenni-dev
sudo apt-get install libopenni2-dev
# X11
sudo apt-get install libx11-dev libxext-dev libxtst-dev libxrender-dev libxmu-dev libxmuu-dev
#OpenGL
sudo apt-get install build-essential libgl1-mesa-dev libglu1-mesa-dev
#cmake
sudo apt-get install cmake cmake-gui
#源码安装vtk7.1.1
Download | VTK,我选择了VTK-7.1.1.tar.gz,下载完成后解压缩到你的文件安装目录。输入cmake-gui打开cmake图形界面:
配置“where is the source code”的路径为vtk-7.1.1所在的目录
在vtk-7.1.1目录新建build文件夹,配置“where to build the binaries”为build文件夹
点击Configure,配置完成后提示configure done
选择“VTK_GROUP_QT”再次点击configure
配置完成后点击generate按钮,会在build文件夹下生成工程文件
cd VTK-7.1.1/build
make -j4
sudo make install
安装pcl
cd pcl
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=None ..
make -j4
sudo make install
- 安装
cd ~/catkin_ws/src
git clone https://github.com/wh200720041/floam.git
cd ..
catkin_make
source ~/catkin_ws/devel/setup.bash
- 测试
数据集:
https://drive.google.com/open?id=18ilF7GZDg2tmT6sD5pd1RjqO0XJLn9Mv
https://drive.google.com/open?id=1VpoKm7f4es4ISQ-psp4CV3iylcA4eu0-
sudo apt-get install unzip
cd ~/Downloads #下载数据集的目录
unzip ~/Downloads/2011_09_30_0018.zip
- 运行
主要测试kitti数据集,用的是64线的激光雷达
roslaunch floam floam.launch #定位模式,只有局部地图
roslaunch floam floam_mapping.launch #全局地图,内存占用较大
#如果建图过程比较慢,尝试在launch文件中的rosbag play后面改变-r 0.5,变成-r 0.2减慢播放速度。
如果期望使用16线的激光雷达时,可以使用以下指令:
sudo apt-get install ros-melodic-velodyne-pointcloud
roslaunch floam floam_velodyne.launch #16线雷达
如果要使用kitti的其他数据集的话,需要将kitti转成rosbag的形式
cd ~/catkin_ws/src
git clone https://github.com/ethz-asl/kitti_to_rosbag.git
cd .. && catkin_make
#在编译过程用产生很多错误,因为缺了很多依赖的包:
#只要下载相应的包至catkin_ws/src下,重新编译即可,参考:
#https://www.jianshu.com/p/b6f12b071966
用法:
rosrun kitti_to_rosbag kitti_rosbag_converter calibration_path dataset_path output_path
举个例子:
rosrun kitti_to_rosbag kitti_rosbag_converter ~/data/kitti/2011_09_26 ~/data/kitti/2011_09_26/2011_09_26_drive_0035_sync ~/data/kitti/2011_09_26/2011_09_26_drive_0035_sync/testbag.bag
- 测试结果