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>
相关推荐
点云SLAM4 小时前
凸优化(Convex Optimization)理论(1)
人工智能·算法·slam·数学原理·凸优化·数值优化理论·机器人应用
点云SLAM2 天前
凸优化(Convex Optimization) 理论(2)
机器人·slam·最小二乘法·数值优化·凸优化·拉格朗日-牛顿法·二次规划(qp)
WWZZ20253 天前
SLAM进阶——数据集
人工智能·计算机视觉·机器人·大模型·slam·具身智能
WWZZ20254 天前
SLAM进阶——特征提取
人工智能·大模型·slam·orb·具身智能·特征提取
原野风霜3246 天前
激光雷达(Lidar)介绍
雷达·激光雷达·lidar·毫米波雷达
Sereinc.Y6 天前
【移动机器人运动规划(ROS)】03_ROS话题-服务-动作
c++·动态规划·ros·slam
点云SLAM7 天前
Truncated Least Squares(TLS 截断最小二乘)算法原理
算法·slam·位姿估计·数值优化·点云配准·非凸全局优化·截断最小二乘法
点云SLAM9 天前
点云配准算法之- GICP算法点云配准概率模型推导和最大似然求解(MLE)
算法·机器人·slam·点云配准·最大似然估计·点云数据处理·gicp算法
WWZZ202510 天前
快速上手大模型:实践(Grounded-SAM2与Depth Anything V2)
大模型·sam·slam·多模态·具身智能·dino·grounded-sam2
点云SLAM11 天前
SLAM文献之-Embedding Manifold Structures into Kalman Filters(3)
计算机视觉·机器人·slam·fast-lio·卡尔曼滤波算法·导航系统·imu系统导航