onsdag den 10. november 2010

LAB.8 - Behavior AI


Date: 04/11-2010
Duration of activity: 09:15 - 14:00
Group members participating: All
_____________________________________________
Schedule for the day
- Try the specified car class with sonic sensor.
- Behavior as concurrent threads.(disable the threads and watch them in action seperatly and in pairs)
- Describe
- Add ligth sensing behavior like car 2a and 2b from LAB.7

Problems and progress (notes):
- The car class behaves like one of the bugs from lab 7. when a object is detecded in front the NXT backs up and turn a few degrees and drives forward again. after some time is generates a sound every 10 secounds.
- The display shows the distance measurement and what state the code is in. Indicating if it is in the drive, avoid or sound state.
- only rd: The NXT drives randomly according to the codeformula "50+50*Math.random" on both wheels. It does not interact with the inverement.
- only rd,af: it drives randomly until an obsticle is detected, then it will backup and turn with a speciffic direction and then returning to random drive.
- measured ligth sensor values. Non in front about 36, and nearly in front 26. under table 26
- increased priority for the light thread so it is just beneath distance sensor, but it stil seams like it does not react on the light inverement. By diasbling all but the ligth thread is showed that the ligth values did not give enogth difference in motor power when reacting on ligth.
- [rd] enabled [af] disabled: showed that thread sleep for light sensor needs to be increased to give time for [rd] because only stop for this function was enabled. start delay for light set at 1000 old value was 100.
- [af] enabled: change to priority needed because drive light took all the time [af] can overwrite light and light can overwrite [rd]
- [ps] enabled so it can overwrite [rd]:

note: rd = random drive, af = distance sensor avoid, ps = play sound

Detailed description of solution
- After some of the problems with, the lightdrive overwriting, actual all others behavioral functions. This was a problem, as we wanted the randomdrive and the avoid obstical also to work. So that we get the same behavior out of it as before, just with an new behavior in it, go to the light.
We found that the solution was, to change which behaviors can suppress which.
Finale Status:
- The system worked and we saw the behavior of a bug afraid of ligth an avoiding things in front
- The big issue in the system is the thread individual priority and delay times. extensive testing was needed to get the bug to focus on both ligth/dark attraction and obstacles before it behaved as they had same

Ingen kommentarer:

Send en kommentar