document update'
[des2015.git] / marsrover / document / robot.tex
1 \section{Robot architecture}
2 \subsection{Tools}
3 \emph{LeJOS}\cite{lejos_team_lejos_2015}
4
5 \subsection{Design patterns}
6 \subsubsection{Leader-Follower}
7 Ultimately we want to only program one robot. The fact that the one robot
8 contains multiple control bricks is something that needs to be abstracted away
9 from. As will be discussed in Section~\ref{sec:mapping} the first brick, from
10 now on \textit{Leader}, has the direct control over all the motors. However the
11 second brick, from now on \textit{Follower}, controls no motors. Both the
12 \textit{Leader} and the \textit{Follower} control $4$ sensors. Because of this
13 configuration the \textit{Follower} only needs to send its sensor data to the
14 \textit{Leader}. There is no need to communicate anything back since the
15 \textit{Follower} can not respond in any physical way. An option could be to
16 distribute the processing power but due to the strength of the bricks and the
17 limitation of the bluetooth this is very hard or even impossible to achieve.
18
19 \subsubsection{Subsumption}
20 As the higher level architecture we use a slightly adapted version of the
21 subsumption architecture first described by Brooks\cite{brooks_robust_1986}.
22 We use the pre-implemented architecture from the \emph{LeJOS} where with the
23 use of a \texttt{suppressed} flag in every behaviour we can start and interrupt
24 the behaviour. Our version is a little bit adapted from the original
25 subsumption behaviour because in our implementation the robot can finish the
26 designated task even if the behaviour does not want control anymore. For
27 example when the left light sensor detects that the robot is driving of the
28 planet a right turn of $90$ degrees may be initiated. This right turn will be
29 completed even when the left light sensor is not detecting a dangerous value.
30 The suppressed flag can take three states. \texttt{IDLE}, \texttt{IN\_ACTION}
31 and \texttt{SUPPRESSED}. By default all behaviours have the \texttt{IDLE}
32 state. When a behaviour is started the state will change to \texttt{IN\_ACTION}
33 and when a behaviour finished the state will be reset to \texttt{IDLE}. When a
34 behaviour needs to be interrupted the state is set to \texttt{SUPPRESSED} and
35 since the behaviour is always monitoring the state it will shutdown as soon as
36 possible and reset the state.
37
38 \subsection{Mapping of the sensors and actuators}\label{sec:mapping}
39 The actuators are all plugged into the master brick to achieve the maximum
40 safety in case the \emph{Bluetooth} connection fails between the master and the
41 slave and one of the actuators is moving. All the safety-critical sensors for
42 movement are placed on the master brick too. All other sensors are placed on
43 the slave brick. Any increased latency on those sensors will not danger the
44 safety. The final mapping is described in \autoref{tab:mapping}.
45
46 \begin{table}[H]
47 \centering
48 \begin{tabular}{lll}
49 \toprule
50 & Master Brick & Slave Brick\\
51 \midrule
52 \multirow{2}{*}{Actuators} & Left motor\\
53 & Right motor & \\
54 & Measurement motor\\
55 \midrule
56 \multirow{4}{*}{Sensors} & Left light sensor & Color sensor\\
57 & Right light sensor & Front ultrasone sensor\\
58 & Back ultrasone sensor & Left touch sensor\\
59 & Gyro sensor & Right touch sensor\\
60 \bottomrule
61 \end{tabular}
62 \caption{Proposed mapping of the sensors and actuators}\label{tab:mapping}
63 \end{table}
64