Ubuntu16.04 Deployment Cartographer

System environment configuration: ROS Kinetic + Ubuntu16.04 + Cartographer_ros, the configuration process is quite smooth, thanks to the tutorials shared by some bloggers on the Internet

1. Install ROS kinetic

Kinetic installation is relatively simple, you can directly search for tutorials on the Internet, or use the tutorial on the wiki to install: ROS Kinetic installation .

2. Install dependencies

sudo apt-get install -y google-mock libboost-all-dev libeigen3-dev libgflags-dev libgoogle-glog-dev liblua5.2-dev libprotobuf-dev  libsuitesparse-dev libwebp-dev ninja-build protobuf-compiler python-sphinx ros-kinetic-tf2-eigen libatlas-base-dev libsuitesparse-dev liblapack-dev

3. Install ceres

The version used by ceres is 1.11. If it is another version, the compilation of cartographer may fail. Therefore, if other versions of ceres have been installed in the system before, you can uninstall it first, and then reinstall ceres 1.11

  • ceres uninstall:
sudo rm -r /usr/local/lib/cmake/Ceres
sudo rm -rf /usr/local/include/ceres /usr/local/lib/libceres.a
  • Download and install ceres 1.11:
git clone https://github.com/hitcm/ceres-solver-1.11.0.git
cd ceres-solver-1.11.0
mkdir build
cd build
cmake ..
make -j4
sudo make install

4. Install cartographer

git clone https://github.com/hitcm/cartographer.git
cd cartographer
mkdir build
cd build
cmake .. -G Ninja
ninja
ninja test
sudo ninja install

5. Install cartographer_ros

#首先创建工作空间
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
echo "source catkin_ws/devel/setup.bash" >> ~/.bashrc(我使用的是zsh终端,如果为bash终端,则是setup.zsh和~/.bashrc)
source ~/.zshrc

cd ~/catkin_ws/src
git clone https://github.com/hitcm/cartographer_ros.git
cd ~/catkin_ws
catkin_make

6. Test

2D dataset download link
Run the following command:

# 2D (第三个参数为下载数据集路径)
roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/Downloads/cartographer_paper_deutsches_museum.bag
# 3D (第三个参数为下载数据集路径)
roslaunch cartographer_ros demo_backpack_3d.launch bag_filename:=${HOME}/Downloads/cartographer_3d_deutsches_museum.bag

insert image description here
Reference: https://blog.csdn.net/qq_40982681/article/details/91358033

Guess you like

Origin blog.csdn.net/qq_42938987/article/details/106739233