Rosanswers logo

I am a fresh man to ROS system.I bulid a robot platfom use ros. i use move_base in my systerm.
I have a laser scan and some ultrasonic sensors in my systerm,but for using the ultrasonic sensor i got some problem.
i dont konw how to add the range_sensor_layer as a costmap plugins.
i tried just add

In costmap_common_params.yaml
add the layer of ultrasonic

 enabled: true  
 max_obstacle_height: 0.4  
 origin_z: 0.0  
 z_resolution: 0.2  
 z_voxels: 2  
 unknown_threshold: 15  
 mark_threshold: 0  
 combination_method: 1  
 track_unknown_space: true #true needed for disabling globalpath planning through unknown space  
 obstacle_range: 1.0  
 raytrace_range: 3.0  
 publish_voxel_map: false  
 observation_sources: ultrasonic  
  data_type: Range  
  topic: ultrasonic  
  marking: true  
  clearing: true  

In local_costmap_params.yaml like

  - {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}  
  - {name: ultrasonic,   type: "range_sensor_layer::RangeSensorLayer"}  
  - {name: inflation_layer, type: "costmap_2d::InflationLayer"}  

but when i run the move base i got some error said: "range_sensor_layer::RangeSensorLayer" is not surported by the plugin .

i can get the range informations using : $rostopic echo ultrasonic

did i missed something? or did i do somrthing wrong?
and can anybody tell me the correct way to use the range_sensor_layer as a plugin?

thanks a lot

Originally posted by zink on ROS Answers with karma: 1 on 2016-08-10

Post score: 0

Original comments

Comment by David Lu on 2016-08-21:
Can you please post the actual error message that you got?


1 Answer 1


Rosanswers logo

My guess is your issue stems from how you defined your ultrasonic plugin. Try the following instead:

    topics: ["/ultrasonic"]
    no_readings_timeout: 1.0
    clear_on_max_reading: true

Then also remove all of your "ultrasonic_layer:" definition to prevent confusion (Unless you are using that plugin elsewhere). You only need to define a layer/plugin once.

Also the RangeSensorLayer has no 'marking' or 'clearing' parameters (unlike ObstacleLayer) so you don't need those lines.

Let us know if this fixes your problem.

Originally posted by biglotusturtle with karma: 165 on 2017-09-20

This answer was ACCEPTED on the original site

Post score: 0


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.