nhaulrik created page: Lab7 authored by Nikolaj Cilleborg Haulrik's avatar Nikolaj Cilleborg Haulrik
......@@ -131,7 +131,7 @@ Watch the car with only the cruise thread active and then with only the cruise a
#### Plan:
To make the robot only cruise we outcommented the threads Avoid and Follow in RobotFigure9_9.java. The code is seen in Fig.7
To make the robot only cruise we outcommented the threads Avoid and Follow in RobotFigure9_9.java. To make it use only the cruise and follow. We outcommented Avoid. The code is seen in Fig.7
```
CarDriver cd = new CarDriver();
......@@ -154,8 +154,14 @@ To make the robot only cruise we outcommented the threads Avoid and Follow in Ro
cruise.setDaemon(true);
cruise.start();
```
##### Fig.7 - Code used for activating cruise only.
#### Results:
In the video we observe the car with only the cruise thread activated. This means that the car will only drive forward and any other behaviors are inactive.
For the first experiment with only cruise active, we observed a very simple behavior. The robot only drove forward as any other behaviors are inactive. For the experiment with Cruise and Follow active, the robot had almost the same behaviour as when using it’s full behaviour model as seen in the previous task, except it was not able to stop when encountering an obstacle, so it would continue to drive forward even though it was impossible. This behavior is seen in Fig.8
[![image alt text](http://img.youtube.com/vi/MGHlz4jhcUc/0.jpg)](http://www.youtube.com/watch?v=MGHlz4jhcUc)
##### Fig.8 - Observed behavior with Cruise and Follow activated.
As an addition we tested the robot with Avoid and Cruise active. Here the robot drove straight ahead in a slight curve, ignoring light conditions. When encountering an object with the ultrasonic sensor, the robot compares distances and turn towards the direction where the distance is longest.
\ No newline at end of file