Self-driving Car - Python plays Grand Theft Auto 5 p.7
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
Other Videos By sentdex
Other Statistics
Grand Theft Auto V Statistics For sentdex
At this time, sentdex has 1,697,670 views for Grand Theft Auto V spread across 10 videos. There's close to 2 hours worth of content for Grand Theft Auto V published on his channel, less than 0.88% of the total video content that sentdex has uploaded to YouTube.