Hey guys!
I would like some help with my problem. I've a project where I use a front and a side sonar to locate a mobile robot in a known environment (in combination with relative measurement sensors). For this I made a gazebo simulation and made a link to rviz, what is working good (the sonar beam is displaying). Now I'm stuck for some time with localization of the robot in rviz. I would like to use the range_sensor_layer to display data point(s) of a (known) obstacle, and to localize the robot like [here](https://answers.ros.org/question/206805/adding-range_sensor_layer-to-layered-costmap-for-global-planning/) or [here](https://answers.ros.org/question/303969/ultrasonic-sensor-with-range_sensor_layer-not-forming-cone-obstacles/). When I add a laser scanner, the visualization works good and as expected, but I want to do the same with a sonar.
TLDR: range_sensor_layer doesn't give me data points in rviz (something I was expecting).
**costmap_common_params.yaml:**
map_type: costmap
footprint: [[0.25, 0.25], [0.25,-0.25], [-0.25,-0.25], [-0.25,0.25]]
inflation_layer:
inflation_radius: 0.3
obstacle_layer:
obstacle_range: 2.5
raytrace_range: 3.0
sonar_layer:
nr: /sonar
topics: ["/sonar_front", "/sonar_side"]
no_readings_timeout: 1.0
clear_threshold: 0.2
mark_threshold: 0.8
**local_costmap_params.yaml:**
local_costmap:
global_frame: odom
robot_base_frame: robot_footprint
update_frequency: 1.0
publish_frequency: 1.0
width: 20.0
height: 20.0
resolution: 0.05
static_map: false
rolling_window: true
plugins:
- {name: sonar_layer, type: "range_sensor_layer::RangeSensorLayer"}
- {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
**global_costmap_params.yaml:**
global_costmap:
global_frame: map
robot_base_frame: robot_footprint
update_frequency: 10.0
publish_frequency: 10.0
width: 40.0
height: 40.0
resolution: 0.05
static_map: true
rolling_window: false
plugins:
- {name: sonar_layer, type: "range_sensor_layer::RangeSensorLayer"}
- {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
I hope this gives enough information! If I'm not clear or need to add more information, please tell me. Thank you in advance.
↧