[Moe] cartographer_ros new to the latest Installation Guide 2019-12

First, the article wrote in December 2019, cartographer is still constantly updated, the contents of this document may fail, but roughly the same installation process.

First, the hardware conditions

Use Platform

  • x86_64 platform

ROS release

  • Indigo
  • Kinetic
  • Lunar
  • Melodic

Second, compile and install

1. Install the necessary installation tools: python-wstool, python-rosdep and Ninja;

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

2. Create a workspace of cartographer_ros named "catkin_ws", and initialized.

mkdir catkin_ws
cd catkin_ws
wstool init src
# 这里先增加一个.rosinstall文件,修改内容如下一段
wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall
wstool update -t src
  • Here too the way, no way to access googlesource.com individual regions, namely Google's source code repository, fourth sentence after the above implementation, modification .rosinstall file to the src directory:
- git: {local-name: cartographer, uri: 'https://github.com/googlecartographer/cartographer.git', version: '1.0.0'}
- git: {local-name: cartographer_ros, uri: 'https://github.com/googlecartographer/cartographer_ros.git', version: '1.0.0'}
- git: {local-name: ceres-solver, uri: 'https://github.com/ceres-solver/ceres-solver.git', version: '1.13.0'}
  • ! Note: You can also copy the above address uri git source code directly, download the corresponding version of the source to the corresponding workspace src inside, you do not need wstool part of the command.
  • By the way also provides a blue cloud-outs links : https://www.lanzous.com/b0akgy6uh Password: cmvf

3. Install cartographer_ros dependencies (proto3 and deb packages). If you install ROS since initialization rosdep command has been executed, the command 'sudo rosdep init' displays an error, the error can be ignored.

# 脚本内容是配置了一些环境变量,然后用git下载proto3(肯定比较慢,可以手动下载),如果手动下载了proto3,里面需要改内容,内容在下一段。
src/cartographer/scripts/install_proto3.sh

# 这句初始化rosdep,一般正常安装ros都执行过,可以不用管。
sudo rosdep init 

# 下面这两句,是常用来一键安装该工作空间下所有依赖包的,务必熟练使用
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
  • ! Note If you manually download the 3.4.1 version of proto3 , the proposal is still with install_proto3.sh installation, but need to modify the content as follows:
# 只是注释掉了git下载和切换的内容。
set -o errexit
set -o verbose

# VERSION="v3.4.1"

# Build and install proto3.
# git clone https://github.com/google/protobuf.git
cd protobuf
# git checkout tags/${VERSION}
mkdir build
cd build
cmake -G Ninja \
  -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
  -DCMAKE_BUILD_TYPE=Release \
  -Dprotobuf_BUILD_TESTS=OFF \
  ../cmake
ninja
sudo ninja install

4. build and install.

# 用ninja工具进行catkin的编译
catkin_make_isolated --install --use-ninja

note:

  • Here, after executing the above steps, it is not an error, then the installation was successful.
  • Some of sprout new because of configuration issues git of error download fails, an error prompts Baidu, according to solve; do not want to toss git, you can also open the three direct source link to download .rosinstall the corresponding version of the source code (version marked content) .
    ***
  • git slow download speeds, basically because of DNS poisoning, where modify the hosts file:
sudo gedit /etc/hosts

Add the following (specifying github to dns server address):

# 建议在http://ip.tool.chinaz.com/github.com查询以下三个网址对应的ip,这里是2019-12月的数据,可能会改变
github.com  13.250.177.223
assets-cdn.github.com 185.199.108.153
github.global.ssl.fastly.net 75.126.215.88

Restart networking
sudo /etc/init.d/networking restart

Third, the mounting test run data set

1. The test data set

  • ROS is now installed and integrated Cartographer Cartographer, the bag can be encapsulated into packet form download data set. Here are a German museum data sets. This data set is a human carrying a laser radar recording , the effect is good.
  • First, download the data set, and then run the demo, will automatically open rviz.
# 这句命令把数据集下载到了Downloads文件夹,如果没有wget工具,可以自己安装
wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_2d/cartographer_paper_deutsches_museum.bag

# 记得先配置工作空间到环境变量
echo  "source ~/catkin_ws/install_isolated/setup.bash" >> ~/.bashrc

# 这句用roslaunch启动了放在对应目录的数据集
roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/Downloads/cartographer_paper_deutsches_museum.bag

Find a random drawing:
image

2. Other data collection bag


references:

  1. Official Manual https://google-cartographer-ros.readthedocs.io/en/latest/compilation.html

Guess you like

Origin www.cnblogs.com/futurelei/p/12118557.html