Hi all,
I'm having some issues adding ultrasonic sensors to my costmap. My robot was set up using the move_base setup guide, and uses a single Hokuyo lidar for SLAM with hector_mapping. It uses three costmaps: local_costmap_params.yaml, global_costmap_params.yaml and costmap_common_params.yaml.
To help get the ultrasonic data into the costmap(s) I made a simplified URDF model (instead of manually adding static transform publishers to launch files, as I did with the laser scanner). I've got data from a SRF05 into ROS and displaying as a cone from the front of my model in RVIZ, and after a bit of playing with the costmaps I've managed to get ultrasonic range data to register as inflated obstacles in the local costmap.
The problem is that when I add the sonar sensor to the costmap, I no longer have any lidar data in the costmap. Before I added the range_layer to the params.yaml file I could see a global and local costmap in rviz. Now that the sonar settings are in there too I only see the ultrasonic range costmap stuff inside the local costmap, and the global costmap is empty. I am getting errors out of the move_base terminal which read:
[ERROR] [1486152698.562581761]: Range sensor layer can't transform from map to /ultrasound at 1486152698.395551
However there must be at least an intermittent transformation between map and /ultrasound because I can see the obstacles being added to the costmap in RVIZ, [as you can see here](https://s24.postimg.org/hvlqz37zp/range_Finder_RVIZ.png). For comparison, [this is what I get](https://s27.postimg.org/9bx6bltn7/range_Finder_RVIZNOSONIC.png) when I remove the "sonar_layer:" section and the "plugins:" section from costmap_common_params.yaml.
I'm not too sure what I'm doing in general with setting all this up (figuring it all out as I go along), so any advice or pointers from anyone would be greatly appreciated.
Here are my costmap parameter files:
local_costmap_params.yaml:
local_costmap:
global_frame: /map
robot_base_frame: base_link
update_frequency: 6.0
publish_frequency: 1.0
static_map: false
rolling_window: true
width: 6.0
height: 6.0
resolution: 0.05
transform_tolerance: 0.5
obstacle_layer:
observation_sources: laser_scan_sensor sonar_layer
laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: scan, marking: true, clearing: true}
global_costmap_params.yaml:
global_costmap:
global_frame: /map
robot_base_frame: base_link
update_frequency: 6.0
static_map: true
costmap_common_params.yaml:
plugins:
- {name: sonar_layer, type: "range_sensor_layer::RangeSensorLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
obstacle_range: 3
raytrace_range: 9
footprint: [[-0.162, -0.206], [-0.162, 0.206], [0.162, 0.206], [0.162, -0.206]]
#old footprint: [[-0.12, -0.18], [-0.12, 0.18], [0.12, 0.18], [0.12, -0.18]]
#robot_radius: ir_of_robot
inflation_radius: 0.4
transform_tolerance: 1.3
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: scan, marking: true, clearing: true}
sonar_layer:
frame: ultrasound
topics: ["/ultrasound"]
no_readings_timeout: 1.0
clear_on_max_reading: true
And [here is my URDF model](https://s28.postimg.org/s9lppfg65/RDFtree.png).
Please let me know if there's any more information that I should add to this question.
Many thanks,
Tom
↧





