Thursday, 26 April 2012

Legolab 10 - Behavioer

Legolab 10 - behavior

Date: 26-04-12
Duration: 3 hours
Group members attending: Tore, Troels & Kristian

Goal
Complete today’s exercises, that is experiment with behavior program given.

Plan
1. Mount pressure and ultra sonic sensors.
2. Get the program running and do tests:
3. Press the touch sensor and keep it pressed. What happens?
4. Implement a third behavior, Exit.
5. Investigate the source code for the Arbitrator.
6. Implement a local thread in DetectWall.
7. Implement the behavior DetectWall so the actions taken also involve to move backwards for 1 sec before turning.
8. Implement the behavior DetectWall so it can be interrupted and started again e.g. if the touch sensor is pressed again while turning.


Execution
1. We mounted the sensors on our usual robot, to make it look like the one shown in the lecture:

3. When the touch sensor is touched, the robot stops, backs away and turns a bit. When the sensor is pressed and held, the before mentioned behavior just loops.

4. The escape mechanism was implemented as a behaviour equal to the others. When DriveForward is active there is no behaviour blocking it. If there is no behaviour blocking the exit mechanism will be invoked immediately. If DetectWall is being invoked, the behaviour of the robot is already blocked rendering the escape mechanism useless for the time.

5. The arbitrator iterates through all the behaviours from the highest to the lowest. This automatically creates hierarchy amongst the the behaviours. First the highest gets the opportunity to takeControl over the robot and so forth.

6. We implemented the ultrasonic sensor in a separate thread. We could, however, not get it to work as intended. The thread was not called correctly, and we could not figure out why.

7. The rest will have to be done some other time.


Status
We went through most of the tests and some of the implementations, and now have a better understanding of how the behavior system works. We would have liked to get more of the threads to work correctly.

No comments:

Post a Comment