The maximum distance that proximity sensor IR can calculate #6409
Replies: 3 comments 1 reply
-
There is no maximum value to the range of a IR distance sensor, as you can define it in the lookup table. The source code computing the return value of a distance sensor is located here. |
Beta Was this translation helpful? Give feedback.
-
After testing the distance sensor (IR type) alone without e-puck robot, I got the distance value even if it more than 2 meters. |
Beta Was this translation helpful? Give feedback.
-
I found the problem. Thank you for helping. |
Beta Was this translation helpful? Give feedback.
-
What is the maximum distance that proximity sensor IR can calculate?
according to the doc, we can change the distance in Lookup Table, I used E-puck robot, converted it to base node, and changed the values in lookup table as:
[[0.0e+00 3.0e+03 0.0e+00]
[1.0e-01 2.0e+03 0.0e+00]
[2.5e-01 1.0e+03 0.0e+00]
[1.0e+00 0.0e+00 0.0e+00]]
So, the sensor will return 0 for 1 m and 3000 for 0 m.
I changed the redColorSensitivity to zero.
Then I started the simulation and got the values and found that the sensor will give me 0.0 from distance 0.417 m to 1 m, and 772 in 0.416.
The distance 0.416 is the maximum distance that the sensor can reach and sense, I searched to find the function in code that responsible to calculate the distance in simulation, but I couldn't find it, I searched in doc about the equation that represents the value of sensor reading, I couldn't find it either, the only thing I found the reflection factor as follows: f = 0.2 + 0.8 * red_level * (1 - 0.5 * roughness) * (1 - 0.5 * occlusion).
My question is 0.416 is the maximum distance can IR sensor sense? if not, what is the maximum distance, and what is the equation or function in code that return the reading value?
Beta Was this translation helpful? Give feedback.
All reactions