range_sensor_layer error [closed]

asked 2016-09-15 01:44:54 -0500

ahanaga gravatar image

updated 2016-09-15 04:30:11 -0500

Hi all, I am using four sonar sensor and Hokuyo laser for navigation. I am using range_sensor_layer for sonar sensor. The problem is when I publish the sensor_msgs/Range message and use the range_sensor_layer, I get the following error:

[ERROR] [1473920347.325424279]: Range sensor layer can't transform from odom to sonar_one_range at 1473920347.167207

I am not able to see why am I getting this error as the tf tree is properly set up and there is a transformation from odom to sonar_one_range.

tf tree: link text


obstacle_range: 3.0
raytrace_range: 3.0

footprint: [[0.30, 0.0], [0.30,-0.25], [0.0, -0.25], [-0.30, -0.25], [-0.30,0.0], [-0.30, 0.25], [0.0, 0.25], [0.30, 0.25]]
#robot_radius: 0.5
inflation_radius: 0.2

max_obstacle_height: 0.6
min_obstacle_height: 0.0

   observation_sources: scan
      data_type: LaserScan
      topic: scan
      marking: true
      clearing: true
      expected_update_rate: 0.0
      observation_persistence: 0.0

   ns: /sensors/sonar_sensor
   topics: ["sonar_one_range","sonar_two_range","sonar_three_range","sonar_four_range"]
   no_readings_timeout: 0.0
   clear_threshold: 2.0
   mark_threshold: 8.0
   clear_on_max_reading: true


   global_frame: /odom
   robot_base_frame: /base_link
   update_frequency: 2.0
   publish_frequency: 2.0
   static_map: false
   rolling_window: true
   width: 2.0
   height: 2.0
   resolution: 0.1
   transform_tolerance: 1.0
     - {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
     - {name: range_sensor_layer, type: "range_sensor_layer::RangeSensorLayer"}


   map_type: costmap
   global_frame: /map
   robot_base_frame: /base_link
   update_frequency: 3.0
   publish_frequency: 3.0
   static_map: true
   rolling_window: false
   resolution: 0.1
   transform_tolerance: 1.0

sonar_one_range message:

  seq: 2
    secs: 1473931687
    nsecs: 574187994
  frame_id: sonar_one_range
radiation_type: 1
field_of_view: 0.05
min_range: 0.15000000596
max_range: 6.0
range: 0.319999992847

Does anyone have any idea what is going wrong here? Please let me know if you need more information from me. Any help will be appreciated.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by ahanaga
close date 2016-09-15 20:47:15.077205


Certainly, from the error message, range_sensor_layer cannot find an appropriate transform. Many things could be wrong: 1) typo in one of the frame names, 2) transformation isn't current enough, 2) rate of publishing tf, etc. Are you using URDF to describe your frames?

Mark Rose gravatar image Mark Rose  ( 2016-09-15 18:08:45 -0500 )edit

And how are your publishing the transforms? The odom to base_link transform should be published by your odometry components. Transformations from base_link to sensor frames use usually done via URDF, robot_state_publisher, and joint_state_publisher. Are you using those or something else?

Mark Rose gravatar image Mark Rose  ( 2016-09-15 18:10:26 -0500 )edit

Thanks for your reply. I modified my rate, so now It's ok.

ahanaga gravatar image ahanaga  ( 2016-09-15 20:46:23 -0500 )edit

I am having this same issue. Is there a more detailed description of what you did to fix the problem?

Tyrel gravatar image Tyrel  ( 2019-04-02 11:01:00 -0500 )edit

@Tyrel how did you fix this?

femitof gravatar image femitof  ( 2020-05-17 23:46:02 -0500 )edit

@ahanaga how did modify your rate?

femitof gravatar image femitof  ( 2020-05-18 21:40:46 -0500 )edit

Go inside the /sonar topic publishing script and increasing the rate of publishing inside while loop.

Ex: Inside while loop, rospy.sleep(1) change to rospy.sleep(0.1)

Darshan K T gravatar image Darshan K T  ( 2020-10-26 06:14:08 -0500 )edit