# Range sensor layer can't transform from map to /ultrasound. However, detected obstacles are correctly placed in the map

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. I am using ROS indigo.

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. For comparison, this is what I get 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.

EDIT: Firstly, forgot to upload my tf frame tree. I can see that the transform between map and laser is only 10Hz, but as it's provided by my SLAM module whose input is a LIDAR with a max scanning rate of 10Hz I don't see how I can speed it up.

Also, to try and solve Range sensor layer can't transform from map to /ultrasound I ran: rosrun tf tf_monitor map ultrasound which gave me the following:

RESULTS: for map to ultrasound
Chain is: ultrasound -> base_link -> laser -> map
Net delay     avg = 0.119112: max = 0.168371

Frames:

Node: unknown_publisher 144.92 Hz, Average Delay: -0.183418 Max Delay: 0.0692722


Is anyone able to help me make sense of this? At the moment, as far as I can tell I have two problems ...

edit retag close merge delete

Sort by » oldest newest most voted

You have sonar_layer in observation_sources of your obstacle_layer, also plugins in costmap_common_params.yaml is missing obstacle_layer. You should define the costmap plugins in local_costmap_params.yaml and global_costmap_params.yaml and the configuration of the plugins in costmap_common_params.yam, like this (Tried to adapt to your configuration, there might be an error):

local_costmap_params.yaml:

  plugins:
- {name: obstacle_layer, type: 'costmap_2d::ObstacleLayer'}
- {name: sonar_layer,   type: "range_sensor_layer::RangeSensorLayer"}
- {name: inflation_layer, type: 'costmap_2d::InflationLayer'}


global_costmap_params.yaml:

  plugins:
- {name: static_layer, type: 'costmap_2d::StaticLayer'}
- {name: inflation_layer, type: 'costmap_2d::InflationLayer'}


costmap_common_params.yaml:

obstacle_layer:
observation_sources: laser_scan_sensor
obstacle_range: 3
raytrace_range: 9
laser_scan_sensor: {sensor_frame: camera_depth_frame, data_type: LaserScan, topic: scan, marking: true, clearing: true}

sonar_layer:
frame: ultrasound
topics: ["/ultrasound"]

inflation_layer:


[ERROR] [1486152698.562581761]: Range sensor layer can't transform from map to /ultrasound at 1486152698.395551


This might happen from time to time when your sensor/tf is publishing too slow.

Got the Layered setup from Hydro documentation and many posts here on answers.

Fire up dynamic reconfigure in rqt and check if the layers are there with your configuration values if you keep to having problems.

more