News for hackers. Stuff that matters.

Show HN: How I built a self-driving (RC) car.

I have been taking Andrew Ng's Machine Learning course. The lecture module on Neural Networks ends with an intriguing video of the ALVINN autonomous car driving itself along normal roads at CMU in the mid 90s.

I was inspired by that video to see what I could build myself. A link to my incomplete write up was posted a couple of weeks ago (ouch!) but I finally finished it and open sourced the code tonight (so you can build your own self driving car).

What do you think? http://blog.davidsingleton.org/nnrccar https://github.com/dps/nnrccar

( 21 comments | 300 points | on HN )
Re:Show HN: How I built a self-driving (RC) car. by dps on Monday January 02, 2012 @06:19PM (#3417838)
Re:Show HN: How I built a self-driving (RC) car. by JoachimSchipper on Tuesday January 03, 2012 @04:05AM (#3419104)
Hint: it's common wisdom that such things are best posted as links instead of "Show HN", since "show/ask" posts leave the front page more quickly. You can always add a # or ? if you want to fool the duplicate-detecting algorithm...
Re:Show HN: How I built a self-driving (RC) car. by TeMPOraL on Tuesday January 03, 2012 @05:01AM (#3419173)
> "show/ask" posts leave the front page more quickly

Do they? Hate to say it, but [citation needed].

Re:Show HN: How I built a self-driving (RC) car. by llambda on Tuesday January 03, 2012 @07:48AM (#3419456)
It's true. The weighting is not in their favor. You really should be able to find your own citation via Google but here's one[1][2].

[1] http://jacquesmattheij.com/The+Unofficial+HN+FAQ#selfposts

[2] http://news.ycombinator.com/item?id=1076633

Re:Show HN: How I built a self-driving (RC) car. by aiurtourist on Tuesday January 03, 2012 @12:50AM (#3418779)
Congratulations -- you'll never need a resume ever again. :)
Re:Show HN: How I built a self-driving (RC) car. by aiurtourist on Tuesday January 03, 2012 @01:06AM (#3418811)
Sorry, let me be more precise.

After completing a course you correctly associated new knowledge with the potential for a cool project in an area which has been made very attractive ("hot") following Google's announcement of self-driving vehicles. You then wrote up the project in very nice prose with informative pictures and a great above-the-fold hook that makes me say, "Wow, I need to read more."

This project is a code sample, writing sample, presentation, and creativity example all in one, and it answers the "Should we hire this person?" question immediately. For that, I commend you.

Re:Show HN: How I built a self-driving (RC) car. by Game_Ender on Monday January 02, 2012 @09:40PM (#3418378)
Very cool robotics project. Were you aware of FANN (http://leenissen.dk/fann/wp) before you started your neural network implementation? Also have you tried any other machine learning techniques on that data, comparison results would be interesting.
Re:Show HN: How I built a self-driving (RC) car. by endianswap on Tuesday January 03, 2012 @12:44AM (#3418760)
What sort of latencies did you see in this project while the car was running? Specifically, from the point where you have access to the camera's preview buffer to encoding it, sending it, running it through the neural network, and sending the button bits to the microcontroller.
Re:Show HN: How I built a self-driving (RC) car. by dps on Tuesday January 03, 2012 @04:32AM (#3419137)
A great question - I haven't actually measured it directly, but it's probably < 200ms (video feels 'live' when you watch it). The prediction step takes circa 20ms on a MacBook Air and the serial port runs at 9600 baud and needs to send a single byte, which will propagate very quickly. I'll see what instrumentation I can add to the video frame -> computer via wifi step.
Re:Show HN: How I built a self-driving (RC) car. by leoedin on Tuesday January 03, 2012 @06:17AM (#3419280)
How practical is running the software onboard? Would you have to port it out of Octave to Java? There seems to be a useful library in the form of [jlmath] that may well let you run the program as-is.

jlmath: http://www.jmathlib.de/

I was going to suggest using the audio jack, but it seems you've already found a (really cool) project that's using it.

Anyway, it's a pretty awesome project. I'm building a robotic vacuum cleaner currently, although I'm building the chassis from scratch and that's proving to be a bit of a stumbling block with my current tools. My software right now is pretty much rudimentary collision detection, so something like this is pretty interesting as a far more sophisticated option.

Re:Show HN: How I built a self-driving (RC) car. by richardburton on Monday January 02, 2012 @10:26PM (#3418489)
What a great side-project! I wonder how long it will be before we are comfortable with the idea of self-driving cars on the road? The transition will be slow but I think it is inevitable. Humans are less reliable than robots. I hope.
Re:Show HN: How I built a self-driving (RC) car. by EwanG on Monday January 02, 2012 @09:52PM (#3418401)
So I have to ask, how well do you think this would scale? AM I but a month of effort away from never having to actively drive to work again (given I follow the same route most days, etc)?
Re:Show HN: How I built a self-driving (RC) car. by unwind on Tuesday January 03, 2012 @04:31AM (#3419135)
If you were to copy this project using slightly more powerful components (higher resolution video, faster processing pipeline, more powerful servos) to automate the driving a real car on public roads, I kind of predict you're but a month away from jail. :)

Not to sound like a Luddite, but I don't think "budget DIY" is the way to deploying real driver-less cars.

Re:Show HN: How I built a self-driving (RC) car. by jakejake on Monday January 02, 2012 @11:57PM (#3418675)
super cool! it would be even more cool to see the arduino hooked up directly to the android so there was no separate computer involved and it was totally autonomous. even still, this is cool, thanks for sharing!
Re:Show HN: How I built a self-driving (RC) car. by dps on Tuesday January 03, 2012 @04:34AM (#3419142)
Yes, agreed - I do plan to try this next - just discovered this http://www.kickstarter.com/projects/peterseid/romo-the-smart... (not self driving :-( ) robot which communicates via the phone's audio jack which would work well in this project. Additionally, this code could easily be used to control a Romo, so I'll probably try to order one of those too - would make the set up much more reproducible for others if the 'car' is ready made.
Re:Show HN: How I built a self-driving (RC) car. by tzs on Tuesday January 03, 2012 @05:41PM (#3421656)
The input layer for the neural net has 25345 units. The input is a 176x144 image, which is 25344 pixels. Why is there one more input unit than pixels?
Re:Show HN: How I built a self-driving (RC) car. by iori42 on Thursday January 05, 2012 @10:41AM (#3429046)
I guess it's a constant bias term.
Re:Show HN: How I built a self-driving (RC) car. by josscrowcroft on Tuesday January 03, 2012 @06:45AM (#3419333)
Made my day and seems to have reignited my curiosity about DIY robots. Congratulations!
Re:Show HN: How I built a self-driving (RC) car. by geekfactor on Monday January 02, 2012 @08:56PM (#3418288)
Wow, very nice. Congrats on putting the course into practice!
Re:Show HN: How I built a self-driving (RC) car. by noeltock on Monday January 02, 2012 @07:06PM (#3417978)
Well done, that's pretty awesome.
Re:Show HN: How I built a self-driving (RC) car. by jack83 on Monday January 02, 2012 @09:04PM (#3418308)
Wow