Miniature Autonomous Vehicle Development on Raspberry Pi

23
Miniature Autonomous Vehicle Development on Raspberry Pi Bianca-Cerasela-Zelia Blaga Mihai-Adrian Deac Al-Doori Rami Watheq Yaseen Mihai Negru Radu Dănescu

Transcript of Miniature Autonomous Vehicle Development on Raspberry Pi

Page 1: Miniature Autonomous Vehicle Development on Raspberry Pi

Miniature Autonomous Vehicle Development on

Raspberry Pi

Bianca-Cerasela-Zelia Blaga

Mihai-Adrian Deac

Al-Doori Rami Watheq Yaseen

Mihai Negru

Radu Dănescu

Page 2: Miniature Autonomous Vehicle Development on Raspberry Pi

○ Domain of autonomous vehicles – main purpose is to reduce the number of accidents, the number of emissions, and the time spent in traffic [1]

2Miniature Autonomous Vehicle Development on Raspberry Pi

Introduction

Page 3: Miniature Autonomous Vehicle Development on Raspberry Pi

○ Bosch Future Mobility Challenge 2018 [2]

○ Purpose: conceptualization and implementation of automated 1:10 scale model vehicle; guidance system for different scenarios

„During the competition several driving tasks have to be executed, as fast and precise as possible, on a complex racetrack. In addition, the developed concept must be presented and explained. The challenges

would include sensing the position of the model vehicle, controlling the steering to keep the vehicle on the track, and controlling the speed of the vehicle.”

o Equipment:

➢ Board: Raspberry Pi 3

➢ Camera: Raspberry Pi Camera Module v2

➢ The hardware part was provided by the organizers

➢ Simulated GPS

➢ Track for testing

3Miniature Autonomous Vehicle Development on Raspberry Pi

Motivation

Page 4: Miniature Autonomous Vehicle Development on Raspberry Pi

○ Bosch Future Mobility Challenge 2018 [2]

○ Purpose: conceptualization and implementation of automated 1:10 scale model vehicle; guidance system for different scenarios

„During the competition several driving tasks have to be executed, as fast and precise as possible, on a complex racetrack. In addition, the developed concept must be presented and explained. The challenges

would include sensing the position of the model vehicle, controlling the steering to keep the vehicle on the track, and controlling the speed of the vehicle.”

o Equipment:

➢ Board: Raspberry Pi 3

➢ Camera: Raspberry Pi Camera Module v2

➢ The hardware part was provided by the organizers

➢ Simulated GPS

➢ Track for testing

4Miniature Autonomous Vehicle Development on Raspberry Pi

Motivation

Next: Proposed implementation

Page 5: Miniature Autonomous Vehicle Development on Raspberry Pi

System Architecture

○ Inputs: map.json, start and goal position, GPS, IMU, encoder, camera

○ Outputs: steering angle and speed

○ Main algorithms:

➢ Path planning using A* algorithm

➢ Localization using Kalman Filter for lane detection and tracking

➢ Local and global decision making process

Miniature Autonomous Vehicle Development on Raspberry Pi5

Page 6: Miniature Autonomous Vehicle Development on Raspberry Pi

Map Creation

○ System to simulate the GPS

○ Developed a map reader using Windows Form applications with C#

○ Features:

➢ Map visualization

➢ Node’s neighbors information

➢ Position coordinates

Miniature Autonomous Vehicle Development on Raspberry Pi6

public class NOD{

public string NAME;public string IN_BACK;public string IN_RIGHT;public string IN_AHEAD;public string IN_LEFT;public string OUT_BACK;public string OUT_RIGHT;public string OUT_AHEAD;public string OUT_LEFT;public double[] COORDINATES;

}

Page 7: Miniature Autonomous Vehicle Development on Raspberry Pi

○ The algorithm used in the path planning state for finding the shortest way to the destination is A* [3]

○ The map is structured as an oriented graph

○ This method seeks to minimize the cost to reach the goal using certain heuristics

7Miniature Autonomous Vehicle Development on Raspberry Pi

Path Planning

Page 8: Miniature Autonomous Vehicle Development on Raspberry Pi

○ The tracking system uses the data from the IMU and the encoder to determine the route the car has followed.

𝑥 = 𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒 ∙ cos(𝑦𝑎𝑤)

𝑦 = 𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒 ∙ sin(𝑦𝑎𝑤)

8Miniature Autonomous Vehicle Development on Raspberry Pi

Navigation

Velocity

Yaw angle

○ The steering angle is calculated using the Ackermann steering geometry[4]

𝛼𝑖 = tan−1𝐿

𝑅−𝑇

2

𝛼𝑜 = tan−1𝐿

𝑅+𝑇

2

Page 9: Miniature Autonomous Vehicle Development on Raspberry Pi

9Miniature Autonomous Vehicle Development on Raspberry Pi

Navigation

○ The decision-making level: Finite State Machine with 6 states

1. Idle

2. Path Planning

3. Crossroad

4. Lane Follow

5. Stop

6. Parking

Page 10: Miniature Autonomous Vehicle Development on Raspberry Pi

○ There are three types of moves that can be made in the intersection:

10Miniature Autonomous Vehicle Development on Raspberry Pi

Intersection Handling

Forward

Left; arc of 100cm

Right; arc of 65cm

Page 11: Miniature Autonomous Vehicle Development on Raspberry Pi

11Miniature Autonomous Vehicle Development on Raspberry Pi

Intersection Handling

multiple nodesat the same => intersection coordinates

Nodes before and after intersection are marked as intersection nodes if they are part of the path

Page 12: Miniature Autonomous Vehicle Development on Raspberry Pi

12Miniature Autonomous Vehicle Development on Raspberry Pi

Intersection Handling I

Page 13: Miniature Autonomous Vehicle Development on Raspberry Pi

13Miniature Autonomous Vehicle Development on Raspberry Pi

Intersection Handling II

Page 14: Miniature Autonomous Vehicle Development on Raspberry Pi

14Miniature Autonomous Vehicle Development on Raspberry Pi

Intersection Handling III

GPSyou entered

the

intersection

Page 15: Miniature Autonomous Vehicle Development on Raspberry Pi

15Miniature Autonomous Vehicle Development on Raspberry Pi

Parking

1. Detect the parking sign

2. Move forward to be able make the parking maneuver

3. Move backwards in 3steps with different angle values:• 30cm at angle of -23°• 10cm at angle of 0°• 30cm at angle of 23°

All movements used for parking are

performed at fixed distances using data

from the encoder

Page 16: Miniature Autonomous Vehicle Development on Raspberry Pi

○ 3D lane model [5]

➢ 𝑥0 – the lateral displacement of the car to the middle of the lane;

➢ 𝜑 – the heading displacement of the car from the lane direction;

➢ 𝑤 – the width of the lane;

➢ 𝑐 – the curvature of the road.

𝒙 = 𝒙𝟎 + 𝒄 ∙ 𝒍 + 𝒄 ∙𝒍𝟐

𝟐

16Miniature Autonomous Vehicle Development on Raspberry Pi

Lane Detection and Tracking

Page 17: Miniature Autonomous Vehicle Development on Raspberry Pi

17Miniature Autonomous Vehicle Development on Raspberry Pi

𝑍 =

𝑢𝑉𝑃𝑣𝑉𝑃𝑢𝐿𝑢𝑅

Kalman FilterPrediction:

𝑋 =

𝑥0𝜑𝑤𝑐

𝑋 𝑡 = 𝐴 ∙ 𝑋 𝑡 − 1𝑃 𝑡 = 𝐴 ∙ 𝑃 𝑡 − 1 ∙ 𝐴𝑡 + 𝑄

𝑥0 𝑡 = 𝑥0 𝑡 − 1 + 𝑣 ∙ ∆𝑡 ∙ 𝜑 𝑡 − 1𝜑 𝑡 = 𝜑 𝑡 − 1 + 𝑣 ∙ ∆𝑡 ∙ 𝑐 𝑡 − 1

𝑤 𝑡 = 𝑤 𝑡 − 1𝑐 𝑡 = 𝑐 𝑡 − 1

Measurement update:𝐾 = (𝑃 ∙ 𝐻𝑡) ∙ (𝐻 ∙ 𝑃 ∙ 𝐻𝑡 + 𝑅 )−1

𝑋 𝑡 = 𝑡 + 𝐾 ∙ (𝑍 − 𝑍𝑃)𝑃 = (𝐼 − 𝐾 ∙ 𝐻) ∙ 𝑃

𝑢𝑉𝑃𝑣𝑉𝑃𝑢𝐿𝑢𝑅

= 𝑍

Lane detection steps1. Convert image to grayscale and

select 2 ROIs2. Edge detection

3. Line detection with additional missing line computation

4. Compute intersection points

Page 18: Miniature Autonomous Vehicle Development on Raspberry Pi

○ We have

𝑋 =

𝑥0𝜑𝑤𝑐

𝑙𝑎𝑡𝑒𝑟𝑎𝑙 𝑑𝑖𝑠𝑝𝑙𝑎𝑐𝑒𝑚𝑒𝑛𝑡 𝑜𝑓 𝑡ℎ𝑒 𝑐𝑎𝑟 𝑓𝑟𝑜𝑚 𝑡ℎ𝑒 𝑙𝑎𝑛𝑒 𝑐𝑒𝑛𝑡𝑒𝑟𝑎𝑛𝑔𝑢𝑙𝑎𝑟 𝑑𝑖𝑠𝑝𝑙𝑎𝑐𝑒𝑚𝑒𝑛𝑡 𝑜𝑓 𝑡ℎ𝑒 𝑣𝑒ℎ𝑖𝑐𝑙𝑒 𝑓𝑟𝑜𝑚 𝑡ℎ𝑒 𝑙𝑎𝑛𝑒 𝑜𝑟𝑖𝑒𝑛𝑡𝑎𝑡𝑖𝑜𝑛

𝑙𝑎𝑛𝑒 𝑤𝑖𝑑𝑡ℎ𝑐𝑢𝑟𝑣𝑎𝑡𝑢𝑟𝑒 𝑜𝑓 𝑡ℎ𝑒 𝑟𝑜𝑎𝑑

○ Obtain the angle [6]𝛼 = 𝜑 + 𝑎𝑡𝑎𝑛2(𝑘 ∙ 𝑥0, 𝑣)

○ Use PID controller [7] to adjust the change in steering angle to obtain a smooth motion

18Miniature Autonomous Vehicle Development on Raspberry Pi

Steering Control – Stanley + PID Controller

Page 19: Miniature Autonomous Vehicle Development on Raspberry Pi

○ Use Contour Analysis [8]

19Miniature Autonomous Vehicle Development on Raspberry Pi

Traffic Sign Recognition

Page 20: Miniature Autonomous Vehicle Development on Raspberry Pi

Steps performed by the miniature autonomous vehicle on the race track

Nr. Step Distance (m) Time (s)

1. Lane following with one curb 4.95 35.34

2. Stop sign detection - 0.1

3. Stop - 1

4. Left turn in intersection 1.8 12.85

5. Lane following with two curbs 6.75 48.2

6. Parking sign detection - -

7. Parking 1.4 9

8. Lane following with one curb 4.95 35.34

9. Stop sign detection - 0.1

10. Stop - 1

11. Right turn in intersection 1.35 9.63

12. Lane following 0.9 6.42

13. Stop sign detection - 0.1

14. Stop - 1

15. Left turn in intersection 1.8 12.85

16. Lane following 1.35 9.63

17. Stop sign detection - 0.1

18. Stop - 1

19. Right turn in intersection 1.35 9.63

20. Lane following 1.35 9.63

21. Stop sign detection - 0.1

22. Stop - 1

23. Left turn in intersection 1.8 12.85

24. Lane following 0.9 6.42

25. Stop - 1Miniature Autonomous Vehicle Development on Raspberry Pi

20

Nr. Name Runtime (ms) Runtime (fps)

1. A* path planning 12 -

2. Localization 30 -

3. Lane detection and tracking 22 45

4. Steering control 21 -

5. Traffic sign detection 90 11

Page 21: Miniature Autonomous Vehicle Development on Raspberry Pi

○ Created a novel methodology of designing a miniature self-driving vehicle control

○ Using a simulated GPS, we were able to position the car on the race track

○ The navigation was done by a lane following method that implied lane markings detection and tracking

○ Two types of traffic signs were detected: stop and parking

○ Our team has obtained a lot of experience in the domain of autonomous vehicles that will provide to be useful in future endeavours

21Miniature Autonomous Vehicle Development on Raspberry Pi

Conclusions

Page 22: Miniature Autonomous Vehicle Development on Raspberry Pi

1. A. Simić, O. Kocić, M. Z. Bjelica and M. Milošević, "Driver monitoring algorithm for advanced driver assistance systems," 2016 24th Telecommunications Forum (TELFOR), Belgrade, 2016, pp. 1-4.

2. Bosch future mobility challenge, http://rocon.utcluj.ro/node/203

3. Hart, P. E.; Nilsson, N. J.; Raphael, B. (1968). "A Formal Basis for the Heuristic Determination of Minimum Cost Paths". IEEE Transactions on Systems Science and Cybernetics SSC4. 4 (2): 100–107.

4. K. Yao, Y. Wang, Z. Hou, and X. Zhao, "Optimum Design and Calculation of Ackerman Steering Trapezium," presented at the Proceedings of the 2008 International Conference on Intelligent Computation Technology and Automation -Volume 01, 2008.

5. Andra Petrovai, Radu Dănescu, and Sergiu Nedevschi, "A stereovision based approach for detecting and tracking lane and forward obstacles on mobile devices," 2015 IEEE Intelligent Vehicles Symposium (IV), pp. 634-641, 2015.

6. S. Thrun, M. Montemerlo, H. Dahlkamp, D. Stavens, A. Aron, J. Diebel, et al., "Stanley: The robot that won the DARPA Grand Challenge: Research Articles," J. Robot. Syst., vol. 23, pp. 661-692, 2006.

7. M. M. Sabir and J. A. Khan, "Optimal design of PID controller for the speed control of DC motor by using metaheuristic techniques," Adv. Artif. Neu. Sys., vol. 2014, pp. 10-10, 2015.

8. P. Torgashov. (2014). Contour Analysis for Image Recognition in C#. Available: www.codeproject.com/Articles/196168/Contour-Analysis-for-Image-Recognition-in-C

22Miniature Autonomous Vehicle Development on Raspberry Pi

Bibliography

Page 23: Miniature Autonomous Vehicle Development on Raspberry Pi

Miniature Autonomous Vehicle Development

on Raspberry Pi

Thank you!

Presenter: Zelia Blaga

Contact: [email protected]