Cartographer installation and simulation test

Installation and configuration of cartographer

Reference Official Handbook of cartographer

According to the official Manual of cartographer, the installation of cartographer cannot be completed, mainly because the ceres library cannot be downloaded (the reason is very simple.. We all know that some famous websites do not exist in mainland China. Here are the installation steps:
Install dependency first:

sudo apt-get update
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

Follow the previous steps in the official Manual:

sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build

Then create the workspace. Be careful not to duplicate the name of the existing workspace, or the bash file will fail to find the path. The space created here is called cartograph? WS.

mkdir cartograph_ws
cd cartograph_ws
wstool init src
wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall
wstool update -t src

When arriving at this wstool update -t src, there will be no unexpected error:

fatal: unable to access 'https://ceres-solver.googlesource.com/ceres-solver.git/': Failed to connect to ceres-solver.googlesource.com
port 443: connection timed out
Exception caught during install: Error processing 'ceres-solver' : [ceres-solver] Checkout of https://ceres-solver.googlesource.com/ceres       -solver.git version 1.12.0rc4 into /home/jack/catkin_ws/src/ceres-solver failed.

When you open the src folder at this time, you will find that you have downloaded the cartographer and cartographer? ROS, just like the ceres library.

Enter the following command to download with a third-party resource:

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

Take a look at the folder and make sure the downloaded Ceres solver is in the src folder.
Then continue to follow the official manual steps:

src/cartographer/scripts/install_proto3.sh
sudo rosdep init
rosdep update 
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
catkin_make_isolated --install –use-ninja
source install_isolated/setup.bash

This completes the installation of cartographer.

Simulation demo test

First, download the 2D map test package of cartographer. Just download a 2D map (the full running time of the official demo is generally between half an hour and one hour): here are some 2D test package

Before the simulation test, if you have been online to the PC and the turnlebot before, you need to comment out the statement used for ssh Remote Login in bashrc file before, and then source bash file.

Carry out simulation test: start demo demonstration. If it is successful, you can see that rviz starts and starts to build the map:

roslaunch cartographer_ros demo_backpack_2d.launch  bag_filename:=Route/XXXX.bag

The above statement is rosslaunch + XXXX. Launch + bag_filename: = path / XXXX.bag. The specific launch file can be written by yourself, which will not be introduced here.
There are a lot of official launch files, the path is: cartographer? WS / SRC / cartographer? ROS / cartographer? ROS / launch/
Save the map and end the test.

rosrun map_server map_saver -f 'file'

Boring algorithm running video

av40133675

Published 1 original article, praised 0, visited 6
Private letter follow

Keywords: sudo Python git Google

Added by neoboffins on Fri, 28 Feb 2020 13:01:30 +0200