Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision |
marvin:lab10 [2008/11/28 09:14] – deva | marvin:lab10 [2008/11/28 09:16] (current) – deva |
---|
| |
====Project Goal==== | ====Project Goal==== |
In this lab session we will investigate how a behaviour-based architecture(([[http://lejos.sourceforge.net/nxt/nxj/tutorial/Behaviors/BehaviorProgramming.htm]])), has been implemented in the subsumption API of leJOS NXJ. We will investigate the interface lejos.subsumption.Behavior and the class lejos.subsumption.Arbitrator and try to make an alternative implementation of the Arbitrator.\\ | In this lab session we will investigate how a behaviour-based architecture(([[http://lejos.sourceforge.net/nxt/nxj/tutorial/Behaviors/BehaviorProgramming.htm]])), has been implemented in the subsumption API of LeJOS NXJ. We will investigate the interface lejos.subsumption.Behavior and the class lejos.subsumption.Arbitrator and try to make an alternative implementation of the Arbitrator.\\ |
\\ | \\ |
{{marvin:lab10-1.jpg?300}}\\ | {{marvin:lab10-1.jpg?300}}\\ |
===Part Two=== | ===Part Two=== |
Suggest alternative implementation of an Arbitrator that will make sure that ''takeControl'' of all behaviours are called each time through the loop. | Suggest alternative implementation of an Arbitrator that will make sure that ''takeControl'' of all behaviours are called each time through the loop. |
| |
| |
| |
====Execution==== | ====Execution==== |
The program bumberCar.java is run in the NXT and we observe what happens when the touch sensor is kept pressed constantly. We expect the hitWall behaviour to be active making Marvin go backwards and turn over and over. This is not what happens though and the reason for this is found by inspection of the arbitrator within the Lejos system. The source code for the arbitrator is shown below. | The program BumberCar.java is run in the NXT and we observe what happens when the touch sensor is kept pressed constantly. We expect the ''HitWall'' behaviour to be active making Marvin go backwards and turn over and over. This is not what happens though and the reason for this is found by inspection of the arbitrator within the LejOS system. The source code for the arbitrator is shown below. |
| |
The lejOS Arbitrator | The LejOS Arbitrator |
<code java> | <code java> |
public class Arbitrator { | public class Arbitrator { |