range_sensor_layer doesn't show obstacles on rviz map?
Hi.
I'm working a robot navigation using a lidar and 5 ultrasound sensors. using range_sensor_layer I couldn't get the robot to avoid obstacles within its range dont know if it's from the common costmap file, local or global. here are all of them, I really appreciate your help:
1. costmap_common_params.yaml
obstacle_range: 2.5
raytrace_range: 3.5
footprint: [[-0.200, -0.30], [-0.200, 0.300], [0.300, 0.300], [0.300, -0.300]]
publish_frequency: 1.0
map_type: costmap
transform_tolerance: 0.2
inflation_layer:
inflation_radius: 0.5
cost_scaling_factor: 0.8
obstacle_layer:
observation_sources: scan
scan: {sensor_frame: rplidar, data_type: LaserScan, topic: scan, marking: true, clearing: true}
range_sensor_layer:
topics: ["range_1", "range_2", "range_3", "range_4", "range_5"]
clear_threshold: 0.2
mark_threshold: 0.80
2. Global_costmap_params.yaml
global_costmap:
global_frame: map
robot_base_frame: base_footprint
update_frequency: 1.0
publish_frequency: 1
static_map: true
rolling_window: false
transform_tolerance: 0.5
plugins:
- {name: static_layer, type: "costmap_2d::StaticLayer"}
- {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
- {name: range_sensor_layer, type: "range_sensor_layer::RangeSensorLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
inflation_layer:
inflation_radius: 0.5
cost_scaling_factor: 0.8
range_sensor_layer:
topics: ["range_1", "range_2", "range_3", "range_4", "range_5"]
clear_threshold: 0.2
mark_threshold: 0.8
obstacle_layer:
observation_sources: scan
scan: {sensor_frame: rplidar, data_type: LaserScan, topic: scan, marking: true, clearing: true}
3. local_costmap_params.yaml
local_costmap:
global_frame: odom
robot_base_frame: base_footprint
update_frequency: 2
publish_frequency: 1
static_map: false
rolling_window: true
width: 6
height: 6
resolution: 0.05
transform_tolerance: 1.0
plugins:
- {name: range_sensor_layer, type: "range_sensor_layer::RangeSensorLayer"}
- {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
inflation_layer:
inflation_radius: 0.5
cost_scaling_factor: 0.8
range_sensor_layer:
topics: ["range_1", "range_2", "range_3", "range_4", "range_5"]
clear_threshold: 0.2
mark_threshold: 0.80
obstacle_layer:
observation_sources: scan
scan: {sensor_frame: rplidar, data_type: LaserScan, topic: scan, marking: true, clearing: true}
In this picture, the inflated area in the local map is detected by the lidar and I placed beers in front of each sonar sensors because their height be detected only by them and not the lidar.
update
Here are the messages right when I launch
When you visualize the ultrasound sensors in rviz, do they appear in the correct positions with the correct ranges?
(I've also increased your reputation, so you can post images now)
Thank you! The ranges do appear in their correct positions and their topics show correct ranges (min and max and even when I add an object). I can post images tomorrow when I get back to work
Can you please add 1) the output of "rostopic echo -n 1 /range_1" 2) the output of move_base starting
I don't really understand exactly what's wrong, but if this were my robot, I would try adjusting the ordering and the marking and clearing options on the range and obstacle layers.
Hi, Thank you both for replying. Here's the output of range_1
I'm sorry I didn't get what you mean by move_base starting, there isn't such topic
@ahendrix I actually did that but nothing affected the sonar sensors
is there something to add in amcl or launch files?
move_base is the node you load your configuration files (costmap_common_params.yaml, Global_costmap_params.yaml and local_costmap_params.yaml) in. When the node starts it should print a few lines to stdout.