目录
Cartographer on Ubuntu16.04 + Kinetic + 2D
3.2 save map data as pbstream flle
3.3 change map data to pgm file
1. INSTALL
1.1 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
1.2 ceres-solver
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
1.3 cartographer
git clone https://github.com/cartographer-project/cartographer.git
cd cartographer
mkdir build
cd build
cmake .. -G Ninja
ninja
ninja test
sudo ninja install
1.4 proto3
/home/lzh/Downloads/cartographer/scripts/install_proto3.sh
1.5 abseil
/home/lzh/Downloads/cartographer/scripts/install_abseil.sh
1.6 cartographer-ros
cd catkin_ws/src
git clone https://github.com/hitcm/cartographer_ros.git
cd ..
catkin_make
2. MAPPING
cartographer_paper_deutsches_museum.bag
roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=/home/lzh/Downloads/cartographer_paper_deutsches_museum.bag
3. SAVE MAP
3.1 mapping done
cd catkin_ws
source devel/setup.bash
rosservice call /finish_trajectory "trajectory_id: 0"
then the terminal show
status:
code: 0
message: "Finished trajectory 0."
3.2 save map data as pbstream flle
rosservice call /write_state "filename: '/home/lzh/carto_ws/map/map0.pbstream'
include_unfinished_submaps: true"
then the terminal show
status:
code: 0
message: "State written to '/home/yx/carto_ws/map/map0.pbstream'."
3.3 change map data to pgm file
rosrun cartographer_ros cartographer_pbstream_to_ros_map -map_filestem=/home/lzh/carto_ws/map/map1 -pbstream_filename=/home/lzh/carto_ws/map/map0.pbstream -resolution=0.02
then the terminal show
I0220 18:39:45.450656 15055 pbstream_to_ros_map_main.cc:43] Loading submap slices from serialized data.
I0220 18:40:01.743477 15055 pbstream_to_ros_map_main.cc:51] Generating combined map image from submap slices.