Ubuntu 16.04 下安装Cartographer protof版本问题

参考:Cartographer官方安装文档

我的Ubuntu 是16.04版本的,ROS版本为Kinetic (安装文档同时也支持indigo版本)


  1. #首先安装编译工具,并且更新源
    sudo apt-get update
    sudo apt-get install -y python-wstool python-rosdep ninja-build
    
    
    #创建工作空间
    mkdir catkin_ws
    cd catkin_ws
    wstool init src
    
    # Merge the cartographer_ros.rosinstall file and fetch code for dependencie
    #在这里通过在catkin环境下生成一个.rosinstall文件,一般文件隐藏,看不到,可以 CTRL+H看到
    #同时在这里需要使用goole的包,最好可以FC去下载,不能翻墙也可以看到一些国内在github上的包
    wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall
    wstool update -t src
    
    # Install proto3.
    src/cartographer/scripts/install_proto3.sh
    
    # Install deb dependencies.
    # The command 'sudo rosdep init' will print an error if you have already
    # executed it since installing ROS. This error can be ignored.
    sudo rosdep init
    rosdep update
    rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
    
    # Build and install.
    catkin_make_isolated --install --use-ninja
    source install_isolated/setup.bash

    以上为官方提供的安装方法,但是本人在实际的编译中一直遇到关于protof的问题,自己也换了好多的方法,参考官方的文档也无法解决,自己最后通过重新手动安装protof 3.6.1最后重新进行编译才得以通过.(在这个时候,protof 3.6.1是最新的版本,我使用3.4.0官方提供的版本编译无法通过)

  2. protof 3.6.1安装如下

下载链接 https://github.com/google/protobuf/releases

官方安装手册:https://github.com/protocolbuffers/protobuf/blob/master/src/README.md

安装:(下载安装all版本)

tar zxvf protobuf-all-3.6.0.tar.gz

cd protobuf-3.6.0/ 
./configure –prefix=/usr/local/        (安装路径,一般情况下,默认会安装到/usr/include 文件下,我们需要指定安装到,/usr/local/include文件下,安装完成会有一个goole文件在/usr/local/include 下) 
make 
make check 
make install 
protoc –version               #查看版本
 
  • 在完成新版本的protof时,就可以删掉原来编译生成的文件,重新进行编译,即可通过.
  • 可以通过使用官方提供的bag文件进行测试,测试步骤如下:
# 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
  • 通过测试,可以使用bag文件绘制出来比较完整的地图
  • 测试结果如下

 

文章可能存在一些问题,有问题可以留言讨论,大家一同学习,邮箱:wenchenwan@outlook.com

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值