Ask Your Question

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

asked 2017-02-03 15:15:11 -0500

carebare47 gravatar image

updated 2017-02-07 15:37:34 -0500

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

Frame: base_link published by unknown_publisher Average Delay: -0.0398328 Max Delay: 0
Frame: laser published by unknown_publisher Average Delay: 0.0689363 Max Delay: 0.069513
Frame: map published by unknown_publisher Average Delay: -0.0398488 Max Delay: 0
Frame: ultrasound published by unknown_publisher Average Delay: -0.499823 Max Delay: 0

All Broadcasters:
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 ... (more)

edit retag flag offensive close merge delete


@carebare47 how did you solve the timing issue?

femitof gravatar image femitof  ( 2020-05-20 00:09:18 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-02-07 03:16:51 -0500

Humpelstilzchen gravatar image

updated 2017-02-07 14:22:08 -0500

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):


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


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


  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}

  frame: ultrasound
  topics: ["/ultrasound"]

  inflation_radius: 0.4

For your error:

[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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2017-02-03 15:15:11 -0500

Seen: 1,538 times

Last updated: Feb 07 '17