Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: How I built a self-driving (RC) car.
300 points by dps on Jan 2, 2012 | hide | past | web | favorite | 21 comments
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

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...

> "show/ask" posts leave the front page more quickly

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

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

Congratulations -- you'll never need a resume ever again. :)

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.

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.

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.

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.

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.

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.

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)?

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.

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!

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.

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?

I guess it's a constant bias term.

Made my day and seems to have reignited my curiosity about DIY robots. Congratulations!

Wow, very nice. Congrats on putting the course into practice!

Well done, that's pretty awesome.


Registration is open for Startup School 2019. Classes start July 22nd.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact