Cartographer on Ubuntu16.04 + Kinetic + 2D

目录

Cartographer on Ubuntu16.04 + Kinetic + 2D

1. INSTALL

1.1  dependencies

1.2  ceres-solver

1.3  cartographer

1.4  proto3

1.5 abseil

1.6  cartographer-ros

2.  MAPPING

3.  SAVE MAP

3.1  mapping done

3.2  save map data as pbstream flle

 3.3  change map data to pgm file


1. INSTALL

1.1  dependencies

sudo apt-get install -y google-mock libboost-all-dev  libeigen3-dev libgflags-dev libgoogle-glog-dev liblua5.2-dev libprotobuf-dev  libsuitesparse-dev libwebp-dev ninja-build protobuf-compiler python-sphinx  ros-kinetic-tf2-eigen libatlas-base-dev libsuitesparse-dev liblapack-dev

1.2  ceres-solver

git clone https://github.com/hitcm/ceres-solver-1.11.0.git
cd ceres-solver-1.11.0
mkdir build
cd build
cmake ..
make -j4
sudo make install

1.3  cartographer

git clone https://github.com/cartographer-project/cartographer.git
cd cartographer
mkdir build
cd build
cmake .. -G Ninja
ninja
ninja test
sudo ninja install

1.4  proto3

/home/lzh/Downloads/cartographer/scripts/install_proto3.sh

1.5 abseil

/home/lzh/Downloads/cartographer/scripts/install_abseil.sh

1.6  cartographer-ros

cd catkin_ws/src
git clone https://github.com/hitcm/cartographer_ros.git
cd ..
catkin_make

2.  MAPPING

cartographer_paper_deutsches_museum.bag

roslaunch cartographer_ros demo_backpack_2d.launch bag_filename:=/home/lzh/Downloads/cartographer_paper_deutsches_museum.bag

3.  SAVE MAP

3.1  mapping done

cd catkin_ws
source devel/setup.bash
rosservice call /finish_trajectory "trajectory_id: 0"

then the terminal show

status:
  code: 0
  message: "Finished trajectory 0."

3.2  save map data as pbstream flle

rosservice call /write_state "filename: '/home/lzh/carto_ws/map/map0.pbstream'
include_unfinished_submaps: true"

then the terminal show

status:
  code: 0
  message: "State written to '/home/yx/carto_ws/map/map0.pbstream'."

 3.3  change map data to pgm file

rosrun cartographer_ros cartographer_pbstream_to_ros_map -map_filestem=/home/lzh/carto_ws/map/map1 -pbstream_filename=/home/lzh/carto_ws/map/map0.pbstream -resolution=0.02 

then the terminal show

I0220 18:39:45.450656 15055 pbstream_to_ros_map_main.cc:43] Loading submap slices from serialized data.
I0220 18:40:01.743477 15055 pbstream_to_ros_map_main.cc:51] Generating combined map image from submap slices.


 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Ubuntu 16.04是一种流行的Linux操作系统,Cartographer是一种用于建图与定位的库,可以用于多种机器人平台。以下是在Ubuntu 16.04上安装Cartographer库的步骤: 1. 首先,打开终端,更新软件包列表和依赖项。使用以下命令: ``` sudo apt-get update sudo apt-get upgrade ``` 2. 安装必要的依赖项。执行以下命令来安装这些依赖项: ``` sudo apt-get install git cmake protobuf-compiler libprotobuf-dev libeigen3-dev \ python-catkin-tools python-rosdep python-wstool ros-kinetic-navigation ``` 3. 创建一个catkin工作空间来构建Cartographer。执行以下命令创建工作空间: ``` mkdir -p ~/catkin_ws/src cd ~/catkin_ws/src ``` 4. 克隆Cartographer仓库。执行以下命令克隆Cartographer仓库: ``` git clone https://github.com/cartographer-project/cartographer.git ``` 5. 更新子仓库。进入Cartographer目录,并执行以下命令来更新子仓库: ``` cd cartographer git submodule update --init --recursive ``` 6. 安装依赖项。返回到`~/catkin_ws`目录,并执行以下命令来安装依赖项: ``` cd ~/catkin_ws rosdep update rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y ``` 7. 构建并安装Cartographer。执行以下命令来构建并安装Cartographer: ``` catkin_make_isolated --install --use-ninja ``` 8. 添加环境变量。打开`~/.bashrc`文件,将以下内容添加到文件末尾: ``` source ~/catkin_ws/devel_isolated/setup.bash ``` 9. 更新环境变量。执行以下命令以更新环境变量: ``` source ~/.bashrc ``` 现在,Cartographer库已成功安装在Ubuntu 16.04上。您可以在其他项目中使用Cartographer来进行建图与定位。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值