This chapter describes the implementation that was used for the aforementioned
experiments. It consists of the measuring programs themselves, which use the
Wiselib Roomba Control, and are written in C++. Additionally, there are several
-Bash and Perl scripts to help with the analysis of the measured data.
+Bash and Perl scripts to assist in the analysis of the measured data.
All code used for this thesis resides in the Wiselib source tree\footnote{see
\url{https://github.com/ibr-alg/wiselib/}, or the \acs{CDROM} attached at the
-end of this book} in the directory \filepath{apps/pc\_apps/roomba\_tests}.
+end of this thesis} in the directory \filepath{apps/pc\_apps/roomba\_tests}.
\section{Measuring}
\label{sec:impl:measuring}
All measured data is written to a log file in the current directory whose name
is based on the type of experiment performed. Every line in that log file
describes one measurement made by the user, and consists of pairs of the form
-\code{key=value}, separated of by whitespace. In particular, the data on each
+\code{key=value}, separated by white space. In particular, the data on each
line are (with key name, in the order of appearance on the line):
\begin{enumerate}[noitemsep]
\item\texttt{svn:} the \ac{SVN} or Git revision the program was compiled from
determined by the program in automatic mode)
\item\texttt{measured\_angle:} the actual turned angle of the Roomba in degree
(measured by the user)
- \item\texttt{velocity:} (the velocity in mm/s sent to the Roomba via the
+ \item\texttt{velocity:} the velocity in mm/s sent to the Roomba via the
\ac{ROI} \cmd{Drive} command (given by the user in manual mode, or
determined by the program in automatic mode)
\end{enumerate}
\includegraphics[width=0.9\textwidth]{images/Implementation-Diagram.pdf}
\caption[File structure of the measuring implementation]{Simplified file
structure of the measuring implementation\label{fig:impl:struct}\\
- yellow: common files used for all three experiments; green: files for
- Experiment~1; blue: files for Experiment~2; red: files for Experiment~3.\\
- An arrow from node $x$ to node $y$ means ``$y$ depends from $x$''.}
+ yellow: common files used for all three experiments; \\
+ green: files for Experiment~1; blue: files for Experiment~2; \\red: files
+ for Experiment~3.\\
+ An arrow from node $x$ to node $y$ is to be read as ``$y$ depends from
+ $x$''.}
\end{figure}
Figure~\ref{fig:impl:struct} shows the file layout of the measuring
-implementation. It reuses components whereever possible, and therefore
+implementation. It reuses components where ever possible, and therefore
consists of three parts (green, blue, red) specific for the three performed
experiments (see Sections~\ref{sec:exp1}, \ref{sec:exp2} and~\ref{sec:exp3}), as
well as a common part (yellow), which contains the elements of the
\paragraph{Input dialog for measured orientation values}
\hyphenation{Tar-get-Va-lue-In-put-Dia-log}
+
+\begin{figure}
+ \centering
+ \includegraphics[width=0.4\textwidth]{images/target_value_input_dialog.png}
+ \caption{The \class{TargetValueInputDialog}}
+\end{figure}
+
The class \class{TargetValueInputDialog}, which is an implementation of a simple
dialog box using the Qt widget framework, resides in the files
\file{target\_value\_input\_dialog.cc} and
of test performed and if automatic or manual mode, the ground type, and the
Roomba's ID, or the \code{-{}-help} switch to display a usage message.
-After that, it instanciates and initializes a \class{RoombaModel} instance,
+After that, it instantiates and initializes a \class{RoombaModel} instance,
while also providing for the needed instances of the \concept{Timer} concept
and the \concept{SerialCommunication} concept, which is needed for the serial
communication with the Roomba. Furthermore, an instance of
Due to an implementation detail inside the \class{RoombaModel} class, the sensor
data returned by the class itself may be corrupt if it is read while new sensor
data packets arriving from the Roomba are processed. To prevent this corruption,
-we register a callback function which gets called everytime new sensor data is
+we register a callback function which gets called every time new sensor data is
available (i.~e. the sensor data packets have been fully processed, which is
every 15~ms as we are using the \cmd{Stream} command), and let the callback
function perform a deep copy of the sensor values we are interested in.
Section~\ref{sec:exp1:setup}, and slightly scrambled to ensure independence of
the measurements. Furthermore, the file name for the log file to record the
measured values is determined from the operation mode, the type of experiment
-performed, and the Unix timestamp\footnote{The Unix timestamp is a signed
+performed, and the Unix time stamp\footnote{The Unix time stamp is a signed
integer which is defined as the seconds elapsed since January 1st, 1970, 0:00
\ac{UTC}}. To ease measurement of angles, if the type of experiments are turn
movements, the user is prompted once to input the current orientation of the
\item \textbf{In manual mode:} Prompt the user for a new pair of velocity and
input value \\
\textbf{In automatic mode:} For each pair of velocity and input value
- specified in the previously definied arrays, do the following:
+ specified in the previously defined arrays, do the following:
\item Carry out the specified movement using the \class{ControlledMotion}
instance
\item Prompt the user for the measured value using the
\subsection{Implementation for Experiment~2:
Application \prog{mean\_correction\_test}}
+\label{sec:impl:mean}
Additionally, the program \prog{mean\_correction\_test} for Experiment~2 uses
the class \class{CorrectedMeanMotion} from \file{corrected\_mean\_motion.h}.
This class adapts the input value according to the fit function determined from
\subsection{Implementation for Experiment~3: Application
\prog{soft\_start\_test}}
+\label{sec:impl:soft}
As the implementation for Experiment~2, the application \prog{soft\_start\_test}
which is built from the file \file{soft\_start.cc} has the same basic layout as
\file{main.cc} from Experiment~1. As previously, it defines a custom movement in
\paragraph{\prog{graph.sh}}
This wrapper script uses Gnuplot to create interactive 3-dimensional plots of
-the original behaviour from Experiment~1, and also includes the fit function as
+the original behavior from Experiment~1, and also includes the fit function as
determined by \ac{GNU} through linear regression. For each pair of ground type
(carpet floor, laminate floor) and experiment type (straight movement, turn on
spot), it opens a Gnuplot window containing a graph with the target value on the