... | ... | @@ -38,7 +38,7 @@ The program worked quite well. The robot succesfully avoided obstacles registere |
|
|
#### Incorpoating a 180 degree escape turn
|
|
|
As prescribed in the lesson plan, we modified ***AvoidFigure9_3.java*** [5] to make the robot perform a 180 degree turn when encountering a corner (i.e. when both the front distance and the side distance are below the threshold value).
|
|
|
|
|
|
We tried changing the program by making the robot drive backwards a little when encountering an obstacle, check if it was a corner and then spin around 180 degrees (by making one motor drive forward and the other drive backwards). Initially we made the robot perform the 180 turn for 1 second (1000 ms), which wasn't enough, but when we changed it to 2 seconds (2000 ms) it spun approximately 180 degrees. [TODO: video description]
|
|
|
We tried changing the program by making the robot drive backwards a little when encountering an obstacle, check if it was a corner and then spin around 180 degrees (by making one motor drive forward and the other drive backwards). Initially we made the robot perform the 180 turn for 1 second (1000 ms), which wasn't enough, but when we changed it to 2 seconds (2000 ms) it spun approximately 180 degrees. This behavior can be seen in video 2 where the robot turn 180 degrees when measuring a low distance in all three checks, but not when only measuring a low distance in some.
|
|
|
|
|
|
[![Improved avoid behavior](http://img.youtube.com/vi/Um4zjVYArJ0/0.jpg)](https://www.youtube.com/watch?v=Um4zjVYArJ0)
|
|
|
*Video 2: The robot performing a 180 degree turn when encountering a corner (approximately TODO seconds in)*
|
... | ... | |