a6124b43b9082a5ba85e19b5ef01fcfbb35d3eea
[bachelor-thesis/written-stuff.git] / Ausarbeitung / preliminaries.tex
1 \chapter{Preliminaries}
2 This chapter describes the preliminary topics. \todo .
3
4 \section{Dead reckoning}
5 The process of \definition{dead reckoning} describes an inexpensive method for
6 relative positioning by computing a vehicle's position from an initial
7 starting position and the covered distance and course it has moved. In the case
8 of mobile robots, the covered distance can be simply computed in real time from
9 the revolution of its wheels, or by accelerometers the robot may be equipped
10 with. However, since the vehicle's current position is based on its previous
11 position, and the distance measurement may be imprecise, dead reckoning has the
12 disadvantage that errors in position calculation can cumulate and the error
13 of the calculated position grows with time.
14
15 Another approach to determine a vehicle's position is absolute positioning, for
16 example satellite-based, over navigation beacons or by map matching. Still,
17 these techniques are rather expensive to deploy, cannot (yet) be used in real
18 time, or are even impreciser than relative approaches\cite{umbmark}, so dead
19 reckoning can still be useful for the time being.
20
21 \section{iRobot Roomba 500}
22 Originally, the \definition{Roomba} is an autonomous vacuum cleaning robot,
23 manufactured by the US-based company \definition{iRobot}. The 500 series
24 currently represents the third generation of iRobot's cleaning robots, and the
25 first generation of robots controllable over an external interface.
26
27 \subsection{Hardware design}
28 \todo{diagram?}
29 \paragraph{Wheels}
30 The Roomba lives in a cylindrical case with diameter of about 34~cm and height
31 of about 7~cm. It has two main wheels which are positioned slightly behind the
32 centerline, so the Roomba leans forward due to gravity, and a small caster on
33 the front to prevent it from sliding on the floor. The main wheels can be
34 controlled over two independent motors, each one allowing to turn the connected
35 wheel with a minimum of 10~mm/s and a maximum of 500~mm/s in each direction.
36 One of the main wheel motors consumes about 300~mA in their slowest rotation
37 speed, and about 1000~mA when driving with normal speed. Each wheel is also
38 equipped with a drop sensor that tells if the respective wheel has dropped into
39 a hole or similar, and does not reach the ground anymore. These sensors are
40 realized with a spring pushing the wheel towards the ground, with the spring
41 force adjusted to the Roomba's weight, and a micro switch which triggers if the
42 wheel drops below a specified level. Furthermore, both wheels feature rotating,
43 toothed discs, which in conjunction with an LED and a photo-electric resistor
44 act as an optical interrupter. This system can be used to measure the wheel's
45 current speed by counting the optical interruptions the wheel causes while
46 moving.
47
48 \paragraph{Brushes}
49 In addition to the wheel motors, the Roomba has a motor which operates the
50 vacuum brush, and a small motor on the front connected to a side brush, to allow
51 cleaning of room corners.
52
53 \paragraph{Bumper shield}
54 Since the main movement direction in normal operation is forward, the front of
55 the Roomba consists of a crecent-shaped bumper shield which contains several
56 sensors. This bumper\index{Roomba!bumper} is spring-loaded and on the one
57 hand absorbs shock to reduce damage, on the other hand, it allows the Roomba to
58 detect obstacles in front of it, both via infrared sensors as well as by
59 mechanical means. There are two sensors for mechanical bump detection, located
60 30° to the left and to the right of the bumper's center, each implemented as
61 photo-electrical interruptors. Additionally, six infrared sensors are unevenly
62 distributed over the bumper, facing away from it in a star-like manner. Each one
63 of them allows the Roomba to recognize objects in a maxmimum distance of 10~cm.
64 Finally, the bumper shield contains four infrared sensors facing downwards,
65 acting as cliff sensors \index{Roomba!cliff sensor} to recognize steps or
66 similar chasms which could be dangerous for the Roomba to drive towards.
67
68 The back part of the Roomba contains the main vacuum brush\index{Roomba!vacuum
69 brush}, and the reservoir for holding dirt. Both of them can be removed, though
70 the removal of the main brush reduces the Roomba's weight and slightly
71 unbalances the Roomba so the springs used for the wheel drop sensors are not in
72 balance anymore and push the Roomba upwards, so it tilts more to the front when
73 accelerating forwards. There is also a sensor on the underside
74 \index{Roomba!dirt sensor} for detecting particularly dirty regions of the
75 floor, which is implemented as a capacitive touch sensor.
76
77 \paragraph{Battery}
78 The battery\index{Roomba!battery} is placed in the front part behind the bumper,
79 it is a rechargeable NiMH battery and holds a capacity of 3300~mAh which lasts
80 for about 90 to 120 minutes under normal operation. The Roomba can also find its
81 home base and charge itself when it has finished cleaning or runs out of energy
82 by using a special infrared sensor mounted on top of the Roomba. This sensor can
83 see in all directions and is able to detect the home base by looking for a
84 special infrared signal the home base\index{Roomba!home base} emits. The same
85 principle is used for so-called "`virtual walls"'\index{virtual wall} which can
86 be placed by the user in regions the Roomba should not move into.
87
88 \subsection{Behaviour}
89 \paragraph{Intended Behaviour}
90 The Roomba normally follows its own, non-customizable algorithm to detect dirt
91 and clean rooms. It is kind of a random walk\index{random walk}, controlled by
92 the internal logic, which tries to keep the Roomba away from dangers like
93 stairs and walls (by evaluating the cliff and bump sensors), and direct it to
94 the more dusty regions of the room (by using the dirt sensor). The random walk
95 concept allows a more or less complete coverage of the room, given the time for
96 cleaning is large enough, while at the same only needing very little information
97 about the environment. Of course, that concept is not very efficient when it
98 comes to cleaning rooms, but cleaning time is not neccessarily the constraining
99 factor, and the robot still saves the human some time.
100
101 \paragraph{Roomba Open Interface}
102 However, robots of the Roomba 500 series are also easily controllable over a
103 serial port, which provides a two-way communication at 5~V TTL levels over a
104 Mini-DIN connector, with a speed of either 19,200 or 115,200 Baud. Over this
105 serial port, the Roomba speaks a specified protocol, called the
106 \ignoreoutput{\ac{ROI}}\definition{\acl{ROI}} (\acs{ROI})~\cite{irobot-oi},
107 which allows the user to interact with the robot's internal logic, reading its
108 sensor values, and control its movements and cleaning behaviour.
109
110 After starting the communication with the Roomba by sending the \cmd{Start}
111 command, the robot is in a state called \definition{Passive mode}. In this mode,
112 the user cannot control the robot by himself, but the internal logic defines
113 icants behaviour. However, the user is able to read the internal sensors. The
114 \ac{ROI} then allows the user to set the Roomba into two different modes:
115 \begin{itemize}
116 \item In \definition{Safe mode}, the Roomba monitors the wheel drop, cliff
117 and internal charger sensors, and reverts into Passive mode if safety
118 conditions occur, so the Roomba is not harmed.
119 \item In \definition{Full mode}, the user has full control over the Roomba,
120 and has to take care not to harm the Roomba by evaluating the wheel drop,
121 cliff and internal charger sensors by himself.
122 \end{itemize}
123
124 In particular, every command is assigned an \ac{opcode} of one byte length,
125 followed by a fixed amount of bytes as parameters which depend on the opcode.
126 For example, to drive straight with a velocity of 1000~mm, one would send the
127 following bytes over the serial interface:
128 \begin{verbatim}
129 0x80, // start byte
130 0x83, // safe mode
131 0x89, // drive
132 0x03, 0xe8 // drive: parameter velocity: 0x03e8 == 1000
133 0x80, 0x00 // drive: parameter radius: special value "straight"
134 \end{verbatim}
135
136 A little disadvantage of the \ac{ROI} \cmd{Drive} command is that the robot is
137 modeled as a state machine. In the previous example, the Roomba would keep on
138 driving until it runs out of energy, or a safety condition occurs which causes
139 the Roomba to revert into Passive mode, or a new \cmd{Drive} command with the
140 velocity parameter set to zero is sent. Thus, if the user wants to drive a
141 specific distance, he has to calculate the time interval the robot needs to
142 travel that distance, measure the time interval, and stop the robot after that
143 time interval has passed.
144
145 In our setup, an iRobot Roomba~530 is used as an instance of an autonomous,
146 mobile robot to conduct the experiments described afterwards. For that, the
147 Roomba's movements are controlled over a netbook mounted on top of the Roomba
148 (cf.~Figure~\ref{fig:roombasetup}), which is running Wiselib code.
149
150 \section{Wiselib}
151 The \definition{Wiselib}\cite{wiselib} is a C++ algorithm library for sensor
152 networks, containing for example algorithms for routing, localization and time
153 synchronization, and is strongly focused on portability and cross-platform
154 development. In particular, it allows the user to develop applications that run
155 on different hardware platforms without the need to change the code, and it
156 strongly uses C++ templates to achieve that feature. Amongst the supported
157 platforms are diverse sensor node platforms, like iSense, Contiki and TinyOS,
158 but there are as well implementations for the diverse x86-compatible Personal
159 Computer platforms, and the Shawn sensor network simulator.
160
161 Moreover, the Wiselib includes code to control the iRobot
162 Roomba\index{Roomba~500} over a
163 serial interface, and getting access to its internal sensor data, using the
164 iRobot Roomba Open Interface mentioned earlier.
165
166 \todo{cite Wisebed book chapter on Roomba code}
This page took 0.048497 seconds and 3 git commands to generate.