EECS 192: Mechatronics Design Lab
Discussion 7: Camera GSI: Justin Yim 6 & 7 Mar 2019 (Week 7)
1 Line Sensing 2 Embedded Software 3 Summary
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 1 / 30
EECS 192: Mechatronics Design Lab Discussion 7: Camera GSI: Justin - - PowerPoint PPT Presentation
EECS 192: Mechatronics Design Lab Discussion 7: Camera GSI: Justin Yim 6 & 7 Mar 2019 (Week 7) 1 Line Sensing 2 Embedded Software 3 Summary Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 1 / 30 Line Sensing Line
1 Line Sensing 2 Embedded Software 3 Summary
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 1 / 30
Line Sensing
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 2 / 30
Line Sensing Problem Setup Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 3 / 30
Line Sensing Problem Setup
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 4 / 30
Line Sensing Problem Setup
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 5 / 30
Line Sensing Camera Calibration
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 6 / 30
Line Sensing Camera Calibration
◮ Pinhole camera model ◮ Can calibrate centimeters-to-pixels gain for a fixed camera distance
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 7 / 30
Line Sensing Argmax Based Detection
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 8 / 30
Line Sensing Argmax Based Detection
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 9 / 30
Line Sensing Argmax Based Detection
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 10 / 30
Line Sensing Argmax Based Detection
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 11 / 30
Line Sensing Argmax Based Detection
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 12 / 30
Line Sensing Gradients and Smoothing
dx ?
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 13 / 30
Line Sensing Gradients and Smoothing
dI(x) dx
1
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 14 / 30
Line Sensing Gradients and Smoothing
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 15 / 30
Line Sensing Gradients and Smoothing
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 16 / 30
Line Sensing Gradients and Smoothing
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 17 / 30
Line Sensing Gradients and Smoothing
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 18 / 30
Line Sensing Gradients and Smoothing
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 19 / 30
Line Sensing Gradients and Smoothing
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 20 / 30
Line Sensing Gradients and Smoothing
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 21 / 30
Line Sensing Gradients and Smoothing
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 22 / 30
Line Sensing Temporal Differencing
dI(x) dt
∆t
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 23 / 30
Line Sensing Temporal Differencing
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 24 / 30
Line Sensing Temporal Differencing
◮ Difference of Gaussians (Bandpass- not just Lowpass) ◮ Cross Correlation with known signal ◮ Convolutional Neural Networks??
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 25 / 30
Line Sensing Issues
◮ What to do if there are multiple track crossings? ◮ Can’t find the line ◮ Other Issues?
◮ Maintain a history (previous line pos, camera scan, etc.) ◮ Ignore the problem(s) and go fast! ◮ Anything else?
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 26 / 30
Embedded Software
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 27 / 30
Embedded Software Modularity
◮ Code is starting to get complicated
◮ Pthreads, PRU, UART, GPIO, ADC etc.
◮ Many tasks to run on a single core CPU
◮ Velocity Measurement ◮ Line Finding ◮ PID Controllers (steering and velocity) ◮ Telemetry ◮ Others? Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 28 / 30
Embedded Software Modularity
◮ Remove unecessary threads. This will make debugging easier later on. ◮ Build modular code, test components in isolation ◮ Minimize dynamic memory allocation aka malloc & free (memory
◮ Save logfiles ◮ Keep things simple!
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 29 / 30
Summary
◮ Many ways to do line detection (max, differencing, gaussian
◮ Camera calibration ◮ Embedded Software tips
Ducky (UCB EECS) Mechatronics Design Lab 6 & 7 Mar 2019 (Week 7) 30 / 30