系统配置:
ubuntu16.04 ROS Kinetic
首先,安装protobuf3 手动安装
sudo apt-get install autoconf autogen
创建新的工作空间:‘catkin_ws’.
mkdir catkin_ws
git clone https://github.com/protocolbuffers/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
./configure
make -j8
这一步可能会报错,无视就好
make check
sudo make install
sudo ldconfig # refresh shared library cache.
检查一下安装后protobuf的版本
protoc --version
libprotoc 3.11.4
添加一个环境变量来确保链接到正确的prtobuf版本
which protoc
/usr/local/bin/protoc
export PROTOBUF_PROTOC_EXECUTABLE=/usr/local/bin/protoc
其次,安装 cartographer
配置过程:
安装 wstool and rosdep.
sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build
cd catkin_ws
wstool init src
合并cartographer_ros.rosinstall文件并或者代码的依赖
wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall
在catkin_ws/src 文件夹下按ctrl+h显示隐藏文件夹,打开.rosinstall文件,将关于ceres-solver的链接改成github上的链接。即改为如下形式:
- git:
local-name: ceres-solver
uri: https://github.com/ceres-solver/ceres-solver.git
version: 1.13.0
#下载rosinstall文件中的内容
wstool update -t src
安装依赖
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
安装
catkin_make_isolated --install –use-ninja
错误1、proto的版本不对,Ubuntu之前的是proto2,这个要求是proto3
命令: which protoc查看你安装的位置
用:protoc --version,看看有没有,如果有会显示版本
同时安装了proto2,优先找了/usr/bin/protoc的版本, 新安装的proto3放在/usr/local/bin/protoc下,建立一个软连接。
source install_isolated/setup.bash
**
参考
**
https://blog.youkuaiyun.com/seeseeatre/article/details/84863485#commentBox
https://blog.youkuaiyun.com/u014709760/article/details/87968615
本文详细介绍了在Ubuntu16.04系统中,如何从源码安装protobuf3,并通过catkin工作空间安装Cartographer ROS的过程。包括解决版本冲突、环境变量配置及依赖安装等关键步骤。
6684

被折叠的 条评论
为什么被折叠?



