<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[谷歌cartographer使用速腾聚创3d激光雷达转二维数据进行2d建图]]></title><description><![CDATA[<p dir="auto">谷歌cartographer_ros请参考<a href="http://community.bwbot.org/topic/136/google%E6%BF%80%E5%85%89%E9%9B%B7%E8%BE%BEslam%E7%AE%97%E6%B3%95cartographer%E7%9A%84%E5%AE%89%E8%A3%85%E5%8F%8Abag%E5%8C%85demo%E6%B5%8B%E8%AF%95">这篇安装教程</a>：http://community.bwbot.org/topic/136/google激光雷达slam算法cartographer的安装及bag包demo测试</p>
<h3>1. 数据包准备</h3>
<p dir="auto">本文建图将采用普通的2d 雷达数据，结合IMU和里程计数据进行2d建图。2d 雷达数据由速腾聚创3d激光雷达转换得到，其他数据由小强机器人底盘得到。<br />
rosbag数据包的详细制作过程，请参考<a href="https://community.bwbot.org/topic/522/%E4%BD%BF%E7%94%A8rosbag%E5%BD%95%E5%88%B6%E5%92%8C%E5%9B%9E%E6%94%BE3d%E6%BF%80%E5%85%89%E9%9B%B7%E8%BE%BE%E6%95%B0%E6%8D%AE%E5%92%8C%E5%B0%8F%E5%BC%BAros%E5%BC%80%E5%8F%91%E5%B9%B3%E5%8F%B0%E7%9A%84%E9%87%8C%E7%A8%8B%E8%AE%A1imu%E6%95%B0%E6%8D%AE" target="_blank" rel="noopener noreferrer">这篇教程</a>: https://community.bwbot.org/topic/522/使用rosbag录制和回放3d激光雷达数据和小强ros开发平台的里程计imu数据<br />
下文教程将以蓝鲸机器人录制的bag包为例，演示如何建立2d地图。<a href="https://pan.baidu.com/s/1rBWFRS90lB9_3_OTLUaCxA" target="_blank" rel="noopener noreferrer">bag包百度云下载地址</a></p>
<h3>2. 配置cartographer_ros</h3>
<p dir="auto">蓝鲸机器人github上的cartographer_ros已经配置好了所有文件，对于加装速腾聚创小强xq5开发平台采集的数据包，cartographer_ros需要使用的是下列文件，简略的说明在下文。cartographer_ros的详细文档可以参考<a href="https://google-cartographer-ros.readthedocs.io/en/latest/" target="_blank" rel="noopener noreferrer">官方wiki</a></p>
<pre><code>cartographer_ros/launch/demo_xiaoqiang_rslidar_scan.launch #建图时启动的launch文件，负责启动rviz，加载cartographer_ros主要的启动节点和参数文件，话题数据名字的remap也在这个文件设定。

cartographer_ros/urdf/rslidar_2d.urd #模型文件，用来发布3d激光雷达、小车里程计、IMU、小车本体之间的tf关系

cartographer_ros/configuration_files/xiaoqiang_rslidar_scan.lua #cartographer_ros算法参数配置文件，优化建图效果需要调整的参数就是这个文件。
</code></pre>
<p dir="auto">ros中坐标系的设置，请参考<a href="https://community.bwbot.org/topic/227/ros%E5%9D%90%E6%A0%87%E7%B3%BB%E7%BB%9F-%E5%B8%B8%E8%A7%81%E7%9A%84%E5%9D%90%E6%A0%87%E7%B3%BB%E5%92%8C%E5%85%B6%E5%90%AB%E4%B9%89" target="_blank" rel="noopener noreferrer">这篇教程</a>，小强xq5平台的base_link原点设置在两个主动轮轴中间位置。</p>
<pre><code># cartographer_ros/configuration_files/xiaoqiang_rslidar_scan.lua文件里面设置是否使用imu、odom数据的参数是这两个：
use_odometry = true  #true使能里程计，false禁用里程计
TRAJECTORY_BUILDER_2D.use_imu_data = false  #true使能IMU，false禁用IMU
</code></pre>
<pre><code># cartographer_ros)/urdf/rslidar_2d.urd文件需要调整的参数是3d雷达相对base_link的安装位置，laserbase_link等价于base_link
&lt;joint name="horizontal_laser_link_joint" type="fixed"&gt;
    &lt;parent link="laserbase_link" /&gt;
    &lt;child link="rslidar" /&gt;
    &lt;origin xyz="0 0 0.4" rpy="0 0 0" /&gt;
  &lt;/joint&gt;
</code></pre>
<h3>3. 启动cartographer_ros，播放rosbag数据包，开始建图</h3>
<pre><code>#先关闭小车的ros启动节点
#在小车主机上新开一个命令终端
sudo service startup stop
roscore
</code></pre>
<pre><code>#启动cartographer
#在小车主机上新开一个命令终端
roslaunch cartographer_ros demo_xiaoqiang_rslidar_scan.launch 
</code></pre>
<pre><code>#播放bag数据
#在小车主机上新开一个命令终端
rosbag play  --clock  2018-08-11-13-20-34.bag
</code></pre>
<p dir="auto"><img src="/assets/uploads/files/1534137390919-scan_1-resized.png" alt="0_1534137389985_scan_1.png" class=" img-responsive img-markdown" /><br />
<img src="/assets/uploads/files/1534137403516-screenshot-from-2018-08-13-13-14-09-resized.png" alt="0_1534137402544_Screenshot from 2018-08-13 13-14-09.png" class=" img-responsive img-markdown" /><br />
<img src="/assets/uploads/files/1534137414348-screenshot-from-2018-08-13-13-16-04-resized.png" alt="0_1534137413409_Screenshot from 2018-08-13 13-16-04.png" class=" img-responsive img-markdown" /><br />
<img src="/assets/uploads/files/1534137442753-screenshot-from-2018-08-11-20-08-13-resized.png" alt="0_1534137441815_Screenshot from 2018-08-11 20-08-13.png" class=" img-responsive img-markdown" /></p>
<h3>4. bag播放完成后，用map_server保存地图</h3>
<pre><code>rosrun map_server map_saver --occ 51 --free 49 -f work0
</code></pre>
<p dir="auto">保存成功后，会在home目录里面生成work0.yaml work0.pgm两个地图文件，这两个文件可以用来amcl导航。</p>
]]></description><link>http://community.bwbot.org/topic/525/谷歌cartographer使用速腾聚创3d激光雷达转二维数据进行2d建图</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Jul 2026 04:56:47 GMT</lastBuildDate><atom:link href="http://community.bwbot.org/topic/525.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 13 Aug 2018 05:17:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 谷歌cartographer使用速腾聚创3d激光雷达转二维数据进行2d建图 on Mon, 13 May 2019 04:19:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.bwbot.org/uid/876">@zhaoyu24</a> 雷达数据所在frame到tracking frame之间的tf必须提供</p>
]]></description><link>http://community.bwbot.org/post/1253</link><guid isPermaLink="true">http://community.bwbot.org/post/1253</guid><dc:creator><![CDATA[xiaoqiang]]></dc:creator><pubDate>Mon, 13 May 2019 04:19:33 GMT</pubDate></item><item><title><![CDATA[Reply to 谷歌cartographer使用速腾聚创3d激光雷达转二维数据进行2d建图 on Thu, 09 May 2019 15:36:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.bwbot.org/uid/20">@xiaoqiang</a> 只使用雷达数据的话，tf的关系还需要修改吗？</p>
]]></description><link>http://community.bwbot.org/post/1244</link><guid isPermaLink="true">http://community.bwbot.org/post/1244</guid><dc:creator><![CDATA[zhaoyu24]]></dc:creator><pubDate>Thu, 09 May 2019 15:36:29 GMT</pubDate></item><item><title><![CDATA[Reply to 谷歌cartographer使用速腾聚创3d激光雷达转二维数据进行2d建图 on Mon, 21 Jan 2019 11:27:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.bwbot.org/uid/793">@Duke-Allen</a></p>
<pre><code># cartographer_ros/configuration_files/xiaoqiang_rslidar_scan.lua文件里面设置是否使用imu、odom数据的参数是这两个：
use_odometry = true  #true使能里程计，false禁用里程计
TRAJECTORY_BUILDER_2D.use_imu_data = false  #true使能IMU，false禁用IMU
</code></pre>
]]></description><link>http://community.bwbot.org/post/1092</link><guid isPermaLink="true">http://community.bwbot.org/post/1092</guid><dc:creator><![CDATA[xiaoqiang]]></dc:creator><pubDate>Mon, 21 Jan 2019 11:27:57 GMT</pubDate></item><item><title><![CDATA[Reply to 谷歌cartographer使用速腾聚创3d激光雷达转二维数据进行2d建图 on Mon, 14 Jan 2019 05:07:03 GMT]]></title><description><![CDATA[<p dir="auto">@xiaoqiang您好，请问如果只用雷达数据来进行2D建图的话，cartographer_ros应该怎么配置呢？</p>
]]></description><link>http://community.bwbot.org/post/1070</link><guid isPermaLink="true">http://community.bwbot.org/post/1070</guid><dc:creator><![CDATA[Duke-Allen]]></dc:creator><pubDate>Mon, 14 Jan 2019 05:07:03 GMT</pubDate></item></channel></rss>