
Show HN: How I built a self-driving (RC) car. - dps
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.<p>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).<p>What do you think?
http://blog.davidsingleton.org/nnrccar
https://github.com/dps/nnrccar
======
dps
The links:

<http://blog.davidsingleton.org/nnrccar>

<https://github.com/dps/nnrccar>

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

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

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

~~~
llambda
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>

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

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

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

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

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

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

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

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

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

------
jakejake
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!

~~~
dps
Yes, agreed - I do plan to try this next - just discovered this
[http://www.kickstarter.com/projects/peterseid/romo-the-
smart...](http://www.kickstarter.com/projects/peterseid/romo-the-smartphone-
robot?ref=category) (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.

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

~~~
iori42
I guess it's a constant bias term.

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

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

------
noeltock
Well done, that's pretty awesome.

------
jack83
Wow

