Professional Documents
Culture Documents
EIS - VGU - 24s - Exercises 2024-04-22 Solution
EIS - VGU - 24s - Exercises 2024-04-22 Solution
Question 1
An Embedded Intelligent Systems is designed for executing the Bug 2 algorithm for
autonomous navigation of a cleaning robot. Explain how the Bug 2 algorithm works.
1. Plan path as a straight line from start pose p(k=0) to destination pose p(k=K).
2. Move along path in the direction of the destination pose p(k=K).
3. If destination pose p(k=K) is reached, terminate.
4. If an obstacle is hit, move clockwise (or counter clockwise) around obstacle.
5. If the path is intersected, continue at 2.
Question 2
a) What are the major steps in the SLAM algorithm using Kalman filter?
1. State Prediction
2. Measurement Prediction
3. Residual Calculation
4. Updated State Prediction
b) What are the two major advantages of using SLAM against just measuring the robot's
position by sensors?
1. Improvement of precision by sensor fusion of sensor (LIDAR, Camera) and encoder.
2. Navigation possible if landmarks (features) are not observable by sensor.
c) Under which conditions are the weights in the Kalman Gain matrix high and under which
conditions are they low?
1. K is high if sensor has low noise (compared to encoder noise).
2. K is low if sensor has high noise (compared to encoder noise).
Question 3
At time k, an autonomous - mobile robot has the belief state p(k):
p(k) = (1, 0, 10°, 6, 10, 8, 10)T
In order to move the robot to the next persuit point p*(k+1), an input u(k) is applied. The
input measured by the encoder is:
u(k) = (5, 4, 90°)T
a) Calculate in detail and traceable the predicted state p(k) and the updated predicted state
p(k) if the sensor measurement is
zm(k+1) = (1.1, -4.1, -0.9, -3.9)T
and all weights in the Kalman Gain matrix are
w1 = w2 = 0.4.
Solution:
1. Predicted State:
p(k+1) = p(k) + u(k) = (ΔxL1, ΔyL1 , ΔxL2 , ΔyL2)T
= (1, 0, 10°, 6, 10, 8, 10)T + (5, 4, 90°, 0, 0, 0, 0)T
= (6, 4, 100°, 6, 10, 8, 10)T
2. Measurement Prediction
z(k+1) = (6, 4, 6, 4) T – (6, 10, 8, 10) T
= (0, -6, -2, -6) T
3. Measurement Residual
v(k+1) = zm(k+1) – z(k+1)
= (1.1, -4.1, -0.9, -3.9)T - (0, -6, -2, -6) T
= (1.1, 1.9, 1.1, 2.1)T
4. Updated State Prediction
^p(k+1) = p(k+1) + K(k+1) v(k+1)
= (6, 4, 100°, 6, 10, 8, 10)T + (0.4 * (1.1+1.1), 0.4 * (1.9 + 2.1), 0, 0, 0, 0, 0)T
= (6.88, 5.6, 100°, 6, 10, 8, 10)T
b) Based on the results of a), is the updated predicted state a better or worse estimate of the
real robot position pr(k+1) than the predicted state? Give the reason for your conclusion.
The robot has moved in reality to:
pr(k+1) = (7, 6, 110°, 6, 10, 8, 10)T
The euclidian distance regarding the robot position (x, y) we get:
|^p(k+1) - pr(k+1)| < |p(k+1) - pr(k+1)|. Hence the updated prediction is closer to the real
position and therefore the better estimate.
Question 4
Given the scenario described in Question 2. Let’s suppose the co-variance matrices as:
P(k) = 1 0 N(k) = 2 0 W(k+1) = 0.5 0
0 1 0 2 = 0 0.5
The measurement matrix is supposed to be the idendity matrix, i.e. H = I
a) Calculate the error of predicted state at k+1, i.e. P(k+1)
P(k+1) = P(k) + N(k)
= 3 0
= 0 3
b) Calculate the Kalman Gain for time k+1
K(k+1) = P(k+1) ((P(k+1) + W(k+1))-1
= 3 0 1/3.5 0
0 3 0 1/3.5
= 6/7 0
0 6/7
Question 5
Given is the topologic map below. Calculate the optimal path of the from r to z in detail step
by step by means of the Dijkstra algorithm.
6 A
r
4
4
B 2
D 2
8 2
3 z
E
C 7
Question 6
a) Which features does ROS provide for embedded intelligent systems in robotics
applications?
1. Library with functions for ROS applications
2. Easy message passing between functions by publisher – subscriber concept.
Question 7
a) A smart camera recognizes an object and calculates it’s position in the image as u = 600 and v =
800. The object’s distance is z = 10 m. The specs of the camera are: Focal length f = 3mm, Pixel size
on CCD: h = 1 µm.
Calculate the object’s position in real world coordinates x, y, z.
s = f/h = 3 mm / 1 µm
= 3000
(x,y,z) = (u z/s, v z/s, z)
= (600 * 10 m / 3000, 800 * 10 m / 3000, 10 m)
= (2 m, 2.67 m, 10 m)
b) What is the formular for a convolution in computer vision. Explain the terms of the formular.
Formular:O(u,v) = u v
Explaination: I(u,v): Input Image, O(u,v): Filtered Image, f(m,n): Filter Kernel, Kernel size: MxN
m, n: Filter pixel indices
u,v: Image pixel indices
c) In which computer vision approaches is convolution used and what’s the repective purpose?
i) What are the adavantages and disadvabtages of semantic segmentation compared with feature based
image processing?
Advantage: No a-priori knowledge about object characteristics
Disadvantage: No transparancy
Question 8
An Embedded Intelligent System uses an Embedded RTOS. The following tasks must be executed:
Tsk1: Period = 20 ms, Delay = 1 ms, Execution Time = 5 ms, Priority P(Tsk1) = 0
Tsk2: Period = 23 ms, Delay = 1 ms, Execution Time = 6 ms Priority P(Tsk2) = 1
a) In case a PPS is used: can both tasks executed in realtime? T2 can be interrupted by T1 once during
execution. Explain the reason of your answer.
b) In case an Earliest Deadline First (EDF) scheduling combined with PPS is used and given the
scenario that:
EDF: at t = 5 ms: Tsk2; Deadline in 18 ms → earliest deadline → Tsk1 does not interrupt Tsk2
Tsk1: Deadline in 20 ms
PPS: Check whether Tsk1 (Highest Priority !!) can be executed in realtime if it does not interrupt Tsk2
Remaining time Tsk2 is TR = 2 ms
Tsk1: 20 ms > 8 ms → Executable in realtime (8 ms = 5 ms + 1 ms + TR)
Question 9
An Embedded Intelligent System extracts feature vectors x from objects and classifies them by means
of a Bayes Classifier
a) What are the formulars for the Bayes and the naive Bayes classifier?
Bayes Classifier:
b) What is the condition that the naive Bayes classifier can be used?
c) What ist the a priori and what ist the a posteriori likelihood?
A priori likelihood: Likelihood for a class without any condition,
Likelihood for a class before feature extraction.
A posteriori likelihood: Likelihood for a class under the condition of x,
Likelihood for a class after feature extract.
sqrt ( )
e) Which assumptions are made when deriving the Bayes classifier from the Bayes
formular?
Question 10
The training result for a Bayes classifier for 2 features and 3 classes is as follows:
Class Ω1: μ1 = 1 K1-1 = 0.25 0.5
60 0.5 0.01
Class Ω2: μ2 = 0.6 K2-1 = 0.5 1
80 1 0.01
Class Ω3: μ3 = 4 K3-1 = 0.1 0.25
200 0.25 0.002
After training fom an unknown object a feature vector is extracted as follows:
x = 0.5
90
Calculate in detail to which class the feature vector will be classified to.
Question 11
A sensor with the address 0xE8 is connected to an embedded system by means of I2C. The
embedded system executes actions as follows:
Send Start Sequence
Send address of sensor
Send byte 0x51 to sensor
What are the respective C-instructions for execution? Checking the status register is not
required here.