Would you trust Open Source with your life?
Have you ever been in a precarious situation, and found comfort in the fact that you could rely on technology to get you out of it safely? The plane you’re on hits turbulent weather, but radar analytics leads you out of the storm safely. The MTA trains can chug along at outrageous speeds for a piece of metal that heavy (somehow still managing to always make you late), but you trust it because of the complicated braking system in place. Even something as mundane as having your computer crash, but being able to trust that your computer backed up whatever you were working on is a great solace to us. All the software behind these systems we think of as reliable and mostly infallible, but at the core of all this code are human brains that brought their vision to life. Now while we might think the immense pressure of designing software responsible for human lives should be left up to the cream of the crop in engineering minds, infamous IPhone hacker George Hotz has different ideas.
Open Source is an open book.
Without delving too far into what makes a project open source, let’s cover the key elements that distinguish it from other forms of projects.
- Free redistribution: The license outlines that the creator should not be allowed to restrict access to the software via charging for it.
- Source Code: There must be easily (relatively) obtainable source code available for the project, that can be redistributed and modified.
- Derived Works: As mentioned, it wouldn’t be enough to simply have access to the code, there must be free reign to modify the source code and redistribute under the same terms as the original license.
This isn’t to say that you can have an amateur or malicious programmer come in and wreck your code base, there are still evaluations and validations that must occur before the owner of a project accepts modifications to their source code. The advantage being that diverse experience and opinions can lead to a more robust, fleshed out code base.
You drive a manual? I drive an AUTOnomous.
Now there are major competitors on the frontier of the self driving car industry like Google with their focus on Python based A.I. (probabilistic interference, localization, tracking, etc..), or Tesla (neural net computation sonar, radar, and vision signals), but Hotz is taking a community oriented approach with his Open Pilot program.
Open Pilot utilizes open source community contributions to A. increase the size of the team working on the project to be greater than any team he could hire, and B. to skirt legal issues with the NHTSA (national highway traffic safety administration). Although the project is largely coded in C, and I have had very little exposure to the language, I will attempt to break down some of the open source contributions to the project using the comments of contributors.
The above code deals with adaptive cruise control, now this isn’t a simple matter of keeping speed. Although the above code deals with the rate of acceleration in cruise control based on current speed, the larger code base takes into account variables such as desired distance from vehicle in front/behind you, rate at which turns affect vehicle control, or even what happens in critical failure.
Now this code snippet is less reactionary and more of a background process. The directory that this code is found in deals entirely with the machine learning that the program uses to get smarter about its surroundings and potential calamities. This portion is extremely complicated but at a very high level it’s the beginning to an algorithm that over time will learn the ideal pressure to apply to the steering to keep the car as straight as possible around turns.
Now this code comes from the contributions that deal with rate limiting after checking brakes, but the real line of note is the TODO line found at the top. By leaving a note, the contributor is telling themselves (and whoever else is reading) that they can figure out a way to factor this code to make it more efficient.
This code might be some of the most important code in the project. Of course it’s nice to have straight steering around corners, or reliable cruise control to disburden the driver, but if we’re trusting code to drive our cars, we need to make sure it’s safe. One of the leading causes of automobile accidents is unexpected lane changes, and this code above attempts to mollify that risk by predicting and bracing for vehicles cutting in on you.
There are a number of reservations I had when considering the thought of trusting my life to a bunch of random contributors from the internet and I can’t say they’ve all been assuaged, but by writing this blog and continuing to expose myself to the exponential power of open source, it doesn’t seem as far fetched as it once did. I still think that we’re a while away from building a reliable self driving platform built mostly from user contributions, but this type of challenge with real world implications and responsibilities brings out some of the best code that some of us will write.
The entire project is available on GitHub: