Gmapping 之安装与配置
1. 概述
Gmapping从配置到运行,希望能帮助大家,也给自己留一个笔记,以供复习参考。
2. 安装
首先需要安装一些必要文件
sudo apt-get install ros-kinetic-slam-gmapping
然后在工作空间中获取Gmapping的源代码
gitclone https://github.com/ros-perception/slam_gmapping.git
2.1 github仓库
因为Gmapping的部分源代码在ubuntu下不能显示,跳转比较繁琐,建议直接将两个
原始github仓库都拷贝到本地。
- 一个是调用封装好的函数实现Gmapping的代码,
slam_gmapping
- 一个是Gmapping内部结构的具体源代码。
openslam_gmapping
gitclone https://github.com/ros-perception/slam_gmapping.git
gitclone https://github.com/ros-perception/openslam_gmapping.git
3. 运行
准备好需要的数据集
,参考链接
- 启动roscore,注意source。
roscore
- 运行bag,注意发布的节点话题
rosbag play --clock intel.bag
- 启动slam_gmapping节点程序,注意激光接受的话题,设置使用仿真时间
rosparam set use_sim_time true
以及rosrun gmapping slam_gmapping
- 运行rviz添加发布的
占用栅格地图
以及激光信息
,使用map话题和scan话题rviz rviz
3.1 运行截图
3.2 重采样时的提示信息
3.3 tf树rosrun rqt_tf_tree rqt_tf_tree
3.4 所有的坐标变换信息rostopic echo /tf
---
transforms:
-
header:
seq: 0
stamp:
secs: 976053023
nsecs: 236317038
frame_id: "odom"
child_frame_id: "base_link"
transform:
translation:
x: -6.506
y: -9.177999
z: 0.0
rotation:
x: 0.0
y: 0.0
z: 0.962671818361
w: 0.270671332309
---
transforms:
-
header:
seq: 0
stamp:
secs: 976053023
nsecs: 305358859
frame_id: "map"
child_frame_id: "odom"
transform:
translation:
x: 1.74890050379
y: -15.3629985607
z: 0.0
rotation:
x: 0.0
y: 0.0
z: 0.826621469073
w: 0.562758337893
---
transforms:
-
header:
seq: 0
stamp:
secs: 976053023
nsecs: 355826990
frame_id: "map"
child_frame_id: "odom"
transform:
translation:
x: 1.74890050379
y: -15.3629985607
z: 0.0
rotation:
x: 0.0
y: 0.0
z: 0.826621469073
w: 0.562758337893
---
transforms:
-
header:
seq: 0
stamp:
secs: 976053023
nsecs: 326802015
frame_id: "base_link"
child_frame_id: "base_laser"
transform:
translation:
x: 0.1
y: 0.0
z: 0.2
rotation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0
---
transforms:
-
header:
seq: 0
stamp:
secs: 976053023
nsecs: 406291149
frame_id: "map"
child_frame_id: "odom"
transform:
translation:
x: 1.74890050379
y: -15.3629985607
z: 0.0
rotation:
x: 0.0
y: 0.0
z: 0.826621469073
w: 0.562758337893
---
3.5 建图结果
3.6 不生成地图的结果
4. 错误解决
4.1 tf树错误
错误代码
使用我已经转换好的数据运行,是没有问题的
.log .clf文件转化为 .bag文件 github
Dropped 100.00% of messages so far解决办法.
5. 其他
准备把自己添加注释的Gmapping发出来,现在已经差不多了,希望大家多多支持,多多关注!
6. 延伸阅读
传感器配置
设备绑定串口名称 Ubuntu
Xsens MTi传感器 ROS下配置
SBG Ellipse系列传感器Ubuntu下进行ROS节点配置
Nooploop UWB LinkTrack ROS下配置
MTI Ellipse VLP16 LinkTrack Topic msg整理
节点程序分析
Xsens ROS 节点 时间戳以及话题
Velodyne ROS 节点 时间戳以及话题
SBG ROS 节点 时间戳 话题
NoopLoop ROS 节点 时间戳以及话题
经典SLAM
Gmapping 之安装与配置
Hector SLAM 安装与配置
Gmapping 原理之目标分布与提议分布
LOAM SLAM安装与配置
Gmapping
Gmapping 之安装与配置
Gmapping Dropped 100.00% of messages so far 解决办法
Gmapping 原理之目标分布与提议分布
Gmapping 原理之源代码框架