DistanceSensor, better way to handle out of range obstacles #3906
lukicdarkoo
started this conversation in
Ideas
Replies: 1 comment
-
I believe |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, DistanceSensor returns a maximum value (
wb_distance_sensor_get_max_value
) with noise if object is too far (greater than the maximum value). Although this describes well analogue sensors, digital sensors usually have a way to handle these cases differently.VL53L0X - ToF sensor in e-puck2
http://projects.gctronic.com/epuck2/doc/VL53L0X-UserManual-API.pdf - page 16, Table 1. Range Status
"Signal fail will trigger when the return signal is too low to give enough confidence on the range measured."
And here is the way it is handled in a library:
https://github.com/bitbank2/VL53L0X/blob/master/tof.c#L783
similar applies many digital sensors (including LiDARs).
Describe the solution you'd like
wb_distance_sensor_get_value
can return -1 if the obstacle is out of range.Describe alternatives you've considered
A separate function can be added that returns error code. This will allow users to have bad (unreliable) that still describes analogue sensors properly.
Additional context
Documentation should be slightly improved. The plot of noise (https://www.cyberbotics.com/doc/reference/distancesensor#lookup-table) should be named differently to emphasis it is a standard deviation.
For function
wb_distance_sensor_get_max_value
https://www.cyberbotics.com/doc/reference/distancesensor#wb_distance_sensor_get_max_value
statement "returns the maximum value which can be returned by the distance sensor" is not current as the sensor can return higher values (maximum value + noise)
Beta Was this translation helpful? Give feedback.
All reactions