# obstacle_range & raytrace_range - precise explanation?

Hey folks,

could somebody please explain how exactly obstacle_range and raytrace_range work? Assuming I have an IR sensor which publishes a point cloud with one point. That IR sensor can measure obstacles from 40 to 800mm. If it doesn't measure anything (there's nothing within its range) its values will exceed this range and heavily jump around (never accidentily jumping into its valid range however) and can be considered infinite/free.

How would I have to correctly configure the mentioned parameters? From the documentation I don't really understand what the parameters do. A precise explanation would be greatly appreciated.

Thanks.

edit retag close merge delete

Sort by » oldest newest most voted

Short answer: I think setting both parameters to .8 would work for you.

For each sensor, you specify a sensor_frame and the distance from that frame to each observation is measured.

If the observation source is set to 'marking', then it will place a lethal obstacle on the costmap if that distance is less than obstacle range. Similarly, if the source is set to 'clearing' then it will mark all of the space between the sensor frame and the observation as free space if the distance is less than the raytrace range. Otherwise, it will only clear the line that is raytrace_range long (closest to the sensor).

In your particular case, you MIGHT want different values for these two parameters if for instance, you only want to mark with certainty points <800mm, but want to clear up to 1200mm (for example).

more

( 2013-08-12 05:32:29 -0500 )edit

@David Lu, Is there a relationship between raytrace_range and obstacle_range? Should it be greater than the obstacle_range? Thanks

( 2021-04-24 13:29:26 -0500 )edit

They are not technically related. obstacle range is often less but does not have to be. If you have further questions please open your own question.

( 2021-05-13 11:59:09 -0500 )edit