keywords
激光slam cartographer cartographer配置 cartographer安装 谷歌cartographer 谷歌cartographer配置 谷歌cartographer安装
文章结构,本博文提供了什么
谷歌给的安装方法需要换源至github才能顺利安装,一键安装方法。
提供两个文件,
一个是onekey_cartographer.sh
一个是onekey_install_cartographer.rosinstall
咋用
linux系统 ,先配置好k版本的ros和cartographer的依赖。自行百度一堆文章。
依赖项安装:
sudo apt-get install -y \
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
首先在home目录新建文件onekey_install_cartographer.rosinstall ,记下onekey_install_cartographer.rosinstall 文件的路径,一会儿要用。
onekey_install_cartographer.rosinstall 内容为:
- 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'}
备注:上面这个文件版本可能比较老,可以吧后面的版本替换为新版的cartographer和ceres-solve。
在home目录新建文件onekey_cartographer.sh内容为(记得修改这个文件中onekey_install_cartographer.rosinstall的路径):
sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build
mkdir rosws_cartographer
cd rosws_cartographer
wstool init src
wstool merge -t src /你放置onekey_install_cartographer.rosinstall的路径/onekey_install_cartographer.rosinstall
wstool update -t src
src/cartographer/scripts/install_proto3.sh
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
catkin_make_isolated --install --use-ninja
source install_isolated/setup.bash
home文件夹下打开终端,敲命令: bash onekey_cartographer.sh
等待编译成功,再按官网执行测试。