一、Cartographer简介

  Cartographer是google开源的通用2D和3D定位与地图同步构建的SLAM工具,并提供ROS接口。官网地址:https://github.com/googlecartographer

二、安装方法

1、安装全部依赖项

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

2、安装ceres solver,下载安装在主目录下,由于googlesource.com需要FQ,这里使用hitcm(张明明)的github地址

# Build and install Ceres.
# git clone https://ceres-solver.googlesource.com/ceres-solver
# cd ceres-solver
git clone https://github.com/hitcm/ceres-solver-1.11.0.git
cd ceres-solver-1.11.
mkdir build
cd build
cmake .. -G Ninja
ninja
ninja test
sudo ninja install

3、安装cartographer,下载安装在主目录下,这里同样使用的是hitcm(张明明)的github地址

# Build and install Cartographer.
git clone https://github.com/hitcm/cartographer.git
cd cartographer
mkdir build
cd build
cmake .. -G Ninja
ninja
ninja test
sudo ninja install

4、安装cartographer_ros,这里使用的是hitcm(张明明)的github地址,由于google官方的教程需要FQ下载一些文件,因此容易失败,经验证hitcm(张明明)对原文件进行了少许修改后可以成功安装,在他的修改中核心代码不变,只修改了编译文件。

# 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
# 下载到catkin_ws下面的src文件夹下面
cd src
git clone https://github.com/hitcm/cartographer_ros.git
# 然后到catkin_ws下面运行catkin_make安装 (会失败,所以根据提示改变命令)
cd
cd catkin_ws
catkin_make
source ./devel/setup.zsh

5、改变命令进行编译

catkin_make_isolated --install --use-ninja

6、修改cartographer_ros--cartographer_ros--launch--demo_revo_lds.launch

    <launch>  

      <param name="/use_sim_time" value="true" />
<node name="cartographer_node" pkg="cartographer_ros"
type="cartographer_node" args="
-configuration_directory $(find cartographer_ros)/configuration_files
-configuration_basename revo_lds.lua"
output="screen">
<remap from="scan" to="scan" />
</node>
<node name="rviz" pkg="rviz" type="rviz" required="true"
args="-d $(find cartographer_ros)/configuration_files/demo_2d.rviz" />
</launch>

  修改cartographer_ros--cartographer_ros--configuration_files--revo_lds.lua

options = {

  map_builder = MAP_BUILDER,

  sensor_bridge = {

    horizontal_laser_min_range = 0.3,

    horizontal_laser_max_range = ,

    horizontal_laser_missing_echo_ray_length = 1.2,

    constant_odometry_translational_variance = .,

    constant_odometry_rotational_variance = .,

  },

  map_frame = "map",

  tracking_frame = "laser",

  published_frame = "laser",

  odom_frame = "odom",

  provide_odom_frame = true,

  use_odometry_data = false,

  use_constant_odometry_variance = true,

  constant_odometry_translational_variance = 1e-,

  constant_odometry_rotational_variance = 1e-,

  use_horizontal_laser = true,

  use_horizontal_multi_echo_laser = false,

  horizontal_laser_min_range = 0.1,

  horizontal_laser_max_range = .,

  horizontal_laser_missing_echo_ray_length = .,

  num_lasers_3d = ,

  lookup_transform_timeout_sec = 0.2,

  submap_publish_period_sec = 0.3,

  pose_publish_period_sec = 5e-,

}

MAP_BUILDER.use_trajectory_builder_2d = true

TRAJECTORY_BUILDER_2D.use_imu_data = false

TRAJECTORY_BUILDER_2D.use_online_correlative_scan_matching = true

SPARSE_POSE_GRAPH.optimization_problem.huber_scale = 1e2

return options

  修改完以上2个文件重新编译一下,命令行输入

catkin_make_isolated --install --use-ninja

7、运行

  最后命令行中运行rplidar的Node和launch文件

roslaunch rplidar_ros rplidar.launch
roslaunch cartographer_ros demo_revo_lds.launch

Rplidar学习(五)—— rplidar使用cartographer_ros进行地图云生成的更多相关文章

  1. JavaWeb和WebGIS学习笔记(五)——使用OpenLayers显示地图

    系列链接: Java web与web gis学习笔记(一)--Tomcat环境搭建 Java web与web gis学习笔记(二)--百度地图API调用 JavaWeb和WebGIS学习笔记(三)-- ...

  2. 【百度地图API】建立全国银行位置查询系统(五)——如何更改百度地图的信息窗口内容?

    原文:[百度地图API]建立全国银行位置查询系统(五)--如何更改百度地图的信息窗口内容? 摘要: 酷讯.搜房.去哪儿网等大型房产.旅游酒店网站,用的是百度的数据库,却显示了自定义的信息窗口内容,这是 ...

  3. TweenMax动画库学习(五)

    目录            TweenMax动画库学习(一)            TweenMax动画库学习(二)            TweenMax动画库学习(三)            Tw ...

  4. SVG 学习<五> SVG动画

    目录 SVG 学习<一>基础图形及线段 SVG 学习<二>进阶 SVG世界,视野,视窗 stroke属性 svg分组 SVG 学习<三>渐变 SVG 学习<四 ...

  5. Android JNI学习(五)——Demo演示

    本系列文章如下: Android JNI(一)——NDK与JNI基础 Android JNI学习(二)——实战JNI之“hello world” Android JNI学习(三)——Java与Nati ...

  6. ZigBee学习五 无线温度检测

    ZigBee学习五 无线温度检测 1)修改公用头文件GenericApp.h typedef union h{ uint8 TEMP[4]; struct RFRXBUF { unsigned cha ...

  7. (转)MyBatis框架的学习(五)——一对一关联映射和一对多关联映射

    http://blog.csdn.net/yerenyuan_pku/article/details/71894172 在实际开发中我们不可能只是对单表进行操作,必然要操作多表,本文就来讲解多表操作中 ...

  8. cesium 学习(五) 加载场景模型

    cesium 学习(五) 加载场景模型 一.前言 现在开始实际的看看效果,目前我所接触到基本上都是使用Cesium加载模型这个内容,以及在模型上进行操作.So,现在进行一些加载模型的学习,数据的话可以 ...

  9. Python基础学习五

    Python基础学习五 迭代 for x in 变量: 其中变量可以是字符串.列表.字典.集合. 当迭代字典时,通过字典的内置函数value()可以迭代出值:通过字典的内置函数items()可以迭代出 ...

随机推荐

  1. hdu 1217 汇率 Floyd

    题意:给几个国家,然后给这些国家之间的汇率.判断能否通过这些汇率差进行套利交易. Floyd的算法可以求出任意两点间的最短路径,最后比较本国与本国的汇率差,如果大于1,则可以.否则不可以. 有向图 一 ...

  2. ElasticSearch - query vs filter

    query vs filter 来自stackoverflow Stackoverflow - queries-vs-filters Question 题主希望知道Query和Filter的区别 An ...

  3. 【BZOJ3626】[LNOI2014]LCA

    题解: 数据结构套路真多.. 思考了一下线段树分治和启发式合并发现复杂度并不怎么对.. 看了题解发现都是套路啊 考虑一下lca(x,y)的dep有什么性质 我们把1-x的路径+1,查询1-y的路径和 ...

  4. 百度未授权使用地图API

    百度地图管理员的回复:这是KEY服务升级的问题, 给您造成的不便,非常抱歉.但我们昨日已修复,你可以再审核一番.若不可以,请提供一下您的系统ak,邮箱或qq发送至(wangwenhai@baidu.c ...

  5. drupal8

    创建drupal的博客教程地址 区域:主题中必须定义 content 区域:因为内容(文章列表)就在content区域 定义成区块的时候可以将试图的区块放在内容区域里面: 视图通过区块和页面来显示在页 ...

  6. 移动端、PC端(前后台)、小程序常用的UI框架

    1.移动端UI库 ①.Vant UI 官方地址:https://youzan.github.io/vant/#/zh-CN/intro github地址:https://github.com/youz ...

  7. spring整合mybatisXML版

    引用的所有jar包,本demo是一个普通的java项目测试的: aopalliance.jarasm-3.3.1.jaraspectjweaver.jarcglib-2.2.2.jarcommons- ...

  8. 洛谷.1333.瑞瑞的木棍(欧拉路径 Hash)

    题目链接 #include <cstdio> #include <cstring> const int N=2e6+5,M=5e5+5,mod=2e6; const int s ...

  9. BZOJ.2118.墨墨的等式(思路 最短路Dijkstra 按余数分类)

    题目链接 题意可以看做,用\(a_1,a_2,...,a_n\),能组成多少个\([L,R]\)中的数. (40分就是个完全背包) 首先如果\(k*a_i+x\)可以组成,那么\((k+1)*a_i+ ...

  10. [HDU4906]Our happy ending

    [HDU4906]Our happy ending 题目大意: 让你构造一个\(n(n\le20)\)个数的数列,其中每个数都为小于等于\(l(l\le10^9)\)的非负整数. 问你能构造出多少个这 ...