0
$\begingroup$

Rosanswers logo

I am trying to use 2 topics from RTABmap/obstacle_detection (obstacle, ground). Ground for the clearing and obstacle for marking.

I am trying to follow this answer, and am not sure if I am doing it right.

Below are my costmap params, I think i have it setup right but it looks like my local costmap is not updating, while my global costmap is. In my node graph it shows /ground being published to move_base but not /obstacles. Thanks!

local_costmap:
      global_frame: odom
      robot_base_frame: base_link
      update_frequency: 15.0
      publish_frequency: 15.0
      static_map: false
      rolling_window: true
      width: 8.0
      height: 8.0
      resolution: 0.025
      origin_x: -2.0
      origin_y: -2.0
  plugins:
  - {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}

  obstacle_layer:
    observation_sources: point_cloud_sensor laser_scan_sensor
    point_cloud_sensor: {
      sensor_frame: base_link,
      data_type: PointCloud2, 
      topic: /obstacles, 
      expected_update_rate: 0.5, 
      marking: true, 
  clearing: false,
  min_obstacle_height: -99999.0,
  max_obstacle_height: 99999.0}
point_cloud_sensor: {
  sensor_frame: base_link,
  data_type: PointCloud2, 
  topic: /ground, 
  expected_update_rate: 0.5, 
  marking: false, 
  clearing: true,
  min_obstacle_height: -99999.0,
  max_obstacle_height: 99999.0
}

Global:

    global_costmap:
      global_frame: map
      robot_base_frame: base_link
      update_frequency: 15
      publish_frequency: 10
      static_map: true

Common:

obstacle_range: 4
raytrace_range: 6
footprint: [[-0.6858, -0.762], [-0.6858, 0.762], [0.6858, 0.762], [0.6858, -0.762]]
map_topic: map
footprint_padding: 0.03
robot_radius: 1.1
inflation_radius: 0.35
transform_tolerance: 1

    controller_patience: 2.0
    
    NavfnROS:
      allow_unknown: true
    
    plugins:
  - {name: static_layer, type: "costmap_2d::StaticLayer"}
  - {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
  - {name: inflation_layer, type: "costmap_2d::InflationLayer"}
recovery_behaviors: [
    {name: conservative_clear, type: clear_costmap_recovery/ClearCostmapRecovery},
    {name: aggressive_clear, type: clear_costmap_recovery/ClearCostmapRecovery}
]

conservative_clear: 
    reset_distance: 3.00
aggressive_clear:
    reset_distance: 1.84

Originally posted by chased11 on ROS Answers with karma: 137 on 2023-01-06

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

To include multiple instances of the same sensor type in the obstacle layer of the local costmap in ROS, you will need to follow these steps:

1.Configure each sensor to publish its data to a separate topic. For example, if you have two LIDAR sensors that you want to include in the local costmap, you should configure each sensor to publish its data to a separate topic, such as /lidar_1/scan and /lidar_2/scan.

2.Configure the costmap_2d node to subscribe to each of the sensor topics. You can do this by specifying the names of the sensor topics in the obstacle_layer section of the costmap_2d configuration file. For example, if you have two LIDAR sensors that you want to include in the local costmap, you should add the following lines to the obstacle_layer section of the configuration file:

obstacle_layer:
  ...
  observation_sources: scan scan_2
  scan: {sensor_frame: lidar_1, data_type: LaserScan, topic: /lidar_1/scan}
  scan_2: {sensor_frame: lidar_2, data_type: LaserScan, topic: /lidar_2/scan}
  ...

3.Make sure that the costmap_2d node is correctly configured to transform the sensor data into the correct frame of reference. You can do this by specifying the correct sensor_frame and obstacle_layer_name parameters for each sensor in the obstacle_layer section of the costmap_2d configuration file. The sensor_frame parameter specifies the frame of reference for the sensor data, and the obstacle_layer_name parameter specifies the name of the layer in the costmap where the sensor data should be stored. I hope this helps clarify how to include multiple instances of the same sensor type in the obstacle layer of the local costmap. Let me know if you have any further questions or need more assistance.


Originally posted by Shivam with karma: 66 on 2023-01-06

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by chased11 on 2023-01-06:
Awesome that's what I was looking for. Thanks!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.