
Originally Posted by
Kenjones1935
Now it starts to turn right - as it should. As the right turn aims the front of the car more at the wall, the right SONAR finds that same wall farther away. It exceeds the "desiredtrack" distance and therefore keeps turning right.
CRASH
Sounds like you need to limit your angle as you turn into the wall.
When adjusting right to get to your imaginary line (closer to the wall), if front distance < 3 * side distance, then turn left (until front distance > 3 * side distance). Something like this should help keep from making too big of a right turn, but still get you closer to the wall.
Changing the 3 would change the angle you would allow.
http://www.scalerobotics.com
Bookmarks