nhaulrik created page: Lab7 authored by Nikolaj Cilleborg Haulrik's avatar Nikolaj Cilleborg Haulrik
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
#### Task: The program AvoidFigure9_3.java implements the avoid behavior with a single ultrasonic sensor. Download the program and observe the car. Describe how the car behaves. #### Task: The program AvoidFigure9_3.java implements the avoid behavior with a single ultrasonic sensor. Download the program and observe the car. Describe how the car behaves.
#### Plan: The program was executed without changes. #### Plan: The program was executed without changes in the code.
#### Result: #### Result:
[![image alt text](http://img.youtube.com/vi/eWA66BUeK1E/0.jpg)](http://www.youtube.com/watch?v=eWA66BUeK1E) [![image alt text](http://img.youtube.com/vi/eWA66BUeK1E/0.jpg)](http://www.youtube.com/watch?v=eWA66BUeK1E)
The car drives and turns in order to avoid surface contact. When it encounters a surface that is less than the stopThreshold the car stops and turns to measure distances to it’s left and right. It then compare these readings and drives in the direction with most space. As seen in the video the car drives and turns in order to avoid surface contact. When it encounters a surface that is less than the stopThreshold (see code snippet below) the car stops and turns to measure distances to it’s left and right. It then compares these readings and drives in the direction with most space available.
``` ```
while ( true ) while ( true )
... ...
......