We're programming a robot that follows a wall. If the measurements of the sensor on the top are (<40 centimeters) the robot should turn. So the robot checks while driving if there is a wall in front of him. The program works to a specific point, where the robot finds measurements ( < 40 centimeters) and turns, but theres nothing in front of him.
We've tried to do more than one measurement but we have to do over 8 measurements to get a good result.
My question is now, is it the sensor which have noise (or something like that) or does our program fail.
thank you for your help
- Code: Select all
Color tmpCol = cs.getColor();
if(...) //tmpCol == green/red
double test = ops1.getDistance()/10.0;
if(test < distToWallTarget)