< >
Home » ROS与SLAM入门教程 » ROS与SLAM入门教程-多线雷达(rs-lidar-16)cartographer 2D建图

ROS与SLAM入门教程-多线雷达(rs-lidar-16)cartographer 2D建图

ROS与SLAM入门教程-多线雷达(rs-lidar-16)cartographer 2D建图

说明:

  • 介绍如何通过多线雷达来实现cartographer 2D建图
  • 测试平台:turbot-DL + 多线雷达rslidar-16

准备:

  • 源码安装cartographer_turtlebot,请参考:https://www.ncnynl.com/archives/201801/2230.html

  • 设置rs-lidar-16雷达,请参考:https://www.ncnynl.com/archives/201807/2552.html

  • 配置激光雷达3D点云数据转换为2D激光数据,参考:https://www.ncnynl.com/archives/201807/2554.html

  • 新建turtlebot_rslidar_2d.launch

roscd cartographer_turtlebot/luanch
vim turtlebot_rslidar_2d.launch 
  • 内容如下:
<launch>

  <include file="$(find cartographer_turtlebot)/launch/turtlebot.launch">
    <arg name="configuration_basename" value="turtlebot_urg_lidar_2d.lua" />
  </include>
</launch>
  • 新建turtlebot_rslidar.launch
roscd pointcloud_to_laserscan/luanch
vim turtlebot_rslidar.launch 
  • 内容如下:
<?xml version="1.0"?>
<launch>

    <!-- run pointcloud_to_laserscan node -->
    <node pkg="pointcloud_to_laserscan" type="pointcloud_to_laserscan_node" name="pointcloud_to_laserscan">

        <remap from="cloud_in" to="/rslidar_points"/>
        <remap from="scan" to="/scan"/>
        <rosparam>
            # target_frame: rslidar # Leave disabled to output scan in pointcloud frame
            transform_tolerance: 0.01
            min_height: -0.4
            max_height: 1.0

            angle_min: -3.1415926 # -M_PI
            angle_max: 3.1415926 # M_PI
            angle_increment: 0.003 # 0.17degree
            scan_time: 0.1
            range_min: 0.2
            range_max: 100
            use_inf: true
            inf_epsilon: 1.0

            # Concurrency level, affects number of pointclouds queued for processing and number of threads used
            # 0 : Detect number of cores
            # 1 : Single threaded
            # 2->inf : Parallelism level
            concurrency_level: 1
        </rosparam>

    </node>

    <node pkg="tf" type="static_transform_publisher" name="base_to_laser" args="0.0 0.0 0.18 0 0.0 0.0 base_link laser 100"/>

</launch>

测试:

  • 主机,新终端,启动雷达
roslaunch rslidar_pointcloud rs_lidar_16.launch
  • 主机,新终端,启动点云转换
roslaunch pointcloud_to_laserscan turtlebot_rslidar.launch 
  • 主机,新终端,启动建图:
roslaunch cartographer_turtlebot turtlebot_rslidar_2d.launch 
  • 从机,新终端,启动键盘:
roslaunch turtlebot_teleop keyboard_teleop.launch 
  • 从机,新终端,打开rviz
roslaunch turtlebot_rviz_launchers view_navigation.launch
  • 效果如下:

请输入图片描述

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: ros与slam入门教程