Localization and Control of Self-Driving Cars
Comma.ai: May-August 2016
Building an affordable self-driving kit
At Comma.ai, the goal was to build an inexpensive aftermarket kit to provide autonomous functions. As a prerequisite to driving itself, the car must know where it is located with a great deal of precision, ideally taking advantage of all of the sensor data it has at its disposal. Working with inexpensive GPS units, accelerometers, gyroscopes, wheel encoders, and the camera, I developed sensor fusion algorithms to combine all of the data together and obtain a better estimate of the car position and speed than any individual sensor could provide. A critical part of this sensor fusion was my model of the car itself; by taking advantage of everything we knew about the car's dynamics, we could significantly limit the bounds on our estimates. I developed a vehicle dynamics model and incorporated it into an Extended Kalman Filter using the commanded control inputs of gas, brake, and steering.
As the Advanced Controls Lead, my job was to develop better approaches to control of the car in order to provide a smoother driving experience. Quantitatively, this meant minimizing acceleration and jerk during maneuvers; however, humans are fickle and will, for instance, have different levels of discomfort at high speed vs low speed when experiencing the same jerk. Still, I did my best to minimize "discomfort", a function of all of these different factors. By using trajectory optimization techniques and time-varying LQR control to follow those trajectories, more reliable and comfortable behaviors could be achieved. The hardest part of this problem, though, was accurately modelling the car. On top of the simplified dynamics model used for localization, trajectory generation and control required much more precise models, incorporating engine power curves, automatic gear-shift logic, and nonlinear braking forces.