SlideShare a Scribd company logo
1 of 52
Download to read offline
Building a self-driving RC car
bertjan@openvalue.de
Bert Jan Schrijver
@bjschrijver
Building a self-driving RC car
Bert Jan Schrijver
@bjschrijverbertjan@openvalue.de
@TimvEijndhoven@bjschrijver
@bjschrijver@bjschrijver
Let’s meet
Bert Jan Schrijver
@bjschrijver@bjschrijver
Let’s meet
Tim van Eijndhoven
@bjschrijver
How it all started…
@bjschrijver
RoboRace challenge
@bjschrijver
The rules
• 4 teams
• Each team gets:
• RC car kit
• Fixed budget (150 euro)
• Three races:
1. drag race (start, drive, stop)
2. race track (race 1 + corners)
3. destruction derby ;-)

(race 2 with multiple cars on same track)
@bjschrijver
The kit
@bjschrijver
The brain
@bjschrijver
The platform
@bjschrijver
Vert.x
• Toolkit for building reactive applications on the JVM
• Event-driven, non-blocking
• General purpose application framework
• Why Vert.x for our project?
• Lightweight, fast
• Polyglot
• Distributed eventbus (browser included!)
• Building microservices with Vert.x: https://youtu.be/yLg-LPSRjho
@bjschrijver
Connecting the dots
@bjschrijver
• General purpose input/output
GPIO
@bjschrijver
Speaking the same language
@bjschrijver
PWM
• Pulse-width modulation, repeating pulses of variable width
• ServoBlaster: https://github.com/richardghirst/PiBits/tree/
master/ServoBlaster
@bjschrijver
Staying safe
@bjschrijver
Getting visual
@bjschrijver
RPi Cam Web Interface
• Web interface for the Raspberry Pi Camera module
• Video streaming
• Web interface to configure video settings



https://github.com/silvanmelchior/RPi_Cam_Web_Interface
@bjschrijver
Ready for the road
@bjschrijver
Putting stuff together
@bjschrijver
Learning to drive…
@bjschrijver
OpenCV
• Open source computer vision and machine learning library
written in C++ with Java interfaces
• Optimised algorithms for computer vision
• Most widely used computer vision library
• Many resources available
@bjschrijver
1: Canny edge detection 2: Probabilistic Hough Line Transform
3: Filter group and average lines 4: Determine lane center
@bjschrijver
Show me some code…
@bjschrijver
Boars Nest (Laptop) Duke Farm (Car)
Daisy
Luke
Bo
Servoblaster
Boss
Hogg
Roscoe
Flash
GeneralLee
Heartbeat
Manual inputs
Steering / Speed
instructions
Start/Stop
autopilot
Image feed
Angle &
Distance
Intermediate
CV images
@bjschrijver
Expectation
@bjschrijver
Reality
@bjschrijver
@bjschrijver
@bjschrijver
@bjschrijver
@bjschrijver
@bjschrijver
Let’s race!
@bjschrijver
@bjschrijver
@bjschrijver
In the real world
@bjschrijver
@bjschrijver
@bjschrijver
@bjschrijver
@bjschrijver
@bjschrijver
Examples of safety measures
• Geographic area limitation
• Strictly defined conditions
• Redundancy
• Multiple sensors
• Isolating control systems
• Human intervention fallback
@bjschrijver
Weakness of AI for computer vision
@bjschrijver
Ethics
@bjschrijver
http://moralmachine.mit.edu
@bjschrijver
http://moralmachine.mit.edu
@bjschrijver
“In hazardous situations that prove to be
unavoidable, despite all technological
precautions being taken, the protection
of human life enjoys top priority in a
balancing of legally protected interests.”
@bjschrijver
“In the event of unavoidable accident
situations, any distinction based on
personal features (age, gender, physical
or mental constitution) is strictly
prohibited.”
@bjschrijver
Future improvements
• Improve detection and navigation of curved lanes
• Optimize line detection algorithm using sliding window
• Automatic (re)calibration of:
• Video parameters
• OpenCV parameters
• Add Flight recorder to enable replay and debug
• Control servos directly from Java
• Use a neural network for navigation
• Optimize for running everything on the car
Questions?
@bjschrijver
Thanks for your time.
Got feedback? Tweet it!
All pictures belong
to their respective
authors
https://github.com/rc-dukes
@bjschrijver

More Related Content

Similar to GOTO Berlin 2019 - Building a self-driving RC car

TNG Big Techday 2019 - Building a self-driving RC car
TNG Big Techday 2019 - Building a self-driving RC carTNG Big Techday 2019 - Building a self-driving RC car
TNG Big Techday 2019 - Building a self-driving RC carBert Jan Schrijver
 
Lightweight JUG München June 2019 - Building a self-driving RC car
Lightweight JUG München June 2019 - Building a self-driving RC carLightweight JUG München June 2019 - Building a self-driving RC car
Lightweight JUG München June 2019 - Building a self-driving RC carBert Jan Schrijver
 
Devoxx BE 2017 - Building a self-driving RC car
Devoxx BE 2017 - Building a self-driving RC carDevoxx BE 2017 - Building a self-driving RC car
Devoxx BE 2017 - Building a self-driving RC carBert Jan Schrijver
 
JavaOne Ignite 2016 - How to build your own self-driving car
JavaOne Ignite 2016 - How to build your own self-driving carJavaOne Ignite 2016 - How to build your own self-driving car
JavaOne Ignite 2016 - How to build your own self-driving carBert Jan Schrijver
 
Devoxx BE 2016 - How to build your own self-driving car
Devoxx BE 2016 - How to build your own self-driving carDevoxx BE 2016 - How to build your own self-driving car
Devoxx BE 2016 - How to build your own self-driving carBert Jan Schrijver
 
Decoding the airspace above you with Java and $7 hardware - Bert Jan Schrijver
Decoding the airspace above you with Java and $7 hardware - Bert Jan SchrijverDecoding the airspace above you with Java and $7 hardware - Bert Jan Schrijver
Decoding the airspace above you with Java and $7 hardware - Bert Jan SchrijverNLJUG
 
J-Fall 2014: Decoding the airspace above you with Java and $7 hardware
J-Fall 2014: Decoding the airspace above you with Java and $7 hardwareJ-Fall 2014: Decoding the airspace above you with Java and $7 hardware
J-Fall 2014: Decoding the airspace above you with Java and $7 hardwareBert Jan Schrijver
 
JavaLand 2016 - Decoding the air around you with Java and $7 hardware
JavaLand 2016 - Decoding the air around you with Java and $7 hardwareJavaLand 2016 - Decoding the air around you with Java and $7 hardware
JavaLand 2016 - Decoding the air around you with Java and $7 hardwareBert Jan Schrijver
 
OpenValue meetup February 2019 - Decoding the air around you with Java and $7...
OpenValue meetup February 2019 - Decoding the air around you with Java and $7...OpenValue meetup February 2019 - Decoding the air around you with Java and $7...
OpenValue meetup February 2019 - Decoding the air around you with Java and $7...Bert Jan Schrijver
 
JavaOne 2015 - Decoding the air around you with Java and $7 hardware
JavaOne 2015 -  Decoding the air around you with Java and $7 hardwareJavaOne 2015 -  Decoding the air around you with Java and $7 hardware
JavaOne 2015 - Decoding the air around you with Java and $7 hardwareBert Jan Schrijver
 

Similar to GOTO Berlin 2019 - Building a self-driving RC car (10)

TNG Big Techday 2019 - Building a self-driving RC car
TNG Big Techday 2019 - Building a self-driving RC carTNG Big Techday 2019 - Building a self-driving RC car
TNG Big Techday 2019 - Building a self-driving RC car
 
Lightweight JUG München June 2019 - Building a self-driving RC car
Lightweight JUG München June 2019 - Building a self-driving RC carLightweight JUG München June 2019 - Building a self-driving RC car
Lightweight JUG München June 2019 - Building a self-driving RC car
 
Devoxx BE 2017 - Building a self-driving RC car
Devoxx BE 2017 - Building a self-driving RC carDevoxx BE 2017 - Building a self-driving RC car
Devoxx BE 2017 - Building a self-driving RC car
 
JavaOne Ignite 2016 - How to build your own self-driving car
JavaOne Ignite 2016 - How to build your own self-driving carJavaOne Ignite 2016 - How to build your own self-driving car
JavaOne Ignite 2016 - How to build your own self-driving car
 
Devoxx BE 2016 - How to build your own self-driving car
Devoxx BE 2016 - How to build your own self-driving carDevoxx BE 2016 - How to build your own self-driving car
Devoxx BE 2016 - How to build your own self-driving car
 
Decoding the airspace above you with Java and $7 hardware - Bert Jan Schrijver
Decoding the airspace above you with Java and $7 hardware - Bert Jan SchrijverDecoding the airspace above you with Java and $7 hardware - Bert Jan Schrijver
Decoding the airspace above you with Java and $7 hardware - Bert Jan Schrijver
 
J-Fall 2014: Decoding the airspace above you with Java and $7 hardware
J-Fall 2014: Decoding the airspace above you with Java and $7 hardwareJ-Fall 2014: Decoding the airspace above you with Java and $7 hardware
J-Fall 2014: Decoding the airspace above you with Java and $7 hardware
 
JavaLand 2016 - Decoding the air around you with Java and $7 hardware
JavaLand 2016 - Decoding the air around you with Java and $7 hardwareJavaLand 2016 - Decoding the air around you with Java and $7 hardware
JavaLand 2016 - Decoding the air around you with Java and $7 hardware
 
OpenValue meetup February 2019 - Decoding the air around you with Java and $7...
OpenValue meetup February 2019 - Decoding the air around you with Java and $7...OpenValue meetup February 2019 - Decoding the air around you with Java and $7...
OpenValue meetup February 2019 - Decoding the air around you with Java and $7...
 
JavaOne 2015 - Decoding the air around you with Java and $7 hardware
JavaOne 2015 -  Decoding the air around you with Java and $7 hardwareJavaOne 2015 -  Decoding the air around you with Java and $7 hardware
JavaOne 2015 - Decoding the air around you with Java and $7 hardware
 

GOTO Berlin 2019 - Building a self-driving RC car