Title: P545
1P545 Embedded Real-Time Systems
- Obstacle Avoidance
- by
- Yasir Ibrahim
2Execution per clock tick
- One loop on the following
- Heading control
- Path following
- Laser reading
- Avoid obstacles
- Adjust speed
- Check corridor boundaries
3Heading
- PID
- Continuous control
- Cart turns when the error in the feed back is not
ZERO. - Actually it is not even checking against zero, it
continuously feeds back inputs and issues turn
commands.
4waypoint2
waypoint3
waypoint1
5waypoint2
waypoint3
waypoint1
6waypoint2
waypoint3
Supposed heading
Actual heading (compass)
waypoint1
7waypoint2
waypoint3
Supposed heading
Actual heading (compass)
error
waypoint1
8waypoint2
waypoint3
Supposed heading
Actual heading (compass)
Errorsupposed heading actual
heading Turn_command_inverseperror
P1/(smallest_turn_radiussuitable_angle) P1/(2.0
90.0)
error
waypoint1
9waypoint2
waypoint3
Supposed heading
Actual heading (compass)
Errorsupposed heading actual
heading Turn_command_inverseperror
P1/(smallest_turn_radiussuitable_angle) P1/(2.0
90.0)
error
waypoint1
10GPS follower
- When to pick the next waypoint.
- Two cases
- 1) The distance to the next waypoint is getting
shorter. (till it is less than LBO) - 2) The distance from the previous waypoint is
getting longer. (till it is larger than distance
between the two waypoints) - The heading is working continuously.
11waypoint2
waypoint3
waypoint1
12waypoint2
waypoint3
length
waypoint1
13waypoint2
waypoint3
LBO
length
waypoint1
14waypoint2
waypoint3
LBO
r
length
r lt LBO Or d gt length
d
waypoint1
15waypoint2
waypoint3
LBO
r
length
r lt LBO Or d gt length
d
waypoint1
16waypoint2
waypoint3
r
LBO
d
length
r lt LBO Or d gt length
waypoint1
17waypoint2
waypoint3
d
length
r lt LBO Or d gt length
waypoint1
18waypoint2
waypoint3
waypoint1
19waypoint2
waypoint3
waypoint1
20Obstacle Avoidance
- Reading the laser device.
- Filtering the list (taking only what is in the
carts path). - Averaging the list of obstacles
- Adjusting the output obstacles LBO.
- Keeping history of obstacles, specially the
previous one.
21waypoint2
waypoint3
waypoint1
22waypoint2
waypoint3
waypoint1
23a
Obstacle GPS
c
ab(sin(alpha))
b
Outside when a gt c/2 O_lbo
alpha
GPS
24Obstacle GPS
a
c
ab(sin(alpha))
b
Inside when altc/2 O_lbo
alpha
GPS
25Obstacle GPS
a
c
ab(sin(alpha))
b
Inside when altc/2 O_lbo
alpha
GPS
26a
Obstacle GPS
c
ab(sin(alpha))
b
Inside when altc/2 O_lbo
alpha
GPS
27a
Obstacle1
Obstacle3
c
Obstacle2
Obstacle4
b
1 clock tick
28a
Obstacle1
c
ab(sin(alpha))
b
Inside when altc/2 O_lbo
alpha
GPS
29Obstacle2
a
c
ab(sin(alpha))
b
Inside when altc/2 O_lbo
alpha
GPS
30Obstacle3
a
c
ab(sin(alpha))
b
Inside when altc/2 O_lbo
alpha
GPS
31Obstacle4
a
c
ab(sin(alpha))
b
Outside when agtc/2 O_lbo
alpha
GPS
32Obstacle1
Obstacle3
Obstacle2
c
1 clock tick
33Obstacle1
Obstacle3
Obstacle2
c
1 clock tick
34Obstacle1
Obstacle3
Obstacle2
c
AO0
AO?(Oi AO )/i
ALBO(LBOk-1dLBOk)/2
ddistance(AO,Oj)
1 clock tick
35c
Obstacle 1
1 clock tick
36waypoint2
waypoint3
waypoint1
37waypoint2
waypoint3
Next heading of corridor
Current heading of corridor
waypoint1
38waypoint2
waypoint3
Next heading of corridor
Current heading of corridor
- Next turn is left
- Optimal avoidance from the right of obstacles
waypoint1
39waypoint2
waypoint3
Does not fit
waypoint1
40waypoint2
waypoint3
Fits
waypoint1
41waypoint2
waypoint3
Fits
Synthesized waypoint
waypoint1
42waypoint2
waypoint3
Becomes my next waypoint
waypoint1
43waypoint2
waypoint3
waypoint4
waypoint1
44waypoint2
waypoint3
waypoint4
waypoint1
45waypoint2
waypoint3
waypoint4
waypoint1
46waypoint2
waypoint3
waypoint4
waypoint1
47waypoint2
waypoint3
waypoint4
waypoint1
48waypoint2
waypoint3
waypoint4
waypoint1
49waypoint2
waypoint3
waypoint4
waypoint1
50waypoint2
waypoint3
waypoint4
waypoint1
51More obstacles
52waypoint2
waypoint3
waypoint4
waypoint1
53waypoint2
waypoint3
waypoint4
waypoint1
54waypoint2
waypoint3
waypoint4
waypoint1
55waypoint2
waypoint3
waypoint4
waypoint1
56waypoint2
waypoint3
waypoint4
waypoint1
57waypoint2
waypoint3
waypoint4
waypoint1
58waypoint2
waypoint3
waypoint4
waypoint1
59waypoint2
waypoint3
waypoint1
60waypoint2
waypoint3
waypoint4
waypoint1
61waypoint2
waypoint3
waypoint4
waypoint1
62waypoint2
waypoint3
waypoint4
waypoint1
63waypoint2
waypoint3
waypoint4
waypoint1
64waypoint2
waypoint3
waypoint4
waypoint1
65waypoint2
waypoint3
waypoint4
waypoint1
66waypoint2
waypoint3
Does not fit
waypoint4
waypoint1
67waypoint2
waypoint3
Fits
waypoint4
waypoint1
68waypoint2
waypoint3
Fits
waypoint5
waypoint4
Synthesized waypoint
waypoint1
69waypoint2
waypoint3
Becomes my next waypoint
waypoint5
waypoint4
waypoint1
70waypoint2
waypoint3
Becomes my next waypoint
waypoint5
waypoint4
If overlaps with my current waypoint, replace.
waypoint1
71waypoint2
waypoint3
Becomes my next waypoint
waypoint5
waypoint4
If overlaps with my current waypoint, replace.
waypoint1
72waypoint2
waypoint3
Becomes my next waypoint
waypoint5
waypoint4
If overlaps with my current waypoint, replace.
waypoint1
73waypoint2
waypoint3
Becomes my next waypoint
waypoint5
waypoint4
If overlaps with my current waypoint, replace.
waypoint1
74waypoint2
waypoint3
waypoint6
Becomes my next waypoint
waypoint5
waypoint1
75waypoint2
waypoint3
waypoint6
Becomes my next waypoint
waypoint5
waypoint1
76waypoint2
waypoint3
waypoint6
Becomes my next waypoint
waypoint5
waypoint1
77waypoint2
waypoint3
STOP
STOP
waypoint6
Becomes my next waypoint
waypoint5
waypoint1
78waypoint2
waypoint3
waypoint4
waypoint1
79waypoint2
waypoint3
waypoint4
waypoint1
80waypoint2
waypoint3
fits
waypoint4
waypoint1
81waypoint2
waypoint3
waypoint5
Synthesize waypoint
waypoint4
waypoint1
82waypoint2
waypoint3
waypoint5
Synthesize waypoint
waypoint4
Average waypoint4 and waypoint5
waypoint1
83waypoint2
waypoint3
waypoint5
Synthesize waypoint
waypoint4
Average waypoint4 and waypoint5
waypoint1
84waypoint2
waypoint3
waypoint5
Synthesize waypoint
waypoint4
Average waypoint4 and waypoint5
waypoint1
85waypoint2
waypoint3
waypoint5
Synthesize waypoint
waypoint4
Average waypoint4 and waypoint5
waypoint1
86waypoint2
waypoint3
waypoint5
Synthesize waypoint
waypoint4
Average waypoint4 and waypoint5
waypoint1
87waypoint2
waypoint3
waypoint5
Synthesize waypoint
waypoint4
Average waypoint4 and waypoint5
waypoint1
88Staying inside corridor
- Synthesized collision bubble.
- How far it is synthesized depends on carts
speed. - It can be used to control speed (accelerate,
decelerate, and stop) and help in heading control
(pushing bigger error to the heading control to
force on turning if the cart is going out the
corridor).
89waypoint2
waypoint3
waypoint1
90?
91It Is a synthesized point. Same as if it were a
synthesized waypoint Or an obstacle.
?
92It Is a synthesized point. Same as if it were a
synthesized waypoint Or an obstacle.
?
Speed
93It Is a synthesized point. Same as if it were a
synthesized waypoint Or an obstacle.
?
Speed
(D)istance from GPS to the carts font
94It Is a synthesized point. Same as if it were a
synthesized waypoint Or an obstacle.
How far Speed/2.0D
Speed
(D)istance from GPS to the carts font
95It Is a synthesized point. Same as if it were a
synthesized waypoint Or an obstacle.
How far Speed/2.0D
Speed 3.0 m/s
(D)istance from GPS to the carts font
1.6764 m
96It Is a synthesized point. Same as if it were a
synthesized waypoint Or an obstacle.
How far Speed/4.0D How far 3.0/4.01.6764
2.4264 m From the GPS. Or How far 2.4264
1.6764 0.75m From the front of the cart.
Speed 3.0 m/s
(D)istance from GPS to the carts font
1.6764 m
97waypoint2
waypoint3
0.5
2
waypoint1
98waypoint2
waypoint3
0.75
3
waypoint1
99waypoint2
waypoint3
1.0
4
The cart is going out
waypoint1
100waypoint2
waypoint3
1.0
4
The cart is going out
Signal to slow down
waypoint1
101waypoint2
waypoint3
0.75
3
Slowed down
waypoint1
102waypoint2
waypoint3
Slowed down
waypoint1
103waypoint2
waypoint3
Slowed down
waypoint1
104- Also,
- Collision bubble can be used to know if
the cart is going out from the side of corridor.
105waypoint2
waypoint3
waypoint1
106waypoint2
waypoint3
waypoint1
107Bubble LBO
a
ab(sin(alpha))
b
Outside when a Bubble LBO gt LBO
alpha
LBO
108Bubble LBO
a
ab(sin(alpha))
b
Outside when a Bubble LBO gt LBO
alpha
LBO
109Bubble LBO
a
b
ab(sin(alpha))
Inside when a Bubble LBOlt LBO
alpha
LBO
110Path planning
- At each cycle, an algorithm iterates through all
the waypoints and obstacles together. - The algorithm adds two more waypoints at each
existing waypoint. One before and one after the
waypoint. - The algorithm synthesizes the best waypoint
around obstacles.
111 112(No Transcript)
113Safety
114- try
- adjust_speed()
- if (signal_stop False)
- read_laser()
- follow_path()
- if(panicTrue)
- self.which_side_of_obstacle()
self.synthesize_waypoint() - self.put_synthesized_waypoint()
- self.panicFalse
- catch
115- Default value for speed. Always storing the
previous value. - If one of the following sensors are providing
unacceptable values (same value for along time or
empty values), exception is thrown - GPS, Compass, or Laser.
116