-
Notifications
You must be signed in to change notification settings - Fork 651
Expand file tree
/
Copy pathrobotics-exercises.tex
More file actions
405 lines (351 loc) · 18 KB
/
robotics-exercises.tex
File metadata and controls
405 lines (351 loc) · 18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
%%%% 25.3: Robotic Perception (2 exercises, 2 labelled)
%%%% ==================================================
\begin{exercise}[mcl-biasdness-exercise]%
Monte Carlo localization is {\em biased} for any finite sample size---i.e., the
expected value of the location computed by the algorithm differs from the true expected value---because of the way
particle filtering works. In this question, you are asked to quantify this bias.
To simplify, consider a world with four possible robot
locations: \(X=\{x_\N{1},x_\N{2},x_\N{3},x_\N{4}\}\). Initially, we draw \(N\geq \N{1}\)
samples uniformly from among those locations. As usual, it is
perfectly acceptable if more than one sample is generated for any of
the locations \(X\). Let \(Z\) be a Boolean sensor variable
characterized by the following conditional probabilities:
\begin{eqnarray*}
P(z\mid x_\N{1}) &=& \N{{0.8}} \qquad\qquad P(\lnot z\mid x_\N{1})\;\;=\;\;\N{{0.2}} \\
P(z\mid x_\N{2}) &=& \N{{0.4}} \qquad\qquad P(\lnot z\mid x_\N{2})\;\;=\;\;\N{{0.6}} \\
P(z\mid x_\N{3}) &=& \N{{0.1}} \qquad\qquad P(\lnot z\mid x_\N{3})\;\;=\;\;\N{{0.9}} \\
P(z\mid x_\N{4}) &=& \N{{0.1}} \qquad\qquad P(\lnot z\mid x_\N{4})\;\;=\;\;\N{{0.9}}\ .
\end{eqnarray*}
MCL uses these probabilities to generate particle weights, which are
subsequently normalized and used in the resampling process. For
simplicity, let us assume we generate only one new sample in the
resampling process, regardless of \(N\). This sample might correspond
to any of the four locations in \(X\). Thus, the sampling process
defines a probability distribution over \(X\).
\begin{enumerate}
\item What is the resulting probability distribution
over \(X\) for this new sample? Answer this question separately for
\(N=\N{1},\ldots,\N{{10}}\), and for \(N=\infty\).
\item The difference between two probability distributions \(P\) and \(Q\)
can be measured by the KL divergence, which is defined as
\[
\J{KL}(P,Q) = \sum_i P(x_i)\log\frac{P(x_i)}{Q(x_i)}\ .
\]
What are the KL divergences between the distributions in (a)
and the true posterior?
\item
What modification of the problem formulation (not the algorithm!)
would guarantee that the specific estimator above is unbiased even for
finite values of \(N\)? Provide at least two such modifications (each
of which should be sufficient).
\end{enumerate}
\end{exercise}
% id=25.0 section=25.3
\begin{exercise}[mcl-implement-exercise]\prgex%
Implement Monte Carlo localization for a simulated robot with range
sensors. A grid map and range data are available from the code repository
at \url{aima.cs.berkeley.edu}.
%% http://www.cs.cmu.edu/~thrun/16-899/data
You should demonstrate successful global
localization of the robot.
\end{exercise}
% id=25.1 section=25.3
%%%% 25.4: Planning to Move (6 exercises, 4 labelled)
%%%% ================================================
%% \begin{figure}
%% \figbox{figures/figRobot1.eps}
%% %\centerline{\psfig{figure=figRobot1.eps}}
%% \caption{Robot configuration}
%% \label{figRobot1}
%% \end{figure}
\begin{figure}
\figboxnew{figures/figRobot2.eps}
%\centerline{\psfig{figure=figRobot2.eps}}
\caption{A Robot manipulator in two of its possible configurations.}
\label{figRobot2}
\end{figure}
\begin{exercise}[AB-manipulator-ex]
Consider a robot with two simple manipulators, as shown in
figure~\ref{figRobot2}.
Manipulator A is a square block of side 2
which can slide back and on a rod that
runs along the x-axis from x=$-$10 to x=10.
Manipulator B is a square block of side 2
which can slide back and on a rod that
runs along the y-axis from y=$-$10 to y=10.
The rods lie outside the plane of manipulation, so
the rods do not interfere with the movement of the blocks.
A configuration is then a pair $\la x,y\ra$
where $x$ is the x-coordinate of the center of manipulator A and
where $y$ is the y-coordinate
of the center of manipulator B.
Draw the configuration space for this robot, indicating the permitted and
excluded zones.
\end{exercise}
% id=extras-28-oct.0 section=25.4.1
\begin{uexercise}
Suppose that you are working with the robot in \exref{AB-manipulator-ex} and you are given
the problem of finding a path from the starting configuration of
figure~\ref{figRobot2} to the ending configuration. Consider a potential
function
\[ D(A, \J{Goal})^2 + D(B, \J{Goal})^2 + \frac{1}{D(A, B)^2}
\]
where \(D(A,B)\) is the distance between the closest points of A and B.
\begin{enumerate}
\item Show that hill climbing in this potential field will get
stuck in a local minimum.
\item Describe a potential field where hill climbing will solve this
particular problem. You need not work out the exact numerical coefficients
needed, just the general form of the solution. (Hint: Add a term that ``rewards"
the hill climber for moving A out of B's way, even in a case like this where
this does not reduce the distance from A to B in the above sense.)
\end{enumerate}
\end{uexercise}
% id=extras-28-oct.1 section=25.4.1
%% \begin{iexercise} %fe-f02
%% Consider the problem of configuration space path planning in $d$ dimensions using a
%% cell decomposition where each cell is a hypercube. Two cells are adjacent if they share (part of) a face.
%% Here are three possible algorithms, all of which run A$^*$ with a straight-line distance heuristic
%% and generate as successors only those cells in the current decomposition that are adjacent to the given cell.
%% \begin{itemize}
%% \item Algorithm (i) uses a successor function that returns only pure free-space cells.
%% \item Algorithm (ii) uses a successor function that may return mixed free-space/obstacle cells (but no pure obstacle cells).
%% \item Algorithm (iii) is the same as (ii) except that,
%% if the node it selects for expansion corresponds to a mixed cell, it subdivides the cell
%% into hypercubes whose sides are exactly half the size of the original, puts the new cells back in the queue,
%% and repeats the selection step. (For now, assume exact arithmetic.)
%% \end{itemize}
%% \begin{enumerate}
%% \item Which algorithms are sound (i.e., return only correct solutions)?
%% \item Which algorithms are sound and complete (i.e., return a correct solution exactly when one exists)?
%% \item Are there are problems on which (i) succeeds but (iii) fails to terminate?
%% \item Briefly explain how to make algorithm (iii) $\epsilon$-complete, meaning that
%% it always finds a path if one exists that does not come within $\epsilon$ of an obstacle.
%% \end{enumerate}
%% \end{iexercise}
%% % id=extras-28-oct.4 section=25.4.1
\begin{uexercise}[inverse-kinematics-exercise]%
Consider the robot arm shown in \figref{FigArm1}. Assume that the
robot's base element is 60cm long and that its upper arm and forearm are
each 40cm long. As argued on
\pgref{inverse-kinematics-not-unique}, the inverse kinematics of a
robot is often not unique. State an explicit closed-form solution of
the inverse kinematics for this arm. Under what exact
conditions is the solution unique?
\end{uexercise}
% id=25.2 section=25.4
\begin{iexercise}[inverse-kinematics-exercise]%
Consider the robot arm shown in \figref{FigArm1}. Assume that the
robot's base element is 70cm long and that its upper arm and forearm are
each 50cm long. As argued on
\pgref{inverse-kinematics-not-unique}, the inverse kinematics of a
robot is often not unique. State an explicit closed-form solution of
the inverse kinematics for this arm. Under what exact
conditions is the solution unique?
\end{iexercise}
% id=25.2 section=25.4
\begin{exercise}[voronoi-exercise]\prgex%
Implement an algorithm for calculating the
Voronoi diagram of an arbitrary 2D environment, described by an \(n\stimes n\) Boolean array.
Illustrate your algorithm by plotting the Voronoi diagram for 10 interesting maps.
What is the complexity of your algorithm?
\end{exercise}
% id=25.3 section=25.4
\begin{exercise}[confspace-exercise]%
This exercise explores the relationship between workspace and configuration space
using the examples shown in \figref{FigEx2}.
\begin{enumerate}
\item Consider the robot
configurations shown in \figref{FigEx2}(a) through (c), ignoring the
obstacle shown in each of the diagrams. Draw the corresponding arm
configurations in configuration space. ({\em Hint:} Each arm configuration
maps to a single point in configuration space, as illustrated in
\figref{FigArm1}(b).)
\item Draw the configuration space for each of the workspace diagrams in
\figref{FigEx2}(a)--(c). ({\em Hint:} The configuration spaces share
with the one shown in \figref{FigEx2}(a) the region that corresponds
to self-collision, but differences arise from the lack of enclosing
obstacles and the different locations of the obstacles in these
individual figures.)
\item For each of the black dots in \figref{FigEx2}(e)--(f), draw the
corresponding configurations of the robot arm in workspace. Please
ignore the shaded regions in this exercise.
\item The configuration spaces shown in \figref{FigEx2}(e)--(f) have
all been generated by a single workspace obstacle (dark shading), plus
the constraints arising from the self-collision constraint (light
shading). Draw, for each diagram, the workspace obstacle that corresponds
to the darkly shaded area.
\item \figref{FigEx2}(d) illustrates that a single
planar obstacle can decompose the workspace into two disconnected
regions. What is the maximum number of disconnected regions that can be
created by inserting a planar obstacle into an obstacle-free,
connected workspace, for a 2DOF robot? Give an example, and argue why
no larger number of disconnected regions can be created. How about a
non-planar obstacle?
\end{enumerate}
\end{exercise}
% id=25.4 section=25.4
\begin{figure}[t]
\threebytwofigboxnew{figures/exerciseRobot1.eps}{figures/exerciseRobot3.eps}{figures/exerciseRobot6.eps}{figures/exerciseConf2.eps}{figures/exerciseConf4.eps}{figures/exerciseConf5.eps}
\caption{Diagrams for \protect\exref{confspace-exercise}.}
\label{FigEx2}
\end{figure}
% id=25.5 section=25.4
%%%% 25.6: Moving (3 exercises, 2 labelled)
%%%% ======================================
\begin{exercise}
Consider a mobile robot moving on a horizontal surface. Suppose that the
robot can execute two kinds of motions:
\begin{itemize}
\item Rolling forward a specified distance.
\item Rotating in place through a specified angle.
\end{itemize}
The state of such a robot can be characterized in terms of three
parameters $\la x,y,\phi$, the x-coordinate and y-coordinate of the robot
(more precisely, of its center of rotation) and the robot's orientation
expressed as the angle from the positive x direction. The action
``$Roll(D)$'' has the effect of changing state $\la x,y,\phi$ to
$\la x+D \cos(\phi), y+D \sin(\phi), \phi \ra$, and the action $Rotate(\theta)$
has the effect of changing state $\la x,y,\phi \ra$ to
$\la x,y, \phi + \theta \ra$.
\begin{enumerate}
\item
Suppose that the robot is initially at $\la 0,0,0 \ra$ and then executes
the actions $Rotate(60^{\circ})$, $Roll(1)$, $Rotate(25^{\circ})$, $Roll(2)$.
What is the final state of the robot?
\item Now suppose that the robot has imperfect control of its own rotation,
and that, if it attempts to rotate by $\theta$, it may actually rotate by any
angle between $\theta-10^{\circ}$ and $\theta+10^{\circ}$. In that case,
if the robot attempts to carry out the sequence of actions in (A), there is
a range of possible ending states. What are the minimal and maximal values
of the x-coordinate, the y-coordinate and the orientation in the final state?
\item Let us modify the model in (B) to a probabilistic model in which,
when the robot attempts to rotate by $\theta$, its actual angle of rotation
follows a Gaussian distribution with mean $\theta$ and standard deviation
$10^{\circ}$. Suppose that the robot executes the actions $Rotate(90^{\circ})$,
$Roll(1)$. Give a simple argument that (a) the expected value of the location
at the end is not equal to the result of rotating exactly $90^{\circ}$ and
then rolling forward 1 unit, and (b) that the distribution of locations
at the end does not follow a Gaussian. (Do not attempt to calculate
the true mean or the true distribution.)
The point of this exercise is that rotational uncertainty quickly gives rise
to a lot of positional uncertainty and
that dealing with rotational uncertainty is
painful, whether uncertainty is treated in terms of hard intervals
or probabilistically, due to the fact that the relation between orientation
and position is both non-linear and non-monotonic.
\end{enumerate}
\end{exercise}
% id=extras-28-oct.2 section=25.6
\begin{figure}[t]
%%\epsfxsize12cm
\figboxspacenew{10pt}{figures/robotics-pic7.eps}
\caption{Simplified robot in a maze. See \protect\exref{robot-exploration-exercise}.}
\label{FigEx3}
\end{figure}
% id=25.6 section=25.6
\begin{exercise}[robot-exploration-exercise]%
Consider the simplified robot shown in
\figref{FigEx3}. Suppose the robot's Cartesian coordinates are
known at all times, as are those of its goal location. However, the
locations of the obstacles are unknown. The robot can sense obstacles
in its immediate proximity, as illustrated in this figure. For
simplicity, let us assume the robot's motion is noise-free, and the
state space is discrete. \figref{FigEx3} is only one example; in
this exercise you are required to address all possible grid worlds
with a valid path from the start to the goal location.
\begin{enumerate}
\item Design a deliberate controller
that guarantees that the robot always reaches its goal
location if at all possible. The deliberate controller can memorize
measurements in the form of a map that is being acquired as the robot
moves. Between individual moves, it may spend arbitrary time
deliberating.
\item Now design a {\em reactive}
controller for the same task. This controller may not memorize past
sensor measurements. (It may not build a map!) Instead, it has to make
all decisions based on the current measurement, which includes
knowledge of its own location and that of the goal. The time to make
a decision must be independent of the environment size or the number
of past time steps. What is the maximum number of steps that it may
take for your robot to arrive at the goal?
\item
How will your controllers from (a) and (b) perform if any of the
following six conditions apply:
continuous state space,
noise in perception,
noise in motion,
noise in both perception and motion,
unknown location of the goal (the goal can be detected only when within sensor range),
or
moving obstacles. For each condition and each controller,
give an example of a situation where the robot fails (or explain why it cannot fail).
\end{enumerate}
\end{exercise}
% id=25.7 section=25.6
\begin{exercise}[subsumption-exercise]%
In \figref{Fig5}(b) on \pgref{Fig5}, we encountered an augmented finite state
machine for the control of a single leg of a hexapod robot. In this
exercise, the aim is to design an AFSM that, when combined with
six copies of the individual leg controllers, results in efficient, stable locomotion.
For this purpose, you have to augment the individual leg
controller to pass messages to your new AFSM and to wait until other
messages arrive. Argue why your controller is efficient, in
that it does not unnecessarily waste energy (e.g., by sliding legs),
and in that it propels the robot at reasonably high speeds.
Prove that your controller satisfies the dynamic stability condition
given on \pgref{polygon-stability-condition-page}.
\end{exercise}
% id=25.8 section=25.6
%%%% 25.7: Robotic Software Architectures (1 exercises, 1 labelled)
%%%% ==============================================================
\begin{exercise}[human-robot-exercise]%
(This exercise was first devised by Michael
Genesereth\nindex{Genesereth, M.~R.} and Nils Nilsson\nindex{Nilsson,
N.~J.}. It works for first graders through graduate students.) Humans
are so adept at basic household tasks
that they often forget how complex these tasks are. In this exercise
you will discover the complexity and recapitulate the last 30 years of
developments in robotics.\index{robot!game (with humans)}\index{game!robot (with humans)}
Consider the task of building an arch out of three blocks. Simulate a robot
with four humans as follows:
{\bf Brain.} The Brain direct the hands in the execution of a
plan to achieve the goal. The Brain receives input from the Eyes, but {\em cannot see the
scene directly}. The brain is the only one who knows what the goal is.
{\bf Eyes.} The Eyes report a brief description of the
scene to the Brain:
``There is a red box standing on top of a green box, which is on its
side'' Eyes can also answer
questions from the Brain such as, ``Is there a gap between the Left
Hand and the red box?'' If you have a video camera, point it at the
scene and allow the eyes to look at the viewfinder of the video camera,
but not directly at the scene.
{\bf Left hand} and {\bf right hand.} One person plays each Hand.
The two Hands stand next to each other, each wearing an oven mitt on one hand,
Hands execute only simple commands from the Brain---for example,
``Left Hand, move two inches forward.'' They cannot execute commands
other than motions; for example, they cannot be commanded to ``Pick up the box.''
The Hands must be {\em blindfolded}. The only sensory capability they
have is the ability to tell when their path is blocked by an immovable
obstacle such as a table or the other Hand. In such cases, they can
beep to inform the Brain of the difficulty.
\end{exercise}
% id=25.9 section=25.7
% \begin{exercise}\label{kalman-exercise}%
% This exercise requires advanced mathematical skills.
% \begin{enumerate}
% \item Derive the extended Kalman filter update equations (\ref{eqEKFLoc1}) and
% (\ref{eqEKFLoc2}) for the one-dimensional case.
% \item
% Calculate the Jacobian of the robot motion
% model \(f\) in (\ref{eqRoboticsMotionModel}) with respect to the
% state \(X_{t}\)
% \item
% Do the same for the measurement model \(h\) as
% defined in Equation (\ref{eqRoboticsSensorModel}).
% \end{enumerate}
% \end{exercise}
%#@-------------------------------------------------------------------------%
%#@-------------------------------------------------------------------------%
%#@-------------------------------------------------------------------------%
%#@-------------------------------------------------------------------------%