checkpoint, including makeindex stylefile for index section headers
[bachelor-thesis/written-stuff.git] / Ausarbeitung / wiselib.tex
index 4b84324..1c4cc6c 100644 (file)
@@ -10,6 +10,7 @@ but there are as well implementations for the diverse x86-compatible Personal
 Computer platforms, and the Shawn sensor network simulator.
 
 \subsection{Architecture}
+\label{sec:wiselib:arch}
 \paragraph{Concepts and Models}
 Wiselib makes strong uses of \definition{concepts} and \definition{models} as
 central design objects. Concepts serve as an informal description of interfaces,
@@ -81,66 +82,67 @@ iRobot Roomba\index{Roomba} over a serial interface, and getting access to its
 internal sensor data, using the \ac{ROI}\index{Roomba Open Interface} mentioned
 earlier. For this purpose, it defines two concepts for Robot Motion:
 
-\paragraph{TurnWalkMotion concept}\index{TurnWalkMotion (concept)}
+\paragraph{\concept{TurnWalkMotion} concept}%\index{TurnWalkMotion (concept)}
 This concept represents a simple robot that can turn on the spot and walk
 straight, without automatic stopping.
 \begin{description}
   \item Types:
     \begin{description}
-      \item[\code{velocity\_t}] Type for velocity measurement
-      \item[\code{angular\_velocity\_t}] Type for angular velocity measurement
+      \item[\fnfont{velocity\_t}] Type for velocity measurement
+      \item[\fnfont{angular\_velocity\_t}] Type for angular velocity measurement
     \end{description}
   \item \todo{clearpage?} Methods:
     \begin{description}
-      \item[\code{int turn(angular\_velocity\_t)}] turn the robot with a
+      \item[\fnfont{int turn(angular\_velocity\_t)}] turn the robot with a
         constant angular velocity
-      \item[\code{int move (velocity\_t)}] move the robot straight with a
+      \item[\fnfont{int move (velocity\_t)}] move the robot straight with a
         constant velocity
-      \item[\code{int stop()}] stop the robot
-      \item[\code{int wait\_for\_stop()}] hold the execution until the robot has
-        stopped
+      \item[\fnfont{int stop()}] stop the robot
+      \item[\fnfont{int wait\_for\_stop()}] hold the execution until the robot
+        has stopped
     \end{description}
 \end{description}
 
-\paragraph{Odometer concept}\index{Odometer (concept)}
+\paragraph{\concept{Odometer} concept}%\index{Odometer (concept)}
 This concept represents an Odometer which tracks motions over time.
 Whenever the object turns or moves, internal counters will adjust their
 guessing of the object's traveled distance and current orientation.
 \begin{description}
   \item Types:
     \begin{description}
-      \item[\code{angle\_t}] Type for angle measurement
-      \item[\code{distance\_t}] Type for distance measurement
+      \item[\fnfont{angle\_t}] Type for angle measurement
+      \item[\fnfont{distance\_t}] Type for distance measurement
     \end{description}
   \item Methods:
     \begin{description}
-      \item[\code{angle\_t angle()}] return the current angle
-      \item[\code{int reset\_angle()}] reset the angle of the object
-      \item[\code{distance\_t distance()}] return the current distance
-      \item[\code{int reset\_distance()}] reset the distance of the object
-      \item[\code{int register\_state\_callback (T *obj)}] register a callback
+      \item[\fnfont{angle\_t angle()}] return the current angle
+      \item[\fnfont{int reset\_angle()}] reset the angle of the object
+      \item[\fnfont{distance\_t distance()}] return the current distance
+      \item[\fnfont{int reset\_distance()}] reset the distance of the object
+      \item[\fnfont{int register\_state\_callback (T *obj)}] register a callback
         that gets called when the state changes
-      \item[\code{int unregister\_state\_callback (int)}] unregister a
+      \item[\fnfont{int unregister\_state\_callback (int)}] unregister a
         previously registered callback
-      \item[\code{int state()}] return the current state
+      \item[\fnfont{int state()}] return the current state
     \end{description}
 \end{description}
 
-\paragraph{ControlledMotion class}\index{ControlledMotion (class)}
-On top of the TurnWalkMotion and Odometer concepts builds the
-\textit{ControlledMotion}\index{ControlledMotion (class)} model. It takes
-implementations of each of these concepts as template parameters and extends the
-simple turn-and-walk paradigm by a temporal dimension, which let the robot stop
-after a specific time interval. In particular, it provides the following
-methods:
-\begin{description}
-  \item[\code{int move\_distance(distance\_t, velocity\_t)}] move the robot
+\paragraph{ControlledMotion model}
+On top of the \concept{TurnWalkMotion} and \concept{Odometer} concepts builds
+the \class{ControlledMotion} model. It takes implementations of each of these
+concepts as template parameters and extends the simple turn-and-walk paradigm by
+a temporal dimension, which let the robot stop after a specific time interval.
+In particular, it provides the following methods:
+\begin{description}\item
+\begin{description} % to match with the indentation level above
+  \item[\fnfont{int move\_distance(distance\_t, velocity\_t)}] move the robot
     straight by a given distance with a given velocity
-  \item[\code{int turn\_about(angle\_t, angular\_velocity\_t)}] turn the robot
+  \item[\fnfont{int turn\_about(angle\_t, angular\_velocity\_t)}] turn the robot
     about a given angle with a given angular distance
-  \item[\code{int turn\_to(angle\_t, angular\_velocity\_t)}] turn the robot
+  \item[\fnfont{int turn\_to(angle\_t, angular\_velocity\_t)}] turn the robot
     to a given orientation with a given angular distance
 \end{description}
+\end{description}
 
 The class first registers a callback function at the given Odometer instance,
 and then uses its distance and angle values to control the robot over the
@@ -151,16 +153,15 @@ values exceed the target values, the robot is stopped.
 
 \paragraph{Underlying Roomba Implementation}
 The actual communication with the Roomba is done in the
-\textit{RoombaModel}\index{RoombaModel (class)} class. It implements the
-aforementioned TurnWalkMotion\index{TurnWalkMotion (concept)} and
-Odometer\index{Odometer (concept)} concepts and therewith allows the interaction
-with a ControlledMotion\index{ControlledMotion (class)} instance. In particular,
-it manages the serial communication with the Roomba and translates the function
-calls \code{turn()}, \code{move()} and \code{stop()} of the TurnWalkMotion
-concept to the according parameters for the \ac{ROI} \cmd{Drive} command, reads
-a subset of the Roomba's sensors and presents the sensor data to the user, and,
-while implementing the Odometer concept, calculates the covered distance and
-angle from the Roomba's right and left wheel rotations.
+\class{RoombaModel} class. It implements the
+aforementioned \concept{TurnWalkMotion} and \concept{Odometer} concepts and
+therewith allows the interaction with a \class{ControlledMotion} instance. In
+particular, it manages the serial communication with the Roomba and translates
+the function calls \fnfont{turn()}, \fnfont{move()} and \fnfont{stop()} of the
+TurnWalkMotion concept to the according parameters for the \ac{ROI} \cmd{Drive}
+command, reads a subset of the Roomba's sensors and presents the sensor data to
+the user, and, while implementing the Odometer concept, calculates the covered
+distance and angle from the Roomba's right and left wheel rotations.
 
 The sensor data is read from the Roomba using the \cmd{Stream} command on the
 \ac{ROI}, which results in a sensor data packet (see Section
@@ -192,7 +193,5 @@ After a few test runs, the number of encoder counts per~mm for straight
 walks turned out as $2.27$, and for turning on the spot, $2.27 \times 115 =
 261.05$ encoder counts per radian, which is the number of encoder counts per~mm
 multiplicated with half the Roomba's wheelbase. So when new sensor data is read
-each 15~ms, the RoombaModel implementation calculates the Odometer
-\index{Odometer (concept)} distance and angle from these values.
-
-\todo{cite Wisebed book chapter on Roomba code}
+each 15~ms, the RoombaModel implementation calculates the \concept{Odometer}
+distance and angle from these values.
This page took 0.03415 seconds and 4 git commands to generate.