ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to have more than 1 of the same sensor types in obstacle layer of local costmap?

asked 2023-01-06 12:27:16 -0500

chased11 gravatar image

updated 2023-01-06 12:40:20 -0500

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
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-01-06 15:27:23 -0500

Shivam gravatar image

updated 2023-01-06 15:28:18 -0500

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.

edit flag offensive delete link more

Comments

Awesome that's what I was looking for. Thanks!

chased11 gravatar image chased11  ( 2023-01-06 22:39:16 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2023-01-06 12:27:16 -0500

Seen: 349 times

Last updated: Jan 06 '23