tubeshowcase●1,194,391 videos♡ My collection 0
← Learn to Code

Learn to Code15:10

Self-driving Car - Python plays Grand Theft Auto 5 p.7

sentdex ↗

From the creator

As I was contemplating the next steps, I was curious about a couple of choices for Artificially Intelligent driving. One thought I had was that we could detect both lanes, and then attempt to orient the car in between the two lanes, so long as those two lanes had different slopes. ...then I began to think about it, and wondered if the problem coudl be even more simple than that. I noticed that the times when the lanes would "both" be on one side or the other was when we were getting to close to one of the edges. So next I wondered, hmm, what if we just work with the following logic: If one lane's slope is positive, and the other is negative, then we're fine, continue straight. If both lane's slopes are negative, then we're too far left, and we should turn right. If both lane's slopes are posotive, then we're too far right, and we should turn left. ...surely it can't be that simple right? Project Github: https://github.com/sentdex/pygta5 https://twitter.com/sentdex https://www.facebook.com/pythonprogramming.net/ https://plus.google.com/+sentdex

Published 2017-04-10 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code