cartographer 安裝和解析 基于 ubuntu16.04 环境下

cartographer 安裝 ubuntu16.04 环境下

  • 1、安装wstool rosdep ninja和下載運行包
  • 2、下面进行安装proto3
  • 3、安裝proto3完毕后,进行rosdep 和ninja
  • 4、测试是否安装成功

1、安装wstool rosdep ninja和下載運行包

$ sudo apt-get update
//-y 假定对所有的询问选是,不提示
$ sudo apt-get install -y python-wstool python-rosdep ninja-build
$ mkdir catkin_ws
$ cd catkin_ws
$ wstool init src
$ wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall
$ wstool update -t src

注意,由於默認的ceres-solver下載路徑無效,可以在執行wstool update -t src時先執行命令

$ cd catkin_ws/src/
$ sudo gedit .rosinstall

将最后一个git来源网址由https://ceres-solver.googlesource.com/ceres-solver.git改为https://github.com/ceres-solver/ceres-solver.git/
接着執行

$ wstool update -t src

2、下面进行安装proto3

ros安裝會自動Protobuf 低版本proto2,如果不執行以上安裝proto3,情況下執行下面執行catkin_make_isolated --install --use-ninja時候出現錯誤:
cartographer/mapping/proto/submap.proto:15:10: Unrecognized syntax identifier “proto3”. This parser only recognizes “proto2”.
說明ros自帶的proto2已經安裝不能進行編譯paper,需要安装proto3

1、下載proto3安裝包和編譯

//src/cartographer/scripts/是指安装的地址,避免与系统已安装的版本地址冲突
$ src/cartographer/scripts/install_proto3.sh               

3、安裝proto3完毕后,进行rosdep 和ninja

ROS_DISTRO是表明ros版本的变量,根据ros官网指南设置环境变量:

$ echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
$ source ~/.bashrc

如果 sudo gedit .bashrc 中已经包含source /opt/ros/kinetic/setup.bash,则可忽略这上面两步,执行下面两步

$ rosdep update
$ rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y

漫长安装后,正确会出现:
#All required rosdeps installed successfully
注:rosdep工具就是用来检查包的丢失依赖项,并且完成下载和安装

 // Build and install.
$ catkin_make_isolated --install --use-ninja
$ source install_isolated/setup.bash

4、测试是否安装成功

// Download the 2D backpack example bag.
$ wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_2d/cartographer_paper_deutsches_museum.bag
 
// Launch the 2D backpack demo.
$ roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/Downloads/cartographer_paper_deutsches_museum.bag
 
// Download the 3D backpack example bag.
$ wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_3d/with_intensities/b3-2016-04-05-14-14-00.bag
 
// Launch the 3D backpack demo.
$ roslaunch cartographer_ros demo_backpack_3d.launch bag_filename:=${HOME}/Downloads/b3-2016-04-05-14-14-00.bag

注意:{HOME}/Downloads/cartographer_paper_deutsches_museum.bag中的{HOME}不需要改變,只需要修改/Downloads/的路徑

cartographer 安裝和解析 基于 ubuntu16.04 环境下_第1张图片参考链接::https://blog.csdn.net/rjasd1128hf/article/details/79888305

你可能感兴趣的:(slam)