0
$\begingroup$

Rosanswers logo

I have two sources for my costmap while running the navigation stack. A laser scanner and a pointcloud2 for bumper sensors. I have the costmap_common_params.yaml file set to clear the laser scanner but not the bumper. But it is clearing both. Actually, even when I set the laser to not clear, it also clears. So everything clears even when set to not clear.

Here is the costmap_common_params.yaml file.

obstacle_range: 2.5
raytrace_range: 5.0
footprint: [[-0.106, -0.106], [-0.106, 0.106], [0.106, 0.106], [0.150, 0], [0.106, -0.106]]
robot_radius: 0.150
inflation_radius: 0.3
transform_tolerance: 0.7

obstacle_layer:
  observation_sources: laser_scan_sensor bumper_sensor

  laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: /scan, marking: true, clearing: true}
  bumper_sensor: {sensor_frame: base_link, data_type: PointCloud2, topic: /pointcloud, marking: true, clearing: false}

I am using Jade on Ubuntu14.04.

I have tried two configurations, setting the point 'locations' of the bumper sensors far away when it is not activated, and set it at 0.0 when it is not activated. And then set just outside the edge of the robot when it is activated. The clearing behavior was the same regardless of where the points were located when the sensor isn't activated. The concept for moving the points far away came from this: http://docs.ros.org/kinetic/api/kobuki_bumper2pc/html/kobuki__bumper2pc_8cpp_source.html

Can anyone suggest how to prevent the bumper sensor PointCloud2 obastacles from clearing from the cost map?


Originally posted by billy on ROS Answers with karma: 1850 on 2017-01-02

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

I'll answer my own question: I found information here that helped me: http://wiki.ros.org/costmap_2d/Tutorials/Configuring%20Layered%20Costmaps

My costmap_common_params.yaml file now looks like this and the bumper data is not being cleared.

obstacle_range: 2.5
raytrace_range: 5.0
footprint: [[-0.106, -0.106], [-0.106, 0.106], [0.106, 0.106], [0.150, 0], [0.106, -0.106]]
robot_radius: 0.150
inflation_radius: 0.3
transform_tolerance: 0.7

plugins:
  - {name: static_map, type: "costmap_2d::StaticLayer"}
  - {name: obstacles, type: "costmap_2d::VoxelLayer"}
  - {name: inflation_layer, type: "costmap_2d::InflationLayer"}

obstacles:
  observation_sources: laser_scan_sensor bumper_sensor

  laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: /scan, marking: true, clearing: true}
  bumper_sensor: {sensor_frame: base_link, data_type: PointCloud2, topic: /pointcloud, marking: true, clearing: false}

inflation_layer:
  enabled:              true
  cost_scaling_factor:  10.0  # exponential rate at which the obstacle cost drops off (default: 10)
  inflation_radius:     0.3  # max. distance from an obstacle at which costs are incurred for planning paths.

Originally posted by billy with karma: 1850 on 2017-01-02

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$
0
$\begingroup$

Rosanswers logo

The problem was that you were mixing pre-Hydro and post-Hydro configuration. Pre-Hydro the configuration was flat, so you shouldn't use the "obstacle_layer:" namespace. Post-Hydro everything moved to plug-ins, and the namespaces are required. This pre-Hydro configuration should also solve your original problem:

obstacle_range: 2.5
raytrace_range: 5.0
footprint: [[-0.106, -0.106], [-0.106, 0.106], [0.106, 0.106], [0.150, 0], [0.106, -0.106]]
robot_radius: 0.150
inflation_radius: 0.3
transform_tolerance: 0.7

observation_sources: laser_scan_sensor bumper_sensor

laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: /scan, marking: true, clearing: true}
bumper_sensor: {sensor_frame: base_link, data_type: PointCloud2, topic: /pointcloud, marking: true, clearing: false}

Originally posted by clyde with karma: 1247 on 2017-01-06

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by billy on 2017-01-07:
makes sense. Thanks for explaining.

$\endgroup$

Your Answer

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