
Show HN: Self-Driving Pi Car - felsal
https://github.com/felipessalvatore/self_driving_pi_car
======
evolutionas
Cool project! Last year I built self driving robot for my bachelor's thesis.
Instead of building end-to-end deep learning pipeline I used two neural nets:
one trained with genetic algorithm to drive a robot based on ultrasonic
sensors, another for object recognition and detection. Based on detected items
(like road signs) robot took different actions.

Video:
[https://www.youtube.com/watch?v=cUXh7iP3hoQ](https://www.youtube.com/watch?v=cUXh7iP3hoQ)
Code: [https://github.com/kazepilot](https://github.com/kazepilot)

~~~
felsal
Nice project and cool video! (our video is not so well produced :P). Our
project was a summer project, we did it in this January. The evolution of the
project will be something like yours, we didn't apply any object detection
technique.

------
iinc
Nice work. I worked on a similar project where I created an adaptive cruise
control prototype. I used a camera and a CNN to determine the distance from
the car ahead of my car. From there you can adjust your cruise control speed
and hopefully maintain a set distance away.

[https://www.youtube.com/watch?v=ECbU_EvyUqM](https://www.youtube.com/watch?v=ECbU_EvyUqM)

[https://github.com/iinc/acc](https://github.com/iinc/acc)

There are clearly some ethical/safety issues with testing the entire thing at
once while driving on the road. Some better applications would be an alert for
following too close or drifting out of lane. Anyways, I find self driving cars
exceptionally interesting and I liked reading your write up.

~~~
dominotw
> Some better applications would be an alert for following too close or
> drifting out of lane.

One problem I have with 'adaptive cruise control' in car is that it has no
situational awareness. It constantly speeds up and slows down in heavy traffic
highway situations, its quite jarring. What i want instead is integration with
traffic situation and adapt the speed to that automatically os it doesn't zoom
upto 75 mph and come to a stop.

------
normalfaults
Awesome! have y'all seen donkeycar?
[http://www.donkeycar.com/](http://www.donkeycar.com/) great for
meetups/hackathons!

~~~
diyrobocars
There's also [https://diyrobocars.com/](https://diyrobocars.com/) and
[https://diyrobocars.com.au](https://diyrobocars.com.au) in Australia.

------
moftz
I built something similar for my senior design project. We made a game of
Pacman using two little rovers running FreeRTOS with RN-131C wifi modules on a
PIC board and an overhead PixyCam connected to a raspberry pi. The rovers had
a color sensor on the front and back that would allow it to track a black line
on white paper. The overhead camera would feed pacman and ghost positions to
the identical rovers. The rovers were commanded by just telling it what to do
at the next intersection and what speed to move at. We did most of the heavy
lifting on the raspberry pi simply because it's quicker to write A* in python
than FreeRTOS C. Once pacman was seen driving over a colored dot on the map,
the ghost would be commanded to run from pacman. If the camera saw the two
rovers touch, the game was over.

Modularity was pretty key on reducing the work for that project. The rovers
ran identical code and had no knowledge whether they were a ghost or pacman.
The command router didn't care if the instructions it received came from a AI
or a user GUI.

The platform was limited by what the professor provided us. We only bought
color sensor arrays. Other teams went with simpler "games" but much more
complex sensor processing on the rover. Those teams had much more trouble
getting their designs to work, essentially needing two separate code bases.

Half of us were taking a class on AI and the other half were taking network
application design so the idea for the game seemed like an easy way to just
reuse code from those classes.

~~~
felsal
Great! Our project had the same idea of combining different skills: I was
working with ML and my colleague was the TA from a robotics class.

------
luizb
Always nice to see Brazilians in tech, orgulho!

~~~
felsal
Valeu, é nois

------
eddie_catflap
FormulaPi is a robot car racing series along similar lines. Submit your own
code and race against teams from around the world. I've participated in the
last couple of seasons and it's been great fun.

[https://www.formulapi.com](https://www.formulapi.com)

------
Aspos
Does it "look" into a single frame or does it take previous steps into account
as well?

~~~
felsal
Only a single frame

------
rusbus
Cool experiment! Tiny nit, can you resize the image in the README so it isn't
12MB?

~~~
myroon5
[https://github.com/apps/imgbot](https://github.com/apps/imgbot) can open
image compression pull requests automatically in repositories

------
nazz
Very interesting project. It reminds me of a paper I read recently about a
similar Pi car:
[https://www.sciencedirect.com/science/article/pii/S231472881...](https://www.sciencedirect.com/science/article/pii/S2314728818300084)

------
sdan
I made a self driving car for a competition called the International
Autonomous Robot Racing Challenge, held in Waterloo, Canada. I used my robot
to beat Georgia Tech on my own.

Great to see so many others doing similar things.

I used a CNN/LSTM network and you can read more here:
blog.suryad.com/iarrc2018

------
benn_88
Awesome project, but why Python 2? :(

Pre-compiled Python wheels are available for Python 3 on Raspberry Pi at
piwheels.org (default for pip in Raspbian)

~~~
mehrdadn
I'm tired of seeing this comment over and over on HN. Does _everyone_ who
writes a Python 2-based project on HN have to explain themselves and provide a
valid excuse? Why can't people just be deciding they like Python 2 more than
3, or finding that it's more suitable for their project?

~~~
markovbot
It doesn't seem unreasonable to me to ask why someone would use a version
language that is going to be deprecated in just over a year, when newer
versions are readily available.

~~~
mehrdadn
Is it that hard to assume they either like it more or they couldn't use a
later version because of a dependency? The only scenario this question would
be useful in is if they had no idea the later version exists, which is a boat
I have yet to see anyone fall into. Unless, I guess, it's one of those
"questions" that isn't looking for an answer, but simply looking for an
opportunity to chastise...

~~~
newaccoutnas
No, but the project will be dead in a year (or rather bitrot will set in), so
if there are old dependencies then perhaps effort should be put into porting
or working out the kinks in Python3 dependencies doing a similar thing. I
understand for a hobby project that's a big ask but it's not unreasonable to
question, I think

[https://pythonclock.org/](https://pythonclock.org/)

------
tintor
Looking at the video, the toy car is turning in-place when it gets to the
boundary. There is no realistic turning radius proportional to its size.

~~~
pksm
The toy car used differential steering with 2-wheels and a castor wheel. One
of our ideas of future work was to change the current steering method for an
Ackerman model, giving our toy car a more realistic dynamic.

------
antoniuschan99
Any company doing this to solve the scooter littering issue? Like a Self
Driving Scooter that drives itself back home?

~~~
5874-4b22-a4e0
Are there any guides on extracting the electronics, or batteries out for
personal uses?

~~~
VectorLock
I hear there is a whole black market for electric scooter batteries.

------
prando
Cool stuff! Do you have plans to expand this further? Would you accept pull
requests? :)

~~~
felsal
I did this project together with my colleague Paula (pksm here, @pksmoraes on
Twitter). I am doing research on NLP, this was just one summer project for me.
She will work on that project further. So yes, it is not dead! Submit a pull
request if you like :)

~~~
pksm
Yeah like he said I'll be working on employing transfer learning for self-
driving cars. :)

------
dmurthy
So all of the training was done without a GPU?

~~~
dmurthy
Elaborating on my question.

In your read me it says - "In the computer that you will perform the training
-- protip: don't train the model in the Raspberry Pi! -- install all the
requirements by runnig:"

Could you give some specs on the computer? I currently don't own a GPU based
PC so was wondering if I need to get one or use cloud based GPU instance.

~~~
felsal
No, you don't need a GPU at all. It helps, of course, but it not necessary. I
don't remember the specs of the computer we used, but to give you an idea we
give all the training data to undergrad students in the machine learning class
([https://www.kaggle.com/c/mac0460-self-
driving](https://www.kaggle.com/c/mac0460-self-driving)) they achieved good
results with their personal laptop.

~~~
dmurthy
Thanks a lot :-)

