range_sensor_layer does not clear obstacle

asked 2022-04-25 08:30:33 -0500

N.N.Huy gravatar image

updated 2022-04-25 08:36:46 -0500

Hello everyone, i am using range_sensor_layer to add obstacles detected by ultrasound to costmap. Every thing works ok accept the layer does not clear obstacle when the ultrasound sensor does not catch. For example, when the ultrasound sensor catches an obstacle, the obstacle is added into costmap, after that, the robot rotates to a position that the ultrasound sensor does not catch anything, the old obstacle is stilled saved on the costmap. Is there any way to clear the old obstacle that the ultrasound sensor does not catch anymore ?

Fore more detailed:

This is the message that i received from the sensor:

header: 
  seq: 7187
  stamp: 
    secs: 1650893541
    nsecs:  98532047
  frame_id: "sonar_0_link"
radiation_type: 0
field_of_view: 0.0500000007451
min_range: 0.0
max_range: 0.600000023842
range: 1.63419687748
---

This is what i setup for the layer:

sonar_layer:
  topics: ["/sonar0_distance", "/sonar1_distance", "/sonar2_distance", "/sonar3_distance", "/sonar4_distance"]
  no_readings_timeout: 2.0
  clear_threshold: 0.7
  mark_threshold: 0.8
  clear_on_max_reading: true

Thank you so much and have a nice day!

edit retag flag offensive close merge delete