Building the FASTEST Self Driving RC Car

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Just watched your video. Awesome. That's the sort of thing I want to do when I retire.. just play with computers and AI driving remote control cars.

👍︎︎ 3 👤︎︎ u/OrmeCreations 📅︎︎ Apr 08 2023 🗫︎ replies

Happy to see you guys making SLAM Better known

👍︎︎ 2 👤︎︎ u/PurpleriverRobotics 📅︎︎ Apr 08 2023 🗫︎ replies

it's self driving ? really cool ,

👍︎︎ 1 👤︎︎ u/Late-Transition5132 📅︎︎ Apr 08 2023 🗫︎ replies

That is really impressive, i want to try something like that as a summer project on a swerve drive setup I'm working on. I'll be happy if it goes half that speed:)

👍︎︎ 1 👤︎︎ u/mihai4honor 📅︎︎ Apr 08 2023 🗫︎ replies

Very cool

👍︎︎ 1 👤︎︎ u/pekoms_123 📅︎︎ Apr 08 2023 🗫︎ replies

Hi there /u/stevengongg

You should consider applying for the 3rd annual Reddit Robotics Showcase! An online event for robotics enthusiasts of any age and ability to share their projects!

Announcement Post

Website

👍︎︎ 1 👤︎︎ u/Badmanwillis 📅︎︎ Apr 13 2023 🗫︎ replies
Captions
foreign this is a continuation of a previous video in which I try to build a self-driving RC car that can race as well as a Formula One driver now at the end of the previous video I got the car driving around pretty fast but that was just by following a center line as a result it's not exactly wasting optimally and as you can see here it's overshooting its turn so in this video I'm going to push this car to its absolute limits coming up a brand new track to race on a bunch of interesting engineering lessons and a lot of traffic thank you [Music] foreign [Music] let's talk about racing lines you might have seen them in racing video games but essentially these are the lines that professional drivers follow to achieve the fastest top time and Win race hits so if I want my car to drive as fast as possible the first thing I need to figure out is how to generate these racing lines now racing lines are actually super complicated there's a lot of nuance to them and it really changes from track to track for instance consider a simple 90 degree Corner the geometric racing line will tell you to take the line with the largest turn radius possible where you start from the outside of the turn turn in to Club the Apex located at the middle of the turn and then end back up on the outside of the turn this line allows you to approach this corner while maintaining the car at the highest overall speed but Corners don't exist in isolation you see we're not trying to optimize our speed for one corner but rather for any entire track so if after the corner we end up in a long straight we might want to turn into the corner earlier than the geometric racing line suggests all this to say racing lines are not that straightforward and it takes years for raising drivers to master them and Achieve Optimal Performance on a track now thankfully I'm not teaching a human how to drive I'm teaching a robot [Music] turns out that there's a much more efficient and rigorous way of approaching this problem instead of having to rely on intuition because I have the power of computers and simulations which means I can actually solve for the optimal racing line now before I even generate a racing line I need a track in the previous video this track that I was racing on was pretty much just a square so it wasn't the most interesting yeah it was it is currently 6 20 a.m this is the only time of the day where there aren't any engineering students here but actually I do really good [Music] yeah I'm gonna be running slam and yeah foreign now for the footage that you're seeing here I'm actually running the slam on the fifth floor and not the third floor and that's because on the third floor there are these Bridges they look really cool but the problem is that the walls are made out of glass and if you know anything about lighter well they don't work well at all with glass and so what you see is like these really bad scans of like it doesn't know what to Wallace or not it's like half of them go through the glass I tried running slam like 10 different times every single time the map was either misaligned or I couldn't even see the freaking mess why am I taking so long for these projects am I just stupid uh yeah you're stupid anyways I gave up on nothing to search for so here you can see me napping out the fifth floor and it turned out to be a pretty good map okay so I got a map generated with slam but this is not really a racing track so let's turn it into one I used Photoshop to do this and after 30 minutes of photoshopping the map we end up with this ugly [ __ ] track that even a toddler could do a better job but yeah that's the best I could have done so now we're finally ready to begin the process of generating racing lines the high level idea of generating racing lines is actually quite simple we want to try a bunch of racing lines in simulation measured a lot of times for each of these racing lines and then our optimal racing line would just be the one with the shortest amount of time the problem is we can't really Brute Force Us by trying every single possible racing line that would be way too slow so we need to do something called constrained optimization think about it like this when you are racing there are a bunch of constraints that you must respect you are constrained on where you can drive and you are also constrained on how fast you can accelerate the accelerate and approach turns based on what car and how much grip your tires have so with constraint optimization we use a solver that takes in all of these constraints translates them into systems of equations and then tries to minimize lap time while satisfying all of these constraints and this is much faster than brute forcing because we're limiting the search base with all of these constraints of course I've oversimplified a lot but you can take a look at the code in the description now there's one more thing to run the optimization we need to extract the center line out of the map Well turns out a really simple and clever way to do this is to use an image processing function called the euclidean distance transform this takes in a binary image which only contains black and white pixels and calculates the distance from each pixel to the nearest background pixel which is black in this case now do you see how this can be useful for extracting the center line well if we first convert our original track into a binary image and then apply the euclidean distance transform then the setup pixels with the highest values are simply going to be our Center Line so then I just use the skeletonize function which reduces the shadow to a 1 pixel wide representation and that's basically our Center Line so now that I was able to generate racing lines I went out there and tested out these racing lines to see if it actually helped the car go faster just hold it yes now here's how the racing line actually looks like for this Square track as you can see it's falling basically the geometric race line and here is the velocity profile that's attached to it so as you can see depending on where you are on the track the solver tells you exactly how fast to go for each point now here I was running the car at around 20 of the speed that the solver gave us and it seemed to work really well so I just full sent it so as we know if it can go slow it can go fast if you can play something slowly you can play it quickly [Music] thank you I might have broken the lighter guys can be so bad we might be in big trouble yeah so I almost broke my 1500 lighter in fact if you look here there's like still a huge scratch Mark that you can see but the keyword is almost yes so the next day I went in again at 2 A.M so now we're doing at 0.5 0.5 XP oh that's just the speed oh dude twice this dude yeah so 50 speed seemed to be working fine so let's try 70. okay [Applause] at this point I caught it a day because I was just too scared of crashing the car again but upon reviewing the footage I noticed that the car was actually slower than in the previous video what the hell that is unacceptable we cannot stop here I'm gonna get this car running at a hundred percent speed because I want to absolutely destroy this not time for the previous video I present to you three weeks of intense engineering the car seems to be oscillating too much at high speeds let's re-implement our controllers to have smoother steering with the following chain okay nice it's oscillating a lot less now but the car is overshooting its turns when in doubt Add Water this should give the tires more grips and maintain speeds on turns uh we're still overshooting the goddamn turn Okay Lewis Hamilton will not like this but let's have the car break slightly earlier oh I got this pretty good run not this one let's go it seems to be working I think I really pushed this card to its limits no we're not done faster we need more speed damn boy okay the car seems to be stuttering he's like this reaching noise let's fix the Loose Gear ah this motor here turns this really tiny gear if they're not tight enough together there's all this flipping so all we need to do is make sure these two are tighter together oh my God the car's so much more responsive and can accelerate faster but we need to go even faster oh they put a software limit of five meters per second on this car no wonder it can go fast and after three weeks of pain and pain and pain oh my God this feels so good I said this feels so good man [Music] [Music] damn girl so we did it we got this car racing four seconds faster than in the previous video and we're not even done yet because we still haven't raced this car on the big track that we've already mapped out so now we're ready to take everything we've learned from racing on the small track onto the big track and oh boy am I scared because this track is at least three times as big and who knows what this car is capable of crashing into you know these whole three weeks of trial and error really gave me a newfound appreciation for racing drivers because these guys can just be put on any car and any track and very quickly they learn to push the limit of the car without crashing the actual car all right let's get back to racing as I've said this is going to be the biggest track I've ever raced on now I ran this track through my recent line solver and here is the racing line generated where the brighter the color the faster you're supposed to go so we're going to start right here right next to the trash because this is where my code belongs and right off the bat we're going to be accelerating super duper fast right into the super tight corner where we're obviously not going to crash into the wall come on man we're just getting started and then we're going to be taking a very large right turn at a pretty high constant speed accelerate a little bit [Music] and then we turn left hit the Apex and then go through this sick bridge this is probably my favorite part of the track and then we're going to be turning left again and not hit the wall followed by a long straight flat out [Music] and then to finish the lap we're going to go through the left door and then the right door and then pass by the recycling bins and there we go we've completed a lot simple now we're just gonna do the same thing but go fast and hopefully my code's gonna work what what and the entire computer is not going to fall out this is going to be interesting [Music] [Music] I love you [Music] nope it's not supposed together foreign I don't okay let's go how does this work fidget spinner
Info
Channel: Steven Gong
Views: 595,331
Rating: undefined out of 5
Keywords: steven gong, DIY, 3d printing, software engineering, engineering, student engineer, robot, programming
Id: R87Qlq_wSY8
Channel Id: undefined
Length: 16min 1sec (961 seconds)
Published: Fri Apr 07 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.