Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Embedded Intelligent Systems Solution Exercises

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).

d) What is a belief state?


The belief state is the robot state labelled with a likelihood this state is the real state. It is
modeled as a Gaussian distribution where the Updated State Prediction is the Mean (it
has the highest likelihood) and the State Error Matrix holds the Variances of this
Gaussian distribution. The belief state of the robot is often displayed as a point cloud.

2024 Summer Term Page 1 Prof. Dr. Peter Nauth


Embedded Intelligent Systems Solution Exercises

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.

2024 Summer Term Page 2 Prof. Dr. Peter Nauth


Embedded Intelligent Systems Solution Exercises

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

c) Calculate the error of updated predicted state at k+1, i.e. ^P(k+1)


^P(k+1) = P(k+1) W(k+1) ((P(k+1) + W(k+1))-1
= 6/7 0 1/2 0
0 6/7 0 1/2
= 3/7 0
0 3/7

2024 Summer Term Page 3 Prof. Dr. Peter Nauth


Embedded Intelligent Systems Solution Exercises

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

2024 Summer Term Page 4 Prof. Dr. Peter Nauth


Embedded Intelligent Systems Solution Exercises

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.

b) What is a node in ROS? How do you start a node?


A node is a SW function. It can be started by:
$ rosrun <package_name> <node_name>

c) What is a package in ROS? How do you start a package?


A package contains several nodes for the dame purpose:
$ roslaunch <package_name>

d) What is a publisher, what is a subscriber and what is a topic in ROS?


A publisher is a node that sends messages.
A subscriber is a node that receives messages.
A topic is a named communication channel.

e) What is the result of the ROS command $ rqt_graph?


Blockdiagram of the whole program structure.

2024 Summer Term Page 5 Prof. Dr. Peter Nauth


Embedded Intelligent Systems Solution Exercises

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?

1. Feature-based CV: In step prepreocessing, purpose: improvement of image


2. Semantic Segmentation: In step convolutional layer, purpose: calculation of feature planes

d) Apply to the image shown on the right a 10 90 90 90 10 10


3x3 lowpass filter on the left upper corner 10 90 90 90 10 10
10 90 90 90 10 10
Rect. Filter: O(1,1) = 63 10 10 10 10 10 10

e) Apply to the image shown on the right a


3x3 highpass filter on the left upper corner
Laplace Filter: O(1,1) = - 80
f) What is the architecture of a semantic segmentation system?
Convolution (CNN), Max Pooling, Fully Connected Network (FCNN), Uppooling
g) What is the result of applying semantic segmentation to an image?

Pixels are labelled as classes

h) How does training of a semantic segmentation system work?


Supervised learning: Enter input image, Compare output image with manually labelled (annotated)
image for adapting weights in CNN and FCNN

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

j) What does HIS stand for?

H: Hue, I: Intensity, S: Saturation

2024 Summer Term Page 6 Prof. Dr. Peter Nauth


Embedded Intelligent Systems Solution Exercises

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.

Tsk1: 20 ms > 6 ms → Executable in realtime (6 ms = 5 ms + 1 ms)


Tsk2: 23 ms > 13 ms → Executable in realtime (13 ms = 6 ms + 1 ms + 1*(5 ms + 1 ms))

b) In case an Earliest Deadline First (EDF) scheduling combined with PPS is used and given the
scenario that:

Tsk2 is requested at t= 0 ms. At t= 5 ms Tsk1 is requested.

Does Tsk1 interrupt Tsk2? Explain the reason of your answer.

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)

2024 Summer Term Page 7 Prof. Dr. Peter Nauth


Embedded Intelligent Systems Solution Exercises

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:

Naive Bayes Classifier:

b) What is the condition that the naive Bayes classifier can be used?

Features must be statistically independent.

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.

d) What ist the Mahalanobis distance?

sqrt ( )

e) Which assumptions are made when deriving the Bayes classifier from the Bayes
formular?

A priori likelihood is almost the same for all classes.

2024 Summer Term Page 8 Prof. Dr. Peter Nauth


Embedded Intelligent Systems Solution Exercises

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.

D1(x) = - (0.5 - 1, 90 - 60) 0.25 0.5 0.5 - 1


0.5 0.01 90 – 60
= 5.9375
D2(x) = 0.995
-217.925 < 0.995 < 5.9375
D3(x) = - 217.925 Maximum

For D1(x) is Maximum -> Decision made for Class Ω1

2024 Summer Term Page 9 Prof. Dr. Peter Nauth


Embedded Intelligent Systems Solution Exercises

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.

2024 Summer Term Page 10 Prof. Dr. Peter Nauth

You might also like