Search code examples
webots

Webots: Line follower sensor returning inconsistent values


I'm trying to make a line follower in Webots using the infrared distance sensors (same as the e-puck line follower). The problem is that the sensors return very inconsistent values ranging from 250-550 on black surface and between 700-1100 on white surface.

I've tried using multiple sensors and then taking the average but the robot is still having trouble fallowing the line. From what I've read, using light sensor is not an option as it doesn't work on reflected light. Is there any way to use some different sensors (or a camera) or to "fix" the distance sensors to give more consistent values?

Thanks for any help


Solution

  • This is due to the noise of the sensors. The noise of the sensors is defined in its look-up table: https://cyberbotics.com/doc/reference/distancesensor#lookup-table

    You can remove the noise of the ground sensors of the e-puck by editing the 'E-puckGroundSensors.proto' file and setting the last component of each item of the look-up tables to 0: