cartographer

按官网教程安装
https://google-cartographer-ros.readthedocs.io/en/latest/

# Install wstool and rosdep.
sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build

# Create a new workspace in 'catkin_ws'.
mkdir catkin_ws
cd catkin_ws
wstool init src

# Merge the cartographer_ros.rosinstall file and fetch code for dependencies.
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

catkin_make_isolated --install --use-ninja

运行时无法下载ceres-solver无法下载时,修改src下的.rosinstall文件如下:

# THIS IS AN AUTOGENERATED FILE, LAST GENERATED USING wstool ON 2019-06-03
  2 - git:
  3     local-name: cartographer
  4     uri: https://github.com/googlecartographer/cartographer.git
  5     version: 1.0.0
  6 - git:
  7     local-name: cartographer_ros
  8     uri: https://github.com/googlecartographer/cartographer_ros.git
  9     version: 1.0.0
 10 - git:
 11     local-name: ceres-solver
 12     uri: https://github.com/ceres-solver/ceres-solver.git                   
 13     version: 1.13.0

保存地图时,下载map-server

git clone https://github.com/HaoQChen/map_server.git

保存地图时;

rosrun map_server map_saver [-f mapname]

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

 

保存地图时,还可以使用

  • 官方方法保存地图

步骤:

  • 完成轨迹, 不接受进一步的数据。
rosservice call /finish_trajectory 0
  • 序列化保存其当前状态
rosservice call /write_state "{filename: '${HOME}/Downloads/mymap.pbstream'}"
  • 将pbstream转换为pgm和yaml
rosrun cartographer_ros cartographer_pbstream_to_ros_map -map_filestem=${HOME}/Downloads/mymap -pbstream_filename=${HOME}/Downloads/mymap.pbstream -resolution=0.05
  • 生成对应的pgm和yaml,放于${HOME}/Downloads/mymap目录下
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值