ros noetic使用pointcloud_to_laserscan 将2d激光雷达与深度摄像头数据融合

配置文件

src/wpb_home/wpb_home_tutorials/nav_depth/local_costmap_params.yaml

复制代码
local_costmap:
  global_frame: odom
  robot_base_frame: base_footprint
  static_map: false
  rolling_window: true
  width: 3.0
  height: 3.0
  update_frequency: 10.0
  publish_frequency: 10.0
  transform_tolerance: 1.0
  plugins:
    - {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
    - {name: inflation_layer, type: "costmap_2d::InflationLayer"}

配置文件

src/wpb_home/wpb_home_tutorials/nav_depth/costmap_common_params.yaml

复制代码
robot_radius: 0.25

obstacle_layer:
  obstacle_range: 3.0
  raytrace_range: 6.0
  observation_sources: base_lidar depth_scan

  base_lidar:
    data_type: LaserScan
    topic: /scan
    marking: true
    clearing: true

  depth_scan:
    data_type: LaserScan
    topic: /depth_scan
    marking: true
    clearing: true

inflation_layer:
  inflation_radius: 0.5

配置文件

src/wpb_home/wpb_home_tutorials/nav_depth/global_costmap_params.yaml

复制代码
global_costmap:
  global_frame: map
  robot_base_frame: base_footprint
  static_map: false
  rolling_window: true
  update_frequency: 1.0
  publish_frequency: 1.0
  transform_tolerance: 1.0

recovery_behaviors:
  - name: 'conservative_reset'
    type: 'clear_costmap_recovery/ClearCostmapRecovery'
  - name: 'rotate_recovery'
    type: 'rotate_recovery/RotateRecovery'
  - name: 'aggressive_reset'
    type: 'clear_costmap_recovery/ClearCostmapRecovery'

conservative_reset:
  reset_distance: 2.0
  layer_names: ["obstacle_layer"]

aggressive_reset:
  reset_distance: 0.0
  layer_names: ["obstacle_layer"]

配置文件

src/wpb_home/wpb_home_tutorials/nav_depth/depth_to_scan.yaml

复制代码
target_frame: base_footprint
transform_tolerance: 0.3

min_height: 0.10
max_height: 2.00

angle_min: -1.57
angle_max:  1.57
angle_increment: 0.005

scan_time: 0.1
range_min: 0.4
range_max: 6.0
use_inf: true

launch文件

复制代码
<launch>

  <!-- 载入 机器人 和 RoboCup@Home 的仿真场景 -->
  <include file="$(find wpr_simulation)/launch/wpb_stage_robocup.launch"/>

  <!-- Gmapping -->
  <node pkg="gmapping" type="slam_gmapping" name="slam_gmapping"/>

  <!-- Rviz -->
  <arg name="rvizconfig" default="$(find wpr_simulation)/rviz/slam.rviz" />
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />

  <!-- 手柄控制 -->
  <node respawn="true" pkg="joy" type="joy_node" name="joy_node" >
    <param name="dev" type="string" value="/dev/input/js0" />
    <param name="deadzone" value="0.12" />
  </node>
  <param name="axis_linear" value="1" type="int"/>
  <param name="axis_angular" value="0" type="int"/>
  <param name="scale_linear" value="0.5" type="double"/>
  <param name="scale_angular" value="1" type="double"/>
  <node pkg="wpr_simulation" type="teleop_js_node" name="teleop_js_node"/>

      <node pkg="move_base" type="move_base" name="move_base">
        <rosparam file="$(find wpb_home_tutorials)/nav_depth/costmap_common_params.yaml" command="load" ns="global_costmap" />
        <rosparam file="$(find wpb_home_tutorials)/nav_depth/costmap_common_params.yaml" command="load" ns="local_costmap" />
        <rosparam file="$(find wpb_home_tutorials)/nav_depth/global_costmap_params.yaml" command="load" />
        <rosparam file="$(find wpb_home_tutorials)/nav_depth/local_costmap_params.yaml" command="load" />
        <param name="base_global_planner" value="global_planner/GlobalPlanner" /> 
        <param name="base_local_planner" value="wpbh_local_planner/WpbhLocalPlanner" />
    </node>

      <node pkg="pointcloud_to_laserscan"
        type="pointcloud_to_laserscan_node"
        name="pointcloud_to_laserscan"             
        output="screen">
    <!-- name="pointcloud_to_laserscan" 将命名空间载入 rosparam,所以-->
    <!-- 载入参数 -->
    <rosparam file="$(find wpb_home_tutorials)/nav_depth/depth_to_scan.yaml" />

    <!-- 输入点云 -->
    <remap from="cloud_in" to="/kinect2/sd/points"/>

    <!-- 输出 LaserScan -->
    <remap from="scan" to="/depth_scan"/>
  </node>

      <node pkg="wpr_simulation"
      type="demo_map.py"
      name="explore_then_return"
      output="screen"
      >
      </node>
      
            <node pkg="wpr_simulation"
      type="save_map_and_start_amcl.py"
      name="save_map_and_start_amcl"
      output="screen"
      >
      </node>
                  <node pkg="wpr_simulation"
      type="initialpose_service.py"
      name="initialpose_service"
      output="screen"
      >
      </node>
</launch>
相关推荐
github5actions8 天前
ROS开发实战:如何用rviz文件保存和加载你的SLAM可视化配置(附避坑指南)
ros·slam·rviz·机器人开发
元让_vincent13 天前
DailyCoding C++ | SLAM里的“幽灵数据”:从一个未初始化的四元数谈C++类设计
开发语言·c++·slam·构造函数·类设计·激光里程计
大江东去浪淘尽千古风流人物16 天前
【SLAM】Hydra-Foundations 层次化空间感知:机器人如何像人类一样理解3D环境
深度学习·算法·3d·机器人·概率论·slam
大江东去浪淘尽千古风流人物16 天前
【pySLAM】pySLAM
人工智能·算法·机器学习·概率论·slam
大江东去浪淘尽千古风流人物18 天前
【VLN】VLN Paradigm Alg:模仿学习及其细节(3)
人工智能·python·深度学习·学习·算法·slam
大江东去浪淘尽千古风流人物19 天前
【VLN】VLN仿真与训练三要素 Dataset,Simulators,Benchmarks(2)
深度学习·算法·机器人·概率论·slam
大江东去浪淘尽千古风流人物20 天前
【SLAM新范式】几何主导=》几何+学习+语义+高效表示的融合
深度学习·算法·slam
lovod25 天前
视觉SLAM十四讲合集
计算机视觉·slam·视觉slam·g2o·ba·位姿图
chen_jared1 个月前
slam十四讲第五章习题:相机内参变化与SLAM快门选择
数码相机·slam·标定
s09071361 个月前
【声呐图像处理】水下前视声呐(FLS)图像拼接与建图全流程解析
图像处理·slam·图像拼接·前视声呐·相位相关