当前位置:   article > 正文

cartographer简单快速安装和配置_cartographer安装

cartographer安装


安装之前说明,本方案主要参考cartographer自带sh文件安装,在路径cartographer/scripts/下。每个依赖都有对应的版本,和安装依赖顺序,博主参考他人的方案一直出现问题,归咎于对以来的版本没有把握准确。包括包所有功能包,依赖包。

1、cartographer 下载

1.1创建工作空间,并下载到/catkin_ws/src下

mkdir -p /catkin_ws/src
  • 1

注意下载版本,文件后缀有标注
在这里插入图片描述
1.2 下载地址,这版本不会出现依赖版本问题

  git clone -b 0.3.0 https://github.com/googlecartographer/cartographer_ros.git
  git clone  -b 0.3.0 https://github.com/googlecartographer/cartographer.git
  git clone  -b 1.13.0 https://github.com/ceres-solver/ceres-solver.git 
  • 1
  • 2
  • 3

cartographer包CSDN链接,三个包.(ceres cartographer cartographer_ros )
后续补充。。。。。

2、进行rosdep

$ rosdep update
  • 1

将下载的文件移动到src文件夹下,并在catkin_ws文件路径下运行以下指令

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

rosdep update运行出错的简单解决方法 :https://blog.csdn.net/weixin_44023934/article/details/121242176
安装后,正确会出现:
#All required rosdeps installed successfully
注:rosdep工具就是用来检查包的丢失依赖项,并且完成下载和安装

3、cartographer 安装

安装cartographer系统依赖

官方说明路径:cartographer-0.3.0/scripts/install_debs.sh

sudo apt-get update
sudo apt-get install -y \
    cmake \
    g++ \
    git \
    google-mock \
    libboost-all-dev \
    libcairo2-dev \
    libeigen3-dev \
    libgflags-dev \
    libgoogle-glog-dev \
    liblua5.2-dev \
    libsuitesparse-dev \
    ninja-build \
    python-sphinx
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

安装依赖protobuf

官方说明在:cartographer-0.3.0/scripts/install_proto3.sh

#VERSION="v3.4.1"
# Build and install proto3.
git clone -b v3.4.1 https://github.com/google/protobuf.git
cd protobuf-3.4.1
git checkout 
mkdir build
cd build
cmake -G Ninja \
  -DCMAKE_BUILD_TYPE=Release \
  -Dprotobuf_BUILD_TESTS=OFF \
  ../cmake
ninja
sudo ninja install
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

开始编译

 // Build and install.

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

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

4、测试是否安装成功

4.1、使用自己数据建图

使用自己数据建图方法

4.2、使用官方数据建图

// Download the 2D backpack example bag.

$ wget -P ~/Downloads https://storage.googleapis.com/cartographer-public-data/bags/backpack_2d/cartographer_paper_deutsches_museum.bag
  • 1

// Launch the 2D backpack demo.

$ roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=${HOME}/Downloads/cartographer_paper_deutsches_museum.bag
  • 1

// 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
  • 1

// Launch the 3D backpack demo.

$ roslaunch cartographer_ros demo_backpack_3d.launch bag_filename:=${HOME}/Downloads/b3-2016-04-05-14-14-00.bag
  • 1

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

图片:参考链接::https://blog.csdn.net/rjasd1128hf/article/details/79888305

另一个方案:安装ros自带cartographer

参考:https://blog.csdn.net/suyunzzz/article/details/96122316
在这里插入图片描述

https://google-cartographer.readthedocs.io/en/latest/

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/485776
推荐阅读
  

闽ICP备14008679号