... | ... | @@ -73,14 +73,14 @@ This was caused by the Follow behavior being programmed to trigger a 'search' fo |
|
|
|
|
|
|
|
|
### Implementing the Escape behavior
|
|
|
As suggested in the lesson plan, we used the implementation on page 305 in [2] as inspiration. The final result is included in [6].
|
|
|
The next step in our experiments with a behavior controlled robot was to implement a new behavior to use in the ***RobotFigure9_9***. As suggested in the lesson plan, we used the pseudocode on page 305 in [2] as inspiration for our own escape behavior. This behavior should use the two touch sensors mounted on front of the robot to avoid driving into small objects that might not be seen by the ultrasound sensor.
|
|
|
|
|
|
The turns of the pseudo code of page 305 in [2] was initially implemented by just powering one motor, but that didn't work so now we power forward in one and backwards in one. This worked well, even though we had the other behaviors turned on, so they affected the run. We tried with them turned off aswell, and it worked even better this time.
|
|
|
Initially we basically copied earlier mentioned pseudocode (without the flags). This ment, that the left - and right turn was naively implemented by powering up one motor and leaving the other. This resulted in the robot driving even more into the detected object instead of avoiding it as it turned too slow. Instead we tried to back op the unused motor as the other drove forward to make the robot turn more rappidly, which seemed to work even though the run was affected by the other behaviors as the avoid behavoir would be triggered before the escape behavior. We therefore turned off the other behaviors to observe wether the escape behavoir worked as expected. The result of the rappidly turning escape behavior with no avoid behavior can be seen in video 5.
|
|
|
|
|
|
[![Implemented Escape behavior](http://img.youtube.com/vi/nINQb163pyQ/0.jpg)](https://www.youtube.com/watch?v=nINQb163pyQ)
|
|
|
*Video 5: Robot avoiding obstacles using an Escape behavior via the TouchSensor.*
|
|
|
*Video 5: Robot avoiding obstacles using an Escape behavior via the TouchSensor and with no Avoid behavior.*
|
|
|
|
|
|
[TODO skriv ovenstående afsnit sammenhængende]
|
|
|
The final implementation of our Escape behavior can be found in [6].
|
|
|
|
|
|
### Motor for light sensor
|
|
|
We just changed the car movement to a new motor. We used too much power though! TODO Insert video of motorized choking of robot. Delay was 500 at first, but we changed that to 100. TODO Insert picture of motorized light sensor.
|
... | ... | |