Re: Noisy Global Map using ZEDm causing obstacle avoidance navigation problem

Posted by matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Noisy-Global-Map-using-ZEDm-causing-obstacle-avoidance-navigation-problem-tp6039p6046.html

point_cloud_xyz can use depth image as input. The zed camera should provide a depth image, thus use the corresponding camera_info. See http://wiki.ros.org/rtabmap_ros#rtabmap_ros.2BAC8-point_cloud_xyz for more info.

cloudXYZ is a topic created from point_cloud_xyz  nodelet.

Example for zed:

     <!-- Generate a point cloud from the depth image -->
      <node pkg="nodelet" type="nodelet" name="depth2cloud" args="standalone rtabmap_ros/point_cloud_xyz">
         <remap from="depth/image"       to="/zed/zed_node/depth/depth_registered"/>
         <remap from="depth/camera_info" to="/zed/zed_node/rgb/camera_info"/>
         <remap from="cloud"                to="/voxel_cloud"/>
         
         <param name="voxel_size" type="double" value="0.05"/>
         <param name="decimation" type="int" value="4"/>
         <param name="max_depth" type="double" value="4"/>
      </node>

      <!-- Create point cloud for the local planner -->
      <node pkg="nodelet" type="nodelet" name="obstacles_detection" args="standalone rtabmap_ros/obstacles_detection">
         <remap from="cloud" to="/voxel_cloud"/>
         <remap from="obstacles" to="/obstacles"/>

         <param name="frame_id" type="string" value="base_footprint"/>
         <param name="map_frame_id" type="string" value="map"/>
         <param name="min_cluster_size" type="int" value="20"/>
         <param name="max_obstacles_height" type="double" value="0.0"/>
       </node>

The local costmap config:
local_costmap:
  global_frame: odom
  robot_base_frame: base_footprint
  update_frequency: 2.0
  publish_frequency: 2.0
  static_map: false
  rolling_window: true
  width: 4.0
  height: 4.0
  resolution: 0.025
  origin_x: -2.0
  origin_y: -2.0

  observation_sources: point_cloud_sensor

  # assuming receiving a cloud from rtabmap_ros/obstacles_detection node
  point_cloud_sensor: {
    sensor_frame: base_footprint,
    data_type: PointCloud2, 
    topic: /obstacles, 
    expected_update_rate: 0.5, 
    marking: true, 
    clearing: true,
    min_obstacle_height: -99999.0,
    max_obstacle_height: 99999.0}

cheers,
Mathieu