Full Jetson Nano Smart Rover Guide | From Pieces To Programming In 2 Hours!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what are you doing under the bed uh nothing uh nothing i'm sure andy was just a little excited that's all too much cake and ice cream i suppose it's just a mistake well that mistake is sitting in your spot woody have you been replaced hey what did i tell you earlier no one is getting replaced now let's all be polite and give whatever it is up there a nice big andy's room welcome [Music] what's going on drone dojo here with another exciting project this is wally but you know as as buster would want you to know most of the content here to this point has been about drones we've learned about pix hawks we've learned about autopilot computer vision autonomous missions with python drone kit a ton more you get the idea but you might not know this uh the exact same hardware firmware software stack can be used on different vehicle types so it's not just drones so we're talking planes boats blimps yes blimps submarines and rovers so surprisingly the learning curve to jump from one vehicle to another is actually super low like it took me three years to obtain a lot of this drone knowledge and it literally took me three weeks to port over this knowledge to the rover so let me prove that to you it took me literally 30 minutes to write this precision parking opencv script that is running on the rover that you are about to build the webcam tracks and automatically drives toward that marker and stops when it's within one meter and you know really haven't even scratched the surface of this rover's capabilities but that's just giving you a little taste so learning about autopilot rovers unlocks a ton of interesting doors here are just a couple examples this is an autonomous lawn mower running with arty rover no seriously getting very straight lines and uh that track there that's unmowed was it moving to its initial start point and uh and then here is another example with an actual combine being autonomously controlled from a pixhawk type flight controller running ardu rover as you can see i have to navigate around this half ton [Music] which so far has been possible dad's really trusting me here that it's gonna work [Applause] so as you can see this rover build might look ow so you know this rover wally he might look like a basic b rc car but it's actually an insult towards wall-e you know it's it's a bona fide robot it's not an rc car sure you can't control it with an rc controller but it's a robot so are you excited yet sounded like uh the spongebob opening theme right there are you ready kids aye aye captain i can't hear you so we're also going to be installing the jetson nano to this rover making it really the ultimate canvas for any rover robotics mission so really i mean it sounds corny but your imagination really is the only limiting factor on this vehicle so enough talking let's get into it in this comprehensive video i'm going to show you how to go from an absolute beginner to programming your own autonomous rover missions which includes a basic overview of artie rover how to build the hardware of the rover let's put all the pieces together into a controllable thing how to manually drive the rover a couple different ways you can do that how to autonomously control the rover both with pure auto mode and with python scripting and then how to perform in the very end this is our our big mission we're going to perform an autonomous rover delivery mission then and for those of you who want to follow along with the exact same parts that i'm going to be walking through in this video we actually sell wally in kit form we cloned him and he is available to purchase in kit form [Music] so you'll have everything you need with one purchase you won't have to find the 50 plus parts on your own we vetted all these parts they work and you get it shipped all together in one box and you might want to check that out because after we have a good foundation for art grover with this video in future videos we're going to be doing advanced rover missions on this exact wall-e rover so you can follow along it'll be very easy nothing will be different for you we'll even pre-install all the firmware you need set up the jetson nano operating system that's going to be set up with all the dependencies you need and even some of the exact same python drone kit scripts that we're going to be running in this video and future videos it's already going to be on your nano so all you have to do is build the kit and then you can drive it and program it it'll just be plug and play so easy as it should be as it should be [Music] [Applause] [Music] don't you cry buster's not gonna fly into you and terrorize oh what's up wally's sleeping right now but like and subscribe this video i'll wake him up we'll do some cool stuff outside all right now before we jump into the building of our rover let's just you know step back zoom out and get a general sense of artery rover so what actually is ardu rover well um to this point we've done arducopter well we can think of ardu rover as being arducopter but in two dimensions instead of three dimensions so you might think this is only land vehicles but it actually includes boats as well so boats and land rovers and the conventional term to refer to land rovers is ugvs i'll probably just be referring them as rovers from here on out but that's something to be aware of ugvs and basically rd rover is the firmware running on the flight controller and this is what unlocks the autonomous functionality this is the separator between an rc guy who just wants to control the car in an art and a robot uh girl or guy that wants to you know program actual autonomous functionality into their vehicle now let's get into types of rovers or ugvs and this might be a little bit overwhelming of a subject when you're first getting into this space so this is a good framework to view your options through so you have conventional steering this is by far the most widely available frame type out on the market and think of it like a normal car there is a central engine or motor that's powering the entire drivetrain right so these drivetrains are very very similar they're basically identical to what's in your vehicle like you literally have a drive shaft a differential tie rods all the parts that are actually in a real car on the small scaled down rc car and then you have skid steering and this is different because there are multiple engines or motors powering each wheel or track if it's a tank so you can have one motor per wheel for four wheel drive or only in the back you'll have motors mounted to the wheels if it's two-wheel drive these skid steering vehicles are capable of zero turn but they are a little bit more difficult to manage and set up so in our build we're going to be going with the conventional steering like i said it's the most common type of rc car easiest to set up and honestly cheaper now zooming in on the conventional steering we have a couple different frame types we have conventional rc cars and that's what is pictured above here these are designed to maximize speed like this one might go 50 miles an hour which is crazy and you know if you're manually controlling it that's fun but for a robot you don't want a autonomous robot to be flying down 50 miles an hour so that is a conventional rc car and you'll notice it's very close to the ground so it's best for driving on paved and non-bumpy surfaces not really that great for off-roading so they're a little bit limited in where you can drive these vehicles then the other type is crawlers now in the rc world they are designed for off-roading and rock climbing um they're not as fast as conventional rc cars but as i already said you don't need your robot to be going 50 miles an hour um so it's not as fast as an rc car but that that trade-off there is that the crawlers are very robust they can drive on basically any type of terrain you know everything the conventional rc car can drive on pavement smooth surfaces grass bumpy surfaces gravel now in this video we're going to be going with the crawler frame because one we want that wide range of drain i want to be able to drive the rover indoors outdoors wherever i need to and you can do that with the crawlers and two like i already said you don't need these things to drive that fast the crawlers can get up to eight to ten miles an hour which honestly is is plenty for autonomous missions so we're sacrificing the speed for wider terrain capability now we get into conventional steering uh rover drivetrain now we have a like i said a single normally it's a brushed motor to provide power and that brush motor connects to a brushed esc to control speed and direction of the brush motor and that brushed esc plugs into the back of the pixhawk it'll typically be channel 3 and the steering servo is the other element of the drivetrain and that is just going to be a servo that's going to rotate the front tires and that'll plug into channel one well it's very simple you only have two signal pins going to the pixock for vehicle control and most mode brushed motor escs actually have a ubec on them so it will automatically power your servo now we're getting into the size of different vehicle types and this size is scaled to the real size vehicle so a 132 vehicle is very tiny right because it's 132nd of a normal vehicle then you have the 1 8th scale really if you get down to 1 16 scale or 1 14 even 1 12 some of these vehicle types the vehicle sizes are just too small to be able to mount everything you need on your ugv right as you see this is uh the picture of the rover we're going to be building this is a one-tenth scale and look how i mean it works but it's pretty crowded there you have to be very strategic even with the 1 10th model for mounting all the various components which we will get into in the next section but it's good to go with the bigger scale in the autonomous ugv space so our build is going to be the 1 10th scale conventional steering single motor and it's going to be a crawler for all-terrain capabilities so let's get into it let's go build this thing okay it's time to now get into the actual building of the rover now if you get one of the drone dojo rover kits you will be getting everything you see here and some more things as well but all of the same parts i'm going to be walking through in this build you'll be getting in your kit now if you're going to be building your own rover and trying to find your own parts basically what i'm showing you here will be extremely helpful for you because you'll gain an understanding of the various components you need to build your over what's required what's optional but with that let's just jump into it so here is the chassis we're going to be using this is a 1 10 scale crawler and this particular one has the motor already built into the chassis we have a waterproof uh component to place the rc receiver in and then you'll need four tires and then a brushed esc if you're using a brushed motor and this can plug into our flight controller and it will drive our motor um this is our steering servo this is going to literally steer the vehicle for us based off of our commands then we'll need a gps gps mount a lot of zip ties and various strengths of sticky tape then you'll need a ppm encoder and that is to take the output of the rc receiver feed it into the ppm encoder and that will be able to communicate all those channels with this one line into your pixhawk we're using a pixhawk in our build and you'll need a four gigabyte sd card that's required to do the rd rover stuff here you have a choice you can use a you don't even need a companion computer but if you do want one you could use a raspberry pi or a jetsa nano or anything else we're going to be walking through the jets and nano because i just think that's a good choice for the rover vehicles and with that you'll need a 64 gigabyte sd card but this is optional the companion computer but it does unlock some very advanced features of your rover that you can't do on just a basic pixhawk then you'll need a way to mount your companion computer to the frame here is a custom designed and 3d printed mount that works specifically with the jets and nano moving on here we have the wi-fi telemetry module and this will plug straight into the pixhawk and this is our companion computer to pixhawk connector moving on this is our power module it's a lot of stuff going on here this is a basic power module this is what it looks like you'll notice this is the xt60 connectors on either side for the rover world you're going to want a dean's connector power module on either side so that's the red one and then how are we going to power our companion computer well we're doing that with a ubec the jets and nano requires a 5 volt 3 amp power supply so this is just soldered onto the power module and at the other end of this ubec is a usbc connector which is what powers the jets and nano i'm not going to show you how to do that there's plenty of soldering tutorials but i will show you some more details of that when we get to that point next we have the battery charger lipo battery charger the lipo battery then we have the rc controller i recommend you get something like this there's the the wheel model of rc controller 2 that looks like this i don't recommend using one of those units i do recommend using something like this this is the fly sky i6 that comes with the kit you can actually modify it to become i believe an 8 channel transmitter then moving on this is the webcam we are using in this build it has pretty good resolution and a built-in mic which might be cool for some voice control in the future and then we have optional a mini servo that you can wire into the pick sock to hold on and let go to things kind of like what we did with the taco copter okay this build section is actually going to be split into two different sections in this first section that we're starting on what we're looking here is the bare essentials to get this uh crawler chassis driving this is very surprising all we need is a rc receiver uh steering servo motor esc motor and tires in the chassis and we're going to get the vehicle drivable with all of these components first and that's because we're going to be doing some tuning on the chassis we need to get make sure the vehicle drives straight make sure the wheels look good and then after that we'll go into section two of this build section which will be putting all of the advanced parts onto the chassis to make it an autonomous vehicle now the very first thing we should do before anything else is make sure that these wheel bearings are installed now in most of your kits they should already be in the little hub but sometimes these wheel bearings can fall out so just on each one just kind of press it in there make sure it's flush with the outside surface and only after that wheel bearing has been pushed in should you install the hex nut and that little pin on the tire side there's one side that has a little hex slot the other side doesn't the hex slot is going to be towards the wheel mount okay and then on the wheel mount side you see there's a little hole there we're going to slot in a pin so this is our set up here i'm going to slot in the pin to that hole on the other side we're going to place this hex nut and you see the perforations there to fit that pin and that's just a press fit and then the wheel snugs onto this hex nut then on the other side of the wheel we tighten down with this m7 nut we're gonna do that for all seven or all seven all four of the wheels on this guy so let's get to it and with that hex nut you want to rotate it around and press down it's just a press fit like i said but press down so there's no space between it and where it's mounting to then once we have that we just place the wheel on there and on this side we just thread in that m7 nut and i would just start out getting it hand tight and then once it's in there a little bit we can get our m7 socket set and tighten that down now you do not want to over tighten and you do not want to under tighten i would just you know with a small size socket wrench like this tighten it down so where you're getting some pretty good resistance and then go to the very end of that small socket wrench and then do maybe an eighth of a turn and there we go and you shouldn't see any wobbling in the wheel hub now it should be pretty solid there you will have movement in other places of the drivetrain but as far as the wheel in the hub it should be pretty good okay then after we have all four of those wheels installed the next thing we're going to do is install the steering servo now the steering servo is obviously going to be on the side where the wheels can turn so the drone dojo kit comes with this servo mount now there's a smooth side to this mount and a non-smooth side the non-smooth side is counter-intuitively facing up and it just slides in here on this frame and then you can bolt it in later before we do that what we're going to do is install the servo so that you see there's four mount points here on the mount and then there's four mount points on the servo okay now imagine the driver is facing us so we need the servo line to be pointing that way so we're going to mount the servo like this all right because this is going to slide in like this into the vehicle and first thing it can be a little hard to start the thread but i'm just going to get these started i'm not going to secure them down all the way i'm going to get all four started and then i'll start securing that down so that started pretty good i'm going to get the other three in now and okay then when you're finished it should look something like this it's down secured with all four screws in and then this little servo mount very simply just slides in there we go it just slides in there and then once that is slid into the chassis we can secure that down with four of these screws those little mount points on either side of this frame two on this side two on that side so let's secure these down now i'm gonna do the same thing just get all four of them in just enough and then after i have all four the thread of the four started i'll start tightening them down you might have to do some finagling to get the screws to slot into the mount points on the servo mount like for example this last screw i had to pull up on the servo mount to get the hole to align so all right now there we go that servo is installed to the servo mount and that servo mount is installed to the chassis okay next we're going to mount the brushed motor esc to the frame first we're going to look at this switch here it's an on and off switch and it actually slides into this little slot right here so you just go up press down and there you go now your on off switch is mounted now we're going to mount the actual brush motor esc to the frame now on the left side you have the receiver box on the right side that's where we're going to put the brushed motor esc then we'll just have it like this so these the signal side comes out towards the front of the vehicle and for this you need some heavy duty scout scotch mounting tape so i want to remove that get off of me and then remember we want the signal line to be pointing this way so we're going to mount it just in the middle there's a little drop down here we're going to mount it in the middle of that just press down and now that thing is locked now we need to combine the motor that is already on this chassis with the motor driver our brushed motor esc so we have four different lines coming out two of those are going to connect to the battery to supply power to the vehicle the other two um are going to connect to the motor and these are very simple connections they just plug right into one of one another you're going to attach red to red and black to black and just press that in and there we go you want to push that in so that the motor bullet connector is all the way inside of the connector on the motor esc now we'll do that with the black one too and there we go we have our motor now connected to the motor esc and this is going to plug into the pixhawk so the pixock is going to send a signal here which is going to translate to a signal on the esc which is then going to drive the motor now remember this is just the first part of the build so we're not really worried about securing everything down exactly how it's going to be we're just trying to get the vehicle into its minimum viable driving state so that we can test the straightness and tweak the tie rod length to get it to drive really straight so with that in mind we're not going to mount the rc receiver yet we're just going to take the servo wire and plug that into channel one channel one is going to be on the very bottom and the signal pin on the servo is the yellow and ground is brown so signal is closer to the middle of this receiver and then let's go ahead and connect the brushed motor esc to the receiver and white is signal on the brushed motor esc and let's connect that actually to channel two and i'll show you why in a minute normally throttle is channel three but just for this initial drive it's going to be connected to channel 2. we're going to want to change this later underline what i just said we're going to change this later okay now with everything wired up to the receiver let's go ahead and plug in our battery and you won't hear any noise at first and that's because our switch for the motor esc is in the off position so put that on and you hear the the beeping which means we're now live so turn on the rc controller and you hear another beep so currently i should be able to control the throttle of the vehicle now channel 2 we set up to be the throttle and channel 2 on this setup happens to be this switch right here and as you can see i'm actually able to move the vehicle with this switch so that's good we now have very basic control oh god basic control of the vehicle but one problem right we have not configured the steering servo yet and why is that is because we didn't know how to mount the horn of the servo until we knew what the center position is so once we turn on our rc receiver um channel one is horizontal on the right stick so that right now it's in exactly the middle position so that middle pwn signal is being sent to the servo so right now we know that the current position of the servo is neutral it's right in the middle okay now that we know the center position of the servo it's currently in the center position we can actually mount our servo horn now there's two sides to this we have this side and then we have this tooth side this is going to be the side that is facing the servo and then there's two ways to secure this down to the servo you have these two little tighteners on the side here and then we also have a set screw that will place directly down the center here so but first let's just place this so it's almost as perfectly centered as we can get it this is about center here and this servo comes with a little set screw so we're just going to thread that in here there we go that's pretty secure and then to get those little screws on the side we need a little m 1.5 hex key this doesn't have to be insanely tight just you know just tight enough so where we have a good secure servo horn now we need to actually connect this tie rod to the servo the steering servo because that's what it's doing right steering so what's going to happen is the servo will turn this way and it'll turn the vehicle and then we can also turn this way so let's go ahead and secure the tie rod down to the steering servo and we can do that with an m 2.5 hex key screw and this is about one centimeter long so this is going to just press fit through the first part of the tie rod and then the rest of the these threads are going to thread into the horn of the servo we can tighten that down a little bit i'm going to press left on my rc controller and it turns it left now if you look at our back two wheels they look pretty straight right they're pretty parallel but our front wheels they're a little off balance it's kind of like they're they're kind of bowed in a little bit instead of straight like this so we can actually fix that by extending this rod right here right they're kind of bowed in right now and if we extend that rod they'll slowly go straight and to extend this rod we actually have to unscrew it right here so there we go this is removed now and if we turn it counterclockwise we can actually lengthen this rod now let me just go too far so you see what will happen if we go out too far so they were a little bowed in before now they're going to be really bowed out see if i try to place this back here you can see now the wheels are bowing out so that's too much so before it was too little you don't want to go too crazy in either direction really a process you want to take your time with so i am going to leave mine about like that because the wheels weren't too badly bowed in so i'm going to secure that down now i'd say that looks a lot better it wasn't too bad before but that looks almost perfect okay the next part we're going to be focusing on in this build is making sure our rover drives relatively straight we can do this by adjusting the length of the tie rod on our rover that connects the servo to the two front wheels so we're going to start out with the tie rod tightened down all the way but we want to get our rover aligned so that it drives relatively straight it doesn't have to be perfect but you want it to be pretty straight okay this is test one i'm gonna drive without steering and see how straight this thing is so as you can see that pulls to the right pretty hard so i'm going to adjust that tie rod and make it a little bit longer and i'm just going to lengthen it by a few turns and then see if it starts to drive a little more straight there's one two three i'm gonna try that out all right test two we lengthen the tie rod a little bit let's drive forward and see how straight this is so it's definitely better so we're gonna lengthen that tie rod just a little bit more not as aggressively as the first time but maybe just a couple turns and we'll try it out again all right this is test three just lengthening the tie rod a little bit more hopefully it goes straight and it's not veering to the left let's time let's try it out so we're still a little off we could probably go another turn or two all right here we go here's another test and as you can see that was pretty good it might have started out aiming to the right a little bit and then drifting to the left now how many of you have gone on the highway you know you take your hands off the wheel and you see how long the car can go straight forward before you start to panic because the car starts drifting i might be the only one but you will notice that if you let go of the wheel on the road your car starts drifting and that's because just like we were dealing with with our little rover the tie rod lengths aren't exactly perfect but they don't have to be perfect because they have a human pilot accounting for the errors right starts to drift a little to the right your brain's like oh let me pull to the left well similarly with our build we don't need to get it perfect we wanted to get it as close as we can to perfect but it doesn't have to be perfect because we're going to be running the control through the pixhawk or the flight controller and this is going to be like analogous to the human in the real car example if the rover starts to drift a little bit to the left the pixhawk the flight controller will pick that up and be like oh oh what are you doing rover let's let's shift you back in this direction and that'll happen automatically in the autonomous mode so we don't have to worry about getting this perfect just get it as close as you can and but don't obsess over it have i have i made it clear yet that we offer a complete rover kits for you to build yet i don't know but here here's wally so funny thing about youtube is that after you publish a video you can actually slice out parts of it so this part is going to get sliced out at some point if you're watching it obviously it's well it hasn't been sliced out yet but if you are one of the early rover purchasers you're also going to get in addition everything else that comes with it a free video consultation with me so if you have any questions about the rover any missions you have in mind and you want to kind of brainstorm about the technical aspects of it a free video zoom call with me is going to come with your personal wally as well so if you're watching this the offer still stands if not then you had no idea about this anyway so okay so after that alignment is done we have completed the part one of our build series now that we have the alignment pretty much straight uh we're gonna start actually fixing the various pieces to our frame you know you notice here there's a little box that has four little screws that is where we're going to put the receiver and ppm encoder inside of and makes it semi waterproof so let's go ahead and take that off with the m 2.5 hex key that's where our receiver wires are going to be hanging out now let's unplug what we had plugged into the receiver we're not gonna need that anymore so the rc receiver has six channels and what this ppm encoder does is it takes the six channels and you see all these wires it takes that and puts it into just three wires so it makes cable management much easier so the channels on the ppm encoder start with the white being channel one orange being channel two and so on so we're just going to plug that into the rc receiver with the color code just like that so then we go to orange and so on there we go that's what that will look like when it's done now i'm just going to wrap this around once and i'm going to put one piece of normal sticky tape on the back of the ppm encoder all right there's our finished product and that is ready to place inside of that little hub that we opened up right in here there we go our receiver is protected in this little box but we have access to everything we need on the outside all right next up we're going to assemble the gps mount now it's pretty straightforward here's the base of the mount we'll start out installing this piece here and you'll see one side has a side for the head of a screw to go into the other side doesn't so just make note of that and we're going to screw in this piece right here there we go and you'll see there's a little hole in there that's going to be the set screw so now we're going to take our pole here and you see there's a shaved edge right there that's going to be facing the side that the set screw is going to be screwed into so there we go that should lock that pole into place now we're going to take this piece and slide it on down we can go ahead and tighten that down there we go now this isn't so wobbly now we're going to take this piece and there's another little shaved edge on the other side of this pole and another set screw on this piece hard to see there but make sure those are facing each other and then we'll screw in the set screw again there we go so this is the mount side that'll go onto the frame and then here we're going to put a piece of sticky tape there we go and we will keep this side on until we have installed this gps mount to the chassis now you can get creative with where you want to mount the gps on your chassis maybe you don't even use one of these conventional gps mounts that's what i'm going to be doing for this build however so what we're going to do is secure it with a simple little screw i think this is an m3 so there's a little hole here so i'm going to screw this in through the hole and then this will actually thread into the bottom of the gps stand there we go we have broken through to the other side so now you should just be able to take this mount and just thread it in then we can mount our gps module to that gps mount now this is going to be the front direction of the vehicle you see there's a little arrow on the gps so once we take this off make sure to align the front of the vehicle with the front of the gps and there we go our vehicle has gps now all right so next we're going to install our wi-fi telemetry module and i'm going to place mine right here before you mount it though you should make note of what's on the back because there's going to be some crucial information on the back so ssid that's going to be the name of the wi-fi network we connect to then the password alpha uav link then the port we connect to will be one four five five zero this will might be different depending on what your wi-fi module is but definitely make note of what's on the back before we mount it so you don't have to unmount it to see what the heck your password is and then we want this connector to be facing the inside of the vehicle because that's where the pixhawk's going to be maybe even take the antenna here of the wi-fi module and just place it in one of those holes of the gps mount all right next up we're going to mount the pixhawk to the chassis of the vehicle we're going to do that with this super duper mounting tape i'm going to use two pieces here let's stage out where we're going to put it first this is pointing towards the front of the vehicle so steering is up here so we want the arrow of the pixhawk to be pointing this way and let's make sure the pixock is in about that area we want enough space back here so that we can actually plug in our servo pins to the rails on the pixhawk and if we're too close here we won't have access to that so make sure there's a little bit of space there for the pixhawk let's stage that out okay we'll we'll place it around there i'm just going to fix this tape to the pixhawk now there we go let's go ahead and place that on the frame now right then when we're happy with that that looks we'll just go ahead and press down on that lock that in place all right next thing we're going to talk about and install is the power module what is the power module well we know we're powering our vehicle with a lipo battery and this is what a normal power module looks like it has xt60 connectors one side connects to the battery we'll have a wire that will be coming off of the power module and this will power your picks hawk and then the other end will power the vehicle in our case it'll power the motor esc now you'll notice right away that the battery and the power module don't have the same connector so you can have you can bridge that with a dean's 2 xt60 adapter but what would be better is if we just got rid of this and got a power module that had a dean's connector on each side that's the red connector also called a t plug at times but we're also going to be needing to make some more modifications to this power module outside of just the connectors and that is because we need to power the jets and nano now the jets and nano takes the power input here at the usbc adapter and it needs a 5 volt and a 3 amp power supply so how are we going to power this thing well it's going to be a little bit tricky of the process we're going to make some mods to the power module so here is what we call a ubeck it inputs a voltage from 5 volts to 23 volts and outputs a 5 volt 3 amp power supply so that's what this is right so this is the battery side goes into the power module then on the outlet we soldered on this ubec but the problem is we still don't have that usbc connection so we also have to solder this end to a usbc power cable can be a little bit of a tedious process but at least you know what you need to do kit purchasers actually have this pre-soldered and pre-put together so you guys don't have to worry about this okay so that about wraps up the installation of the various parts now let's start wiring everything into the pixhawk the central control unit so first let's start out with the servo so we have this big long servo wire so we have aux out and then we have main out we want to plug in this pin to main out the first slot here we go so the pixhawk will be controlling that servo the steering servo through aux out or a main out one and then next up we have the brushed esc here signal is white and this is going to plug into main out 3. now remember that ppm encoder well that is going to plug into this rc column right there there we go that's what the back of the picshock will look like now let's start wiring in everything to the connections on the top of the pixhawk so let's wire in the gps there's actually a slot called gps on the pixock plug that in there and then plug in the other cable to the i2c port on the pixhawk this is actually the external compass next we have the wi-fi telemetry module we'll place that into lam one here we go we have gps i2c to m1 for the wi-fi telemetry next up let's install the power module now the end that has the pixel connector on it that's the side that the battery plugs into and the battery is going to be coming from the back end of the vehicle i'm just going to slide this up here then the battery will plug into this now we need to connect the motor esc to the other end of the power module and this will be a static connection we'll never change that and then the cable coming off the power module needs to plug into the power port of the pixhawk we'll plug into this port and now our pixhawk is getting power from the battery from the power module now we're going to install the buzzer that will provide some helpful audio feedback to us it'll go off whenever we arm the vehicle for example to do that we're just going to take a piece of this double-sided tape and then you know you can choose where you want to put this i'm going to put this at the very front of the picks hawk and don't cover up this buzzard port because we need to plug that in there we go next we are going to install this little connector it connects the pixhawk on this side to the jetson nano on this side and this will just plug into tilem 1 or to m2 right now we have the other telem port plugged into the wi-fi telemetry there we go and we'll plug this in after we install the nano all right now wally need some eyes of course so we're going to install this webcam it also has a mic in it which will make it handy for future projects where are we going to mount this well we want it to be the front of the vehicle so we know where we're driving so on our wall-e kit i recommend mounting it right here on the back of this servo so it'll sit something like that and i'm going to do that with the mounting tape the red mounting tape put it on this side of the webcam there we go now i'm just going to try and mount that as center as i can on that servo it's actually a really nice fit there make sure it's flush and then just kind of press it down now wally has eyesight and you know if you're driving in some bumping terrain you can always fix this camera down so it doesn't jump on you if you're driving on smooth terrain you don't have to worry about that and this extra cable length you know you can choose to trim it if you want but it actually stays pretty nicely right there you could also choose to zip tie it down if you want but then the usb cord will plug into the jets and nano whenever we install that okay now we're going to mount the jets nano to the chassis but it's kind of an awkward piece it's difficult to mount there's not a lot of good mount places on the chassis so that's why the drone dojo kits are going to come with this custom mount this is a really cool mount kind of looks like an elephant a good friend hutton designed this here's how the jets and nano will fit on there it aligns with the mount points on the jets and nano and then it will mount onto the vehicle by slotting into these two holes here on the frame and it'll just press in like that and that elephant trunk part is actually designed to rest on top of the pixhawk to provide some extra support and it should be covering up the switch pin which we don't need for the rover builds the mounts that will be in your kit will have holes on the back on the bottom here of this mount that you'll takes a hex key and just sort of torque that down on either side you'll notice we still have access to all of the pins of the pixock after the jetson nano is installed and that was because hutton's design raised the jets and nano up a little bit so that everything is still accessible so how will that look um with the jets and nano it'll look just like that we're going to have our peripherals our input to the jets nano facing the middle of the vehicle so that's how it'll look let's secure the jetsa nano to that mount now you'll want the elephant trunk side to be towards the usb ports and it secures down with m2 screws and they should be six millimeters long so let's go ahead and secure that down there we go that's what this will look like after the mount is installed so let's now attach that to the chassis and now on your mount be sure to take an m3 screw put it into the bottom of this peg hole and screw that in to the mount so that is now secure to the frame just thread that in with a hex key and then that camera usb all you have to do is plug it into one of the ports now you got a camera feed all right then we will take that usbc that is coming off of the ubec on the power module and we'll just plug that into the usbc port of the jets and nano and then our jets and nano will be getting power all right so before we move on to the jets and nano you might notice we have a wiry mess and that is why we supplied you with a plethora of the zip ties zip ties are your friend on this build so we're gonna just spend a little bit of time securing everything and i mean there's no right way to do this this is just going to be whatever your preference is there we go now the build looks a lot nicer you can be creative with how you want to use your zip ties this is the battery connector so it needs to be close to here which is where the battery is going to sit right it's going to sit something like this so however you mount the power module needs to have enough slack to get to the battery and then one note about how to secure the battery i mean this works pretty good just with one simple strap of velcro all right now we're going to flash the pixhawk with the firmware in our case rdrover go ahead and open up mission planner and if you don't have mission planner literally just google mission planner and you'll find a download screen we're gonna go to setup install firmware and here is where all the magic happens so we're going to select the com port associated with our pixock if you haven't already plug in a micro usb cable to the pixhawk and plug that into the computer and don't hit connect we're going to leave this disconnected but find that com port for that usb that you plug in now we're going to select the vehicle type we want to use and everything displayed here is the latest if you wanted to find an older version you could go to all options and then find whatever version you wanted to use here of note i already do have the micro sd card slotted into the pixhawk and this will not work if you don't already have that in there so go ahead and do that if you haven't i am going to just go with rover 4.1.0 and it will prompt you are you sure yes yes platform aka the flight controller ours is pixhawk1 and then just hit upload firmware and it's going to download this from the internet first and it's going to erase the old firmware and try to load up some new firmware now it should try to automatically disconnect the usb cord and reconnect if that doesn't happen it might get stuck here for scanning com ports so if you're stuck at that point just manually unplug the usb cable and plug it back in there we go about 30 seconds later the upload is done and you should see a flashing light on the pixock at this point you could connect to mission planner do that and then we can confirm that version under the messages tab in mission planner so go to data messages and here we go we have rd rover 4.1.0 so i'm not going to cover this here because there's a ton of resources online to do this and it'd be kind of redundant but once you first set up your pixhawk with firmware you need to do a couple calibration steps for various sensors so go to mandatory hardware and you need to do excel calibration compass calibration radio calibration um and that's about it for the mandatory stuff you could do battery monitor but definitely these three you'll need to do and i'll link in the description uh for the documentation i had on how to do that all right now we are going to connect to the wi-fi telemetry module and it's very very easy actually um so i'm going to pull up my current networks you'll see alpha uav link is currently not online but for my module this is the name of the module i'm going to plug that in and a couple seconds after that that should be a very strong signal and i'm plugging into uh to lam one and again the network that you need to connect to will be on the back of your wi-fi telemetry module so i'm going to click on that and connect and while that's connecting i'm going to open up mission planner and here we go mission is automatically connecting to my pixhawk through the wi-fi connection so how would you do this if it didn't automatically boot up um you would click udp and then select your baud rate you can actually select that if you try to connect ones in x out select your baud rate mine is 921600 and then hit connect and then enter the local port that your telemetry module is broadcasting on for me it is one four five five zero this will also be on the back of the telemetry module then hit enter there and then the connection should start and now it's very simple you're just connected to um the pixhawk with wi-fi instead of the conventional 915 megahertz radio signal so there we go that's pretty much it if you're having any trouble connecting um you might need to change a couple parameters first is go to brd [Music] brd scr1 and make this zero it'll be default too and then go on to serial one and then change the serial bot to 921 or whatever your wi-fi telemetry module says all right so this point we should have a rover built not yet ready to drive there are some things we have to set up on the rover before we can start driving it trust me you don't want to just jump into driving the rover the first things we have to set up is related to the remote control so i am demoing on a fly sky i6 um rc controller so on a drone you have four channels you have to worry about right roll pitch yaw throttle on a rover really you only need two channels for controlling the vehicle and that is going to be roll for steering and throttle for going forwards and backwards conventionally you know on a rc controller you have one stick that automatically centers to the middle and you have the stick that stops wherever you let go this one is typically the throttle stick the problem with that on a rover is we need the throttle to be able to go forward and backwards but with this throttle stick we can only go forward so we need to map the throttle control to this stick the one that centers automatically to the middle so i'll show you how to do that first we need to find out which channel this vertical axis on the centering stick is so it'll be different for you depending on which controller you have but i'll show you that on the fly sky fsi6 hopefully you can see that you're going to go to system kind of hard to see upside down scroll down to sticks mode and we'll see which channels are mapped to the individual axes so we see our centering stick is channel 2 so we need to make channel two the throttle on our rover and the steering oops let's change that the steering is channel one the horizontal axis on our stick over here so let's go ahead and set that up all right now we have the rover connected to mission planner and let's go ahead and make those rc adjustments we were just talking about so very simple to do all you do is go to config and then full parameter tree and look for a parameter called hey okay stop it look for a parameter called rc map there it is and remember we want the throttle control to be on channel two or at least for my controller for uh the throttle to be on that automatic centering stick it's channel two so all we have to do is hit rcmap throttle and enter in a two here and then so we don't overload channel two let's go ahead and change rc map pitch to channel three and remember we also wanted roll to be on channel one because roll is the steering control on a rover well that's already set up as channel one for us or for me it might be different for you so um get the rc map the way you want it and then all you have to do is hit right params and it's really as simple as that now we can control the throttle on our rover with channel two which is awesome because we can go up and we can go down to go backwards on the rover okay now that we have our rc stuff set up it's time to set up something that is very very important which is the motor spin direction so how do we test that go to setup optional hardware and go down to motor test now kind of hold the rover up in the air a little bit put the throttle to 15 and the motors whenever you hit test all motors the wheels should start spinning forward right so we're gonna hit click that and as you can see on my rover the motors are actually spinning backwards so the firmware is trying to move the motors forward but the motors are spinning backwards so we fix that by going to mandatory hardware servo output and then look for here we go throttle and just click that checkbox reverse yours will be like this it won't be checked check that checkbox and then head back to motor test and one thing before we go back there it's a little confusing right because we set throttle to be channel two but this is under number whatever that means three ignore that just um reverse here and then go back to motor test and now that we've reversed the throttle whenever we hit test all motors the wheels should now start spinning forward and as you can see on my build that is now the case this is something that is extremely important to get right because some of the drive modes are dependent upon knowing which way is forward right so in auto mode if you try to tell the rover to drive from one way point to another and it tries to drive forward well if you have the motor spin direction wrong it'll actually rocket the rover in the wrong direction and it can be kind of tempting to fix the motor spin direction in other ways like i tried to do maybe or maybe not like you might be tempted to go to the rc parameter rc2 and be like well what if i just do rc2 reversed and put a 1 here to reverse that rc channel yeah that doesn't that doesn't work um you might be tempted to just change these reverse the signal on your rc controller itself that doesn't work either you absolutely have to change the motor spin direction under servo output and checking the reversed checkbox all right now after we get the motor direction situation figured out there's another thing regarding the motors we have to test and that is the dead zone so you might have noticed whenever you input a percentage of throttle and tested all motors that the motors didn't spin at all in my case the motor there's only one motor so maybe then you went up to 10 and you hit test all motors again and it didn't go and then finally you got to let's say 15 throttle you hit test all motors and the motors were barely spinning but um you found that anything past 15 the motors will spin so that will be different on every single build and you need to identify this dead zone because if the motors don't start spinning till the throttle is 15 that means you move the throttle 15 percent and the motors won't react at all the lowest throttle percentage required to get the motor to spin the wheels at all you need to find that in my case mine was 15. go back to config and then find mot for motor and then mot underscore throttle underscore min and then write in that percentage here so minus 15 so i'd write 15 and then hit right params and then after that you should be able to go back to motor test now put a one percent throttle test all motors and the wheel all the wheels will start spinning at that one percent throttle now okay so now the rover is basically ready to drive in manual modes that is modes where you are controlling the drone with um the rc controller and you're in manual mode there is one thing you do not want to skip if you plan on doing autonomous missions with your rover so go over to config and basic tuning now if you come from the world of arducopter and you have a drone you might have been familiar with the auto-tune mode which is a mode that finds the optimum pid gains for the drone unfortunately with rover there isn't a mode or a way to automatically find these optimum pid gains you you actually have to do this on your own there is some pretty good gotta give some respect to yay jail part two donda good album check it out there is some pretty good uh documentation on this subject on audiopilot's website so we have the tuning turn rate a lot of good stuff here and then we have the tuning speed and throttle page so you'll definitely want to follow these two guides and those help you find these pid games that you enter in here and gets some really nice control on your rover and you really want that before you're doing autonomous missions it can be a little bit painful because i mean the documentation is a great place to start out but it's a little bit old and there are some holes that you need to to figure out on your own it actually took me gosh about an entire day to figure out how to tune my rover but um yeah just be prepared for a little bit of pain there for kit purchasers from the drone dojo your rover is going to come pre-flashed with the optimum pids for steering and throttle so you actually don't have to worry about this tuning if you're good with the gains that i am using which is pretty decent out of the box all right now let's just set up a couple miscellaneous parameters um one thing that is nice to do on rovers is disable the safety switch requirement so go to brd um area brd safety enable yours will likely be one go ahead and change that to a zero now let's set the speed of the rtl mode we'll learn a little bit about that later right now just change rtl speed to one meter per second that's roughly you know two and a half miles an hour um now go to wp and change wp speed to one meter per second i think one meter per second is a good starting point just because it'll work for a wide variety of rover types and you can always raise that later if you need to so set all those and then hit write params and again kit purchasers will have all of these and more parameters presets so you don't have to worry about a lot of these you only need to change the things that you want to change okay this is the last thing we're going to talk about before we actually start to drive the rover and this is rover control modes so there are different modes that you can control the rover from like acro mode guided mode hold mode all these provide different functionality and we can actually switch to different modes from our rc controller or other sources so we're going to set up the mode changing system on our rover so with the row we're still connected to mission planner go to um actually let's start out in setup mandatory hardware radio calibration turn your rc controller on and turn one of your knobs look for channel five you want one of your knobs to be on channel five because that is what uh we're going to configure our our control modes on so once you identify which knob is channel five um we can move on to the next section if channel 5 is not currently a knob maybe it's a switch you can change that on your fly sky or whatever rc controller you're using okay so then after we have identified a knob using channel five we need to configure that again with parameters and we're going to go to mode channel so i think yours will be set to channel eight by default let's change that to channel five and then hit right params okay so the way this works you know the range of a pulse width modulation signal is from thousand to two thousand so different chunks are going to change the rover into different drive modes so which drive modes well now we go to setup and flight modes and you see here from so flight mode to manual that will happen from 1231 to 1360. so for now let's set the first flight mode to hold and we'll talk about what these are in just a second and then set the rest up to manual and then hit save there now let's go to the data screen and when you change that knob there we go you'll see the the control mode is changing now so we're going to now go out to the field and test a couple of these control modes all right now we are out in the field it's finally time to start driving the rover so we got our setup here got the laptop for ground control station got our controller extra battery let's do this now drone or the rover is currently battery powered up so let's start out learning about the hold mode now let's power on the rc controller okay so this knob right here is the one that is currently set up to control the flight modes on the rover so turned all the way counterclockwise is what we set up to start out in hold mode so with that in hold mode and you could also confirm that by looking at your mission planner connected through telemetry so how do we arm the rover well very simple you just take the steering stick this one that goes left and right and you hold it all the way to the right and you'll hear a beep i don't know if you heard that but that now means the rover is ready to be driven now if you hold it all the way to the left it'll disarm okay so conventionally the hold mode is really just there so that you can arm in a safe mode because in hold mode the rover doesn't respond to any throttle commands or steering commands it just centers the steering wheels and lets you arm it just think of that like you know it's a you turned on a parked car right the the motor's running it's ready to go but you need to shift modes okay so next up we're going to look at the manual flight mode or rover mode so that is we configured the flight mode to be directly next to hold mode so let's go ahead and arm the rover going all the way to the right mine is already armed and then shift into manual mode now if you look at the rover it will actually respond to steering commands it's going left it's going right if i throttle up it'll go forward if i throttle back it'll go backwards so this command is very this this drive mode is very simple so i'm controlling the rover now in manual mode it's very simple it just responds to the commands that i am sending through the rc controller nothing fancy going on here but this is the ideal mode just to toy around with the rover in this is the manual mode all right so now we know a little bit about manual mode let's talk now about the guided flight mode this is a very important flight mode essentially it puts the rover into a state where it's just waiting to be commanded to do certain drive commands so we can set that how we did previously by going to uh setup and then flight modes but if we have this ground commission planner set up we can also change modes a different way so go to actions tab and then check out guided and hit set mode and now you see this change from manual to guided mode okay and now what are we doing here well i said it the vehicle is essentially waiting to be commanded to move and that can the commands can come from many different sources one could be simply mission planner so right now buster and not buster wally is in the parking lot and let's say i want wally to drive you know right here i would right click on the map and say fly to here and the altitude doesn't matter because we're not dealing with altitude so you just hit enter and there is wally driving to that waypoint and now the speed is currently at one meter per second and that is what we set up with wp nav or the wp speed all right now let's try to get wally to drive back all you have to do is do the same thing we just did and the rover should now drive to that waypoint so this is a very handy method we can all also use the guided flight mode to control the rover with python scripting and we will get into that at the end of this video but yeah that's essentially the guided flight mode okay next up let's test out the auto control mode it's very similar to guided flight mode but the think of guided flight mode as giving you dynamic mission capability that is also autonomous so the mission doesn't have to be pre-planned now with the auto flight mode you can still have autonomous driving functionality but the mission has to be pre-planned okay so maybe you know if you wanted to mow your yard with the rover maybe that could be a pre-planned type of mission whereas maybe a delivery mission would would need to be more dynamic so let's set up a basic mission for the auto flight mode it's pretty cool and pretty easy to set up just go to plan in mission planner and click on the screen oops i don't want that waypoint click on the screen to trigger a waypoint to drive to and you see that waypoint populates here and you could just create a little mission so i'm just going to have it drive to waypoint one waypoint two drive to waypoint three and then go to waypoint four so these are simple waypoint commands you can also tell the two other things like set a servo at a certain point or control the yaw but once you have your mission planned out okay then you would just hit right and you're gonna write that autonomous mission from the laptop your ground control station to the rover so now anytime you trigger the drone or the rover to go into autonomous mode it's going to run this mission so now if we hit again change the mode in mission planner now let's go over auto and click on set mode we should see the rover begin its mission oops there we go so he's going to way point one and hopefully he can make a good turn there we go now heading to waypoint two and again we could speed up this rover speed with those parameters i believe it's wp speed this particular rover tops out at about four meters per second it's currently set to one but i just like uh you know a little bit smoother of a mission now it's heading to waypoint three i believe and this is all you know by itself i'm not controlling it at all this is just the ardupilot firmware running our mission and then you hear a little beep when the mission has completed it went boo boo boop there's a little little beautiful sound right there so okay now the last mode we're going to look at is the rtl drive mode and let's actually set up our rc controller to be able to trigger this mode because we have a little bit more range on the rc controller than we do with the telemetry modules and we need the telemetry module connection to set flight modes from mission planner so go into setup flight modes and flight mode 6 let's up to rtl and then hit save modes there now whenever we turn that knob on the rc controller all the way clockwise rotation we will be in rtl mode now what is rtl mode well it stands for return to launch so whenever you arm the drone or the rover it saves the location it's at as the home waypoint and if you switch if you drive around a little bit and then you switch into rtl mode the rover is automatically going to drive back to the waypoint it was armed from so let's go ahead and test that out so right now i'm going to start out in hold mode and or actually still armed so let me disarm and then rearm again you would want to arm you'll hear a beep there you go now i'm going to switch into manual mode i'm just going to drive around a little bit oops that's going to drive around a little bit a little hard to film and drive but you know we're doing it okay so now let's say you know i'm i don't want to drive back wally come back to me come back all you have to do is switch into rtl mode on your rc controller so i'm going to do that right now and here we see again i'm not driving it the rover going gonna drive back to the home waypoint all on its own one thing to note is it will take the quickest path from where it is to the home waypoint regardless of if there's any obstacles and that it can be a problem so the folks at autopilot developed a flight mode called smart rtl which essentially means the rover is only going to return to launch based off of safe paths that it knows it's already traveled all right so now we have done some really basic control of the rover but you know nonetheless pretty cool to be controlling the rover with different flight control modes now we're going to start getting into some a little bit more advanced stuff so in the past we have used the pixhawk for flight control and we've used the raspberry pi as a companion computer link them together and we see we can do pretty interesting stuff with that like taco delivery like 4g drone control you can do a lot of stuff with this combination in this section of this video however we are going to work with the jets and nano as our companion uh computer instead um now comparing the raspberry pi and the jets and nano they're very similar in a lot of different ways right the processor it has very similar processing speeds same amount of cpu cores very similar peripherals the the main differentiator here is you might notice there's a huge honkin heat sink on the jetsa nano and nothing really here on the pi and that is because there's an extremely powerful gpu on the jets and nano it actually has 128 cores on it so it makes it a really interesting device for onboard artificial intelligence machine learning things like that now i mean there's pros and cons to each one of these boards the pies are actually becoming more expensive than the jets and nanos but the pies have pretty good commute pretty good really good um community support whereas the jets and nanos kind of mediocre right but they're incredible devices very powerful um probably more powerful than the pi so so that is what we're going to be doing in this section we're going to be linking up these two devices and i'll show you how to control the pixhawk from the jetson nano and if you can communicate to the pixar from the jetson nano you can control your vehicle so it's pretty cool once we have that communication bridge we can do anything really we can do simple things like python based control of the vehicle like we've shown you in the past on the pi with copters we can do artificial intelligence opencv so many different things so let's just get to it okay the first thing we're going to do to set up the jets and nano is set up the sd card that'll hold the operating system image you can find that at the nvidia jetsa nano documentation which i will link to you can get away it says with a 32 gigabyte sd card but um it recommends you go with 64 gigabyte or higher so i'm going to be going with 64 gig now here is where you get the operating system image now this is a pretty large file but i'll link to this url so you just click here and it will begin a very long download and once it's done we need a way to flash this operating system image to the sd card i like to use etcher you can use whatever you want i want to go with etcher in this video so i'm going to open up my etching software okay so we're going to flash from a file and after you extract the jetson nano image the image name is sd-blob so we're going to select that from the download and then select target i am going to select the sd card that i have plugged in select and then hit flash it's about 20 minutes so kick your legs up do some scrolling on the phone and then you know in a blink of an eye 20 minutes will be by and we'll be ready for the next part of the video six and a half hours later all right then once that is done flashing we have to insert the sd card now it's a little bit hidden on here you see here underneath this little little huge heat sink you have a slot right there so with the electrodes pointing up towards the heatsink you just kind of slide it in there and it should should feel a little click now you're good to go now this has a giant gpu so we're not going to be setting this up in headless mode we're actually going to be hooking it up to a monitor so first thing we need to do is plug in the hdmi cable there we go then we'll need a mouse to control it and then the keyboard will need a keyboard obviously and unfortunately on the jetson nano there is not a built-in wi-fi wireless interface so we actually need to plug in the little wireless adapter that comes with the jets and nano so it's not a huge deal you also have access to the ethernet port if you'd rather get internet that way can you you know you always need to flip it three times before that goes in and the last thing we need to do is power up the jets and nano the main power is through the usbc port right here again that's five volts and three amps you can also power through the gpio pins if you wanted to do that which actually works out on our build but for now we're just going to plug in a little usbc slot and power this thing up and once you power up you should see a light right here right now i am booting up the jetson nano we'll get to this little splash screen here it might take a little bit of time to fully get booted up all right then once you see the beaver that means you're at the setup window so we just have to run a couple of initializing steps so we're just going to accept the terms and conditions because who reads those and select your language now we can connect to a wireless network mine is concrete the lame so i'm going to connect to that so anytime the jets and nano sees this network it'll automatically connect now here you'll want to remember what you put in here so i'm going to say my name is caleb your computer's name i'm going to name mine drone dojo then my username i'm gonna say i am caleb berg and then password you'll need to remember this because at some points it will be nice to ssh into our jetson nano remotely so we don't have to have a visual interface and you'll do that with your username the ip address that is assigned to us and the password you set up for this username so definitely remember your username and password partition size make make sure this is the maximum size and that will be there by default swap file definitely create the swap file and then delete unused bootloader boot loader partitions go ahead and do that and that step will take maybe two minutes after that just hit continue on the default and most of your operating system configuration steps should now be complete so just let this uh finish out and then after it's done you'll want to do a reboot now we can log in to the jets nano and this is ubuntu and here we are this is the background of the jets and nano one more thing i like to do right when i start out is activate my mobile hotspot on the phone and connect the internet to that so mine is dojo phone i'm going to do that just set up that connection now and once that connection is established the nano will automatically connect to dojo phone my mobile hotspot anytime it detects it which is really helpful for when you go out into the field and you don't have you know a visual screen you can just activate your mobile hotspot and the jets and nano will automatically connect to that okay so now i am here on the jetson nano pulled up a terminal you can do that with hitting control alt and t at the same time and we just have a couple dependency installations we have to run so let's just jump into that so the first thing we want to do is run an update we'll do sudo apt get update and this will take a little bit just let it let it do its thing and then after that's done we're going to install a bunch of things with apt-get again python pip python dev screen python exit f4 python xml and git so we'll i might uh link to that if i'm feeling nice so you guys don't have to type all this no promises though so run that up or what oh has to be apt not abdica sudo apt get install all right so we installed a bunch of things with the apt-get package handler now we're going to install some things with the pip python package handler we're installing future pi serial and then the big ones are drone kit and mav proxy these two programs allow us to communicate with the pixhawk from the jets and nano so those are the big crucial ones okay then once that is done we have one more thing to download let's first make a directory we'll call this repos a little bit of foreshadowing there a little bit of three second foreshadowing then we'll cd into repos and we're going to download a repository from the drone dojo github which is called pi drone scripts we can do that with git clone https and then we're just typing in the url of the repo you want to download i know it says pi drone scripts that's because this repo was initially comprised of scripts for a drone that had a pi raspberry pi is the companion computer but it has since grown into a jets nano companion computer with a rover vehicle type but a lot of the scripts still work so don't worry about the weird name and that will have downloaded now and if we go into pi drone scripts we have 4g drone you can ignore that camera some stuff in there will be useful dk is short for drone kit so we'll go into drone kit which is think of drone kit as an api into controlling your vehicle in our case a rover so you see there's two different vehicle types here under drone kit and under rover you're going to have a bunch of example scripts so there's one script on location based movement uh velocity-based movement and some other fun things that precision parking aruco mission that i showed you at the beginning of the videos there so we're going to run over some of these scripts now all right so now it's time to physically connect the jets and nano with the pixhawk you'll need a cable like this with a df-13 six pin for the pixhawk and these 2.54 millimeter connectors on the other side i believe you can also connect from micro usb to micro usb here on the pixhawk but i have not tested that yet so very simple on the pixhawk end plug in the connector and this should already be plugged in on your build but you'll plug in it's hard to do with one hand voila okay the red is going to be toward the left of the pixel ground is right on the pick sock you can plug into either telem 2 or till m1 doesn't matter and we are establishing a uart connection with the jetson nano so let's find vcc the red and the pin out is actually kind of labeled here on the side which is pretty handy we're going to plug vcc red into the 5 volt line and then after that is ground so grab the black wire and plug that in there we go next up um we are going to plug the blue wire in directly above ground and last but not least grab the white wire and plug that directly above the blue wire and now we should be able to communicate across this uart bridge to the pixhawk from the jetson nano one more thing that i do like to do is sort of make each one of these individual 2.54 millimeter plugs into one by just tacking a little bit of hot glue across all four so it becomes one unit harder to rip out not required but it might uh might keep this plugged in a little bit better okay i'm back into the jetson nano let's go ahead and test that connection that we just established so i'll open up a terminal now the first method as i said previously is going to be map proxy now map proxy is a command line based ground control station so how do we access that well on the jetson let's start out saying sudo mav proxy and we should be able to just hit tab after typing some of that and it'll auto complete and dash dash master here we're trying to feed into mav proxy the device or ip address we should be using to communicate with the pixhawk now the uart device on the jets and nano is called dev slash tty th s one okay so that is the uart device that we just wired up so if we hit enter here and enter in our password this should establish the connection with the pixhawk as you can see we're in so we're using on this particular pixhawk rd rover 3.5 we can do things like change the mode mode manual see now i'm in manual mode and one note about what we just did is we had to use sudo to initiate this command because only sudo users can use that uart device so that's the mav proxy connection um now let's try to connect with drone kit and drone kit is cool because that's python scripting controlling the vehicle so let's go into repos that we downloaded go into pi drone scripts go to dk and then go to rover and here we have a couple of pi scripts drone kit python scripts let's start by typing sudo python connection test and so that's going to launch that script and this script also needs to know which device it should use to communicate with the pixhawk so how do we do that we do dash dash connect and then enter in the device so it is slash dev slash tty th s one and hit enter on that and here we go the script output that the autopilot version is apm rover 3.5 and then some of the code was trying to arm the vehicle which nothing's attached to the pixock so it couldn't arm let's go ahead and look inside of the connection test and it i mean it looks like a python file right we have our dependencies we import at the top we have the function for connecting to the copter and after we establish that connection we get a vehicle object and this vehicle object we can get information from it so what state is the vehicle in what are some of the parameters and we can also write commands to it so we could command this vehicle hey move forward at one meter per second or go to this waypoint so once you're successful testing this connection template or this connection test.pi file we're ready to jump on into some more advanced drone kit python stuff and that is actually commanding the vehicle now we're going to explore some of the drone kit capabilities some of you might already be familiar with drone kit controlling a drone if you're familiar with the channel but now we're going to dabble a little bit with controlling a rover from python drone kit now there are three main ways to control the drone first way let's think of this as location based movement so we have a waypoint we want the rover to drive to we program that with code and the rover drives to that waypoint the second way we have to control the rover is through velocity commands now think of this as you know there's no intended destination we're just saying hey hey rover wally drive one meter per second um and then turn left at two meters per second so you have velocity based commands that we're also going to go over and we also have a third way not really recommended because it can be a little dangerous but it's rc overrides so you know when you're driving manually with your rc controller this is me pantomiming rc control um you're sending rc uh pwm waves to the receiver that tells the drone or the rover how fast it should be driving you can simulate that from a drone kit python script i wouldn't do that though just i would stick mainly with the first two methods so that's what we're going to go over now um one cool thing again people that are familiar with the drone dojo probably already know this but you can actually simulate drone kit missions on a simulated computer version of the rover before actually taking that rover out to the field so this is really good debugging exercise to just make sure everything works perfectly on the simulated rover and then if it does then you can port over that code to the real rover so we're going to do that now we're going to start out with location based movement all right so i am going to launch my environment for testing my drone kit rover scripts i'm doing that with a virtual machine um it's a little bit of a process to set up but once you have it set up you don't really have to change a lot now i actually do have a course that teaches on a sort of programming simulated vehicles how to control with drone kit any vehicle type from drone kit and that course um offers this pre-configured virtual machine that has all the dependencies ready to go everything you need so you all you have to worry about is the programming so i'm going to open up a terminal here and it's good to test the the code on the same simulated rd rover version that you're running on the real version so on my real rover i'm running with rdrover 4.1.0 so i would download that version onto my virtual machine with github so you could do that with git clone minus b to specify the branch and then type rover 4.1.0 and then the url of the autopilot repository after that would finish downloading you would go into it it should be ardupilot i already renamed mine rdrover 4.1 and you would type get submodule update dash dash init dash dash recursive so then you are ready to launch a simulated vehicle now another so we're matching the version type on our simulated vehicle and the real vehicle i also like to match the same geographical points that i'm going to be testing on so i know where i'm going to be testing on in the real world so i want to make that a place i can test on the simulated world listening to some k dot has some k dot so i am going to be testing out in this field and let's make this right here my home waypoint so you just pull up google maps find your latitude and longitude coordinates but here is a little bench that i get to sit on so this is going to be my home waypoint so how do i use that as a launch point in the simulated world well very simple just um go to g edit tools autotest locations.txt and you'll go to the very bottom um you'll enter in a name so you need to name the location i've actually already input this for me name of the location ok rover and then equal sign then your latitude coordinates comma your longitude coordinates the altitude so 0 for me and then the position of the vehicle so north is zero degrees east is ninety i want my rover to face west so i put 270 and then you would hit save there so remember okay rover is that location so now i want to launch the simulated vehicle how do i do that and again this is just a crash course on this subject if you want a more in-depth knowledge of what i'm teaching here i definitely recommend you check out the drone programming primer which also covers rovers so it's just enlightening about the software stack in general for rd pilot vehicles but how do you launch simulated vehicle well you could go to um you want to change directories into the vehicle type that you want so i'm going to cd into rover now you type dash dash slash tools auto test sim vehicle okay so now we feed in some options so minus l is for location and what location will i want the rover to launch at the gps coordinates of that waypoint we just entered so ok rover so this is the test area um and then dash dash map will load up a map of the simulated vehicle and then dash dash console okay so this is booting up the simulated vehicle now if it's your first time booting up the vehicle it will take some time um it has to compile all the code and all that all that fun stuff but here we go you see the rover has launched at my home waypoint that i'm going to be testing at in oklahoma normally it launches at an australian little airfield so here we are now the vehicle's up and running so think of this as like this is the pixhawk or the flight controller up and running so let's pull up another terminal and now let's connect a a drone kit script to this simulated flight controller so in this pre-configured virtual machine image all these scripts are already ready to go um so i'm going to get it into rover location based movement okay now this script is already on the rover because you downloaded my repository with pydrone scripts so i'm not going to go over all these little commands i mean very quickly connect my copter connects the script to the drone or the rover arm just arms the vehicle and then go to drives the rover to a waypoint and then waypoint here we can create different waypoint objects we want the rover to drive to so i'm starting out here let's say we want the rover first to drive to this waypoint right here so we can actually click on the map and it saved our click here so these are our lat and long coordinates that will enter into waypoint one okay so way point one thirty six point zero zero five seven six five my point two is negative ninety five point eight six zero three three two and then let's say we're up here a little bit let's like make a little triangle let's drive here there's my second click so we'll put that into waypoint two and now let's maybe drive down here it's gonna be a little little triangle we're drawing there's my third click so these are our three waypoints we want the rover to drive to then we connect the vehicle to the script our python script which will be on the jetson nano and here you can actually set parameters from drone kit scripts so remember we were setting a bunch of parameters with mission planner you can also do that from a drone kit script so i'm setting the speed of the vehicle to be two for two meters per second now i'm arming the vehicle and now i'm i'm calling the go to function which allows you to feed in a waypoint that the rover will drive to so it's going to drive to waypoint one waypoint two and then waypoint three after it gets to waypoint three i put the drone or the rover into rtl mode so the rover will automatically drive back to the home waypoint yeah that is the gist of that script very basic script but it shows you you know the building blocks of more advanced scripts so we have the ability now to um drive to waypoints let's go ahead and run this script and x out of that and let's launch that so python rover rover red rover and dash dash connect on the simulated vehicle you're going to be connecting to a ip address and not a device so it's 127.0.0.1 and then the port is one four five five one hit enter there and here we go the drone kit script now has the reins of the rover and the rover's in guided mode remember i told you that guided mode means the rover or the vehicle is waiting to be commanded well the vehicle's in guided mode and it's being commanded now by the script the drone kit script so it reached waypoint one now it's going to drive to waypoint 2. and you really can't imagine how helpful it is to be able to stage your missions that you wrote for your vehicle your rover on the simulated world before you do it in the real world because god knows how many problems or bugs you're going to have to debug out in the field that you could have just found on your simulated rover so it saves a lot of time saves a lot of headaches and actually it's a lot more safer i mean rovers aren't very dangerous but if you're doing something with a copter it's just definitely recommended to stage your scripts um on the simulated vehicle before taking them out to the field so there we go the drone went to waypoint one two three now it's in rtl mode so it's automatically driving to the waypoint that it was initially armed from so now that we have confirmed that this script works um we are safe to go out into the field and test this on the real rover now again this script rover location based movement will already be on your um on your rover or under your jetsa nano so all you have to do is enter in the waypoints that you want the rover to drive to so let's go out into the field and do that now all right so now we are out in the field with wally the rover and we're going to run that same script we did on a simulated vehicle in the simulated world in the real world there's that pen shells telling you about when we were in the simulated world so yeah we're going to run that location based movement drone kit script on wall-e i have activated mobile networks or the mobile hotspot that is connecting the jets and nano with the laptop so i can communicate with the two if you need help with that check in the top right of the screen i have a quick video on how you can do that okay so we're gonna go to repose pi drone scripts dk rover and we'll show you the scripts here so i've put in those triangle waypoints into rover location based movement so i'm going to trigger that script so i'll type sudo python and then the name of the script we want to run rover and then we'll connect with that uart device which is slash dev slash tty th s1 and we'll hit enter there enter in our password it might take you know a solid 10 seconds for the drone kit script to connect to the pixhawk but once it connects it should throw the rover into guided mode and there we go rover is now armed and it should be driving at i think it's two meters per second is what we set the parameter to wp speed in the drone kit file so it's going to waypoint one pretty far out there come back wally wally all right while he's realizing the mistake he's done the good life he has he's turning around in life trying to come back to me going to waypoint two and remember once it gets to waypoint three we actually change into rtl mode and rtl mode operates with a different speed it doesn't use wp speed it uses rtl speed i believe which is set to one meter per second so once it gets to waypoint three just any second now it'll trigger rtl mode and you should see it slow down a little bit drive a little bit slower so he's worn out from his long mission he's coming home come back to the good life he has with me and once we get to the home waypoint it'll automatically disarm and that is a successful mission all right now we know about um location based control now let's check out velocity based control so here is another script for a drone kit and this is for controlling with velocity this should also be already on your jets and nano if you installed that repo so here we have two methods of sending velocity commands one is a local velocity command and the other is global now what is the global velocity command well we have uh three axes right x y and z with the rover we don't have to worry about z right because we're just dealing with two dimensions so we have the x axis and the y axis actually on our rover the x axis is north and south or global net velocity commands and what is ned i think north east down is the sign convention so north is positive south is negative so e east is positive um west is negative so north and south is for vx east and west is for vy so if we wanted to move the rover true north we would send a positive number to that first variable vx and it would move true north and then true west would be sending a negative number to the v y variable true south you get the idea right one thing about these velocity commands is if you want the drone or the rover to keep progressing at this speed you need to send this command i think it's every every second or every two seconds or something like that so if you send the command once and don't send any more velocity commands the vehicle will stop so you need to be looping the velocity commands and sending them over and over again so that is the global velocity command next we have the local velocity command now local means it's local it's relative to the heading of the rover the heading meaning which way is it facing so now if i send in a one for for the local velocity command the rover isn't going to move true north it's going to move forward relative to where it's currently pointing so here the way our rover is currently it would drive to the east to east you actually can't send in a negative number for the local net velocity to the vx you would think it would just reverse but it doesn't do that it spins in circles now how do you turn well that's where um you feed into v y so the sending in a negative number to v y turns the rover counterclockwise and setting a positive number turns it clockwise let me fix that okay and then last thing i'm going to go over here is the backup so we actually don't have an easy way to just reverse the rover to drive and reverse because you'll notice when we hit when we do these commands it's always driving forward so i wrote a little script that actually does something something bad something naughty it's using rc overrides to manually reverse the rover um this is the only time i would really recommend using rc overrides um and you'll see how this works but essentially you know we're putting the rover into manual mode which responds to rc input and then finding the the throttle channel writing 1400 to it so it'll go in reverse for one second might even make that two seconds and then bringing it back to 1500 and then putting the drone back into guided mode so this function is also already on your jetson nano so let's go ahead and test this script out before we head out to the field to do it so we'll just do the same thing now you'll see the rover's moving true north now it's moving true west true south and true east okay now we're moving north relative to the vehicle now we're moving counterclockwise and we're turning clockwise now we're moving in reverse with that command that i showed you with the rc overrides and you'll notice the rover is actually reversing it's not trying to point the front of the vehicle to where it's heading it actually lets you drive in reverse so yeah let's go ahead and run this out in the field now okay so now we're going to run the velocity mission that we tested and staged on the simulated rover so let's go ahead and hit enter and check that out alright it's going north going west on the south and heading right at me and now it should be doing its local velocity commands now it's turning different directions now it's reversing and there we go two little reverses and if you want it to reverse more you could always increase the time that it reverses with that manual rc override or set the rc override to a more aggressive value i'm only going down by a hundred pulse width modulation values but yeah that is the velocity based drone kit control one thing to know about the local velocity command and the v y axis or the v y variable the turn rate gets more aggressive or the turn angle gets more aggressive the higher value you enter in so if you put in like point one for the turn rate it would barely turn and if you put in like three it would turn super aggressively okay so now we know a bunch of different ways to control the rover you got the rc controller you got the auto mode python drone kit scripting now we're going to do a little bit more of an advanced python drone kit script and we're going to do a little dro not drone delivery rover delivery mission which is turning out to be like the hello world of drone dojo robotics cut to buster making his taco delivery oh but instead of delivering a taco this time we're going to deliver a five hour energy got a little clip on there and how are we going to do that well one of these cheap little servos gives us the ability to hold on to an object and let go of an object and actually it plugs in pretty simply to the pixhawk so this uh light orange or yellow color is signal the brown is ground and signal goes down on the pixock so we're just going to plug this into aux out 1 which is actually servo 9 in the code so it just goes like that then we'll mount this at the front of the rover and then i'll show you how you can control it okay now on my rover i installed the servo up at the very front of the vehicle and wired that back to the pixhawk a bunch of wires going on that's why i showed you how to connect it uh before i installed it but it is installed right to that aux 1 port and you will have to put the horn on and after you do that you should pull up mission planner and you can actually control the servo through mission planner so all you do is go to servo and then the servo we plugged in was aux 1 which is the same as servo 9 so if we can actually toggle the position of the servo with these buttons low mid and high so if i go low if i go low the servo is now low and then i'm going to go click high now the servo is high now you can test out what is high and low on your horn and then rearrange it so that the up position is at at about a 45 degree angle and the down position is about 45 degree angle then you can simply put a clip on there or some other way of attaching to a deliverable object and we can test this out so we're high now and then we hit low and now we dropped off the object and then there's the midpoint so we can control the servo manually through mission planner but we can also control the servo through drone kit scripting so we're going to go check that out right now okay now i am on the jetson nano let's go to repos pi drone scripts dk and then go into drone now there is a script in here called control servo dot pi let's go in there now this is the drone kit way to control a servo so hi you know the pulse width modulation can be from zero or 1000 to 2000 so high let's just put it at 1900 low is going to be 1100 just so it doesn't go beyond the limits of the servo and remember our servo is nine and then the connect if you want to enter it in manually is slash dev tty th s1 don't really have to worry about that this is just for me to show you what's going on so then control servo this is the function we're going to use in our delivery mission and very simple you just enter in the servo you want to use and then the value so high or low then this is a mavlink message that gets sent to autopilot called mav command do set servo and it inputs those two values sends it off to the vehicle so that's our function then we'll use it here below by first setting the servo high and then setting the servo low all right so now we have all of the core ingredients available to us to do our rover delivery mission let's go ahead and write that up so let's go into rover and we're going to use the rover location based movement script as a template so just copy that and then i'm going to create a script called five hour deliver five hour dot pi i've already created that so i'm just go into that and the control servo let's go ahead and set up some servo variables here at the top servo number mine is nine servo high is 1900 servo low is 1100 so when we drop the servo low it'll drop the object when it raises it high it'll hold on to the object so we know how to control the servo from python drone kit we know how to drive to various waypoints autonomously now let's just grab our waypoints so let's plan out this mission so back out in the field i like to keep this as my starting point there's a nice bench here you know not that far from the parking lot so we're going to start here and then this will be our first waypoint i'll click there so here is our coordinates i'm gonna go ahead and enter those in to waypoint one we'll make that waypoint one and then waypoint two there's actually a nice little bench over here that i'm gonna be waiting at to get my five hour energy so this will be waypoint two let me click here again so let me input waypoint2 into our script and then we don't actually need a waypoint three so this is our homeway point this is waypoint one here's waypoint two we're going to launch from here the rover is gonna then drive to waypoint one i'm going to drive to waypoint two and then it's gonna loop back drive back to waypoint one drive back to waypoint two then when it gets to waypoint two it's gonna drop off that five hour energy with the servo so let's go ahead and write that mission into code form we have our waypoints we know how to control the servo so what do we do so we're gonna establish a connection between the python drone kit script and the rover so that's that we're going to set the speed and initially we're going to make sure the servo's high so we're going to raise the servo high control servo and then we'll wait a little bit and right here is when we will attach our object to the servo okay and now let's arm the rover we're going to go to waypoint 1 go to weight point 2. we don't need a waypoint 3. remember at waypoint2 we're going to drop the object so all we do is write okay so then we will just go back to waypoint one remember waypoint one is right here so we'll just go to waypoint one again and then from there we have a straight shot at our launch location i'm just going to write a return to launch which will just drive the rover from here to here the point at which we armed from so i'm just going to put the vehicle into rtl mode and that will be the end of the script this is our very simple drone delivery script or rover delivery script okay so we are out in the field now ready to do that rover delivery mission we got wally out there ready to go got the laptop here and we're all connected jets and nano to laptop with the mobile hotspot configured of course we got the five hour energy ready to be delivered got a little a better clip there that'll hold on to the servo and now we just have to run that script so we're going to start out running deliver five hour dot pi and once that script connects just a reminder that servo is going to go into the up position so currently the script is not connected yet and then once it shifts up we have about 10 seconds to um place the five hour energy on the servo come on wake up wally wake up oh the servo went high oh shoot oh shoot okay here we go oh my god and there we go we got wally driving to the first waypoint and this is pretty rough terrain not really mowed too much over here in this field but you know that's what crawlers are good for they're good for all sorts of different terrain hard to keep up with you wally still holding onto that five hour you know he's a he's a good kid i was hard on him earlier he tried to run away from me but you know he's still young he's still learning now he's being helpful delivering stuff so you got to give kids time to develop [Music] so once he makes it the way point one it'll slow down for a second and then i'll start heading on to waypoint two got a little bit to go here still doing pretty good holding on to that five hour and it dropped the five hour and it's gonna head back to that waypoint now i'm actually gonna pick this up because that's a long walk back one eternity later should almost be back to waypoint two at which point we'll trigger into return to launch mode and there we go we're on our way home back to the laptop and there we go mission success you know so by now you and wally you've been through a lot together you know some could say you were friends so me and you are pretty much friends by now right we learned about artie rover basics truck drove bike art rover basics how to build your own rover manual control of the rover autonomous control of the rover simulated mission planning on our computer autonomous rover delivery bunch of stuff so like i said earlier with this rover here we are really only scratching the surface i mean we have a gpu with 180 or 128 cores on it so there's a ton more you can do with this but it's a good foundation so now that we have this this foundation the next video is going to be a crash course on opencv influence control of the rover and that will be using this camera here we have installed on the front so that video i teased about precision parking well i'm going to show you how to do that and a ton more so after that we'll be getting into ai bass control voice commands obstacle avoidance a ton of stuff really just like how you guys want to direct this and like i said earlier all of the future projects we're going to be doing are going to be conducted on this drone dojo rover kit and we do have this available for you to purchase it comes with everything you need including the pix hawk the jets and nano the crawler frame chassis the esc the servo just all the hardware you need but it's also more than that because one your pix hawk is going to come pre-flashed with firmware that works and parameters that work tuning networks the jets and nano is going to come pre-flashed with the operating system all the dependencies you need and all of the python example uh drone or rover control scripts already on the jetson nano i mean you just won't find help like that anywhere else or any other thing you purchase these steps are normally pretty pretty uh larry david right there [Music] pretty time consuming we're doing this so you can focus on your drone project and not have to focus on all the other setup crap you can find out more information about these rover kits and a link somewhere somewhere if you're on this video you can find it okay the sun's getting kind of bright can't see where okay can't see where if you're curious to learn more about the ardupilot software stack and how to simulate missions right on your computer like we did in this video i definitely recommend checking out our drone programming primer it teaches from the perspective of drones but really all of the core components are the same regardless of the vehicle type you're using this is how i was able to port over my drone knowledge over to the rover and start playing around with that so quickly we also have a dedicated section just for rovers in that course and it also has and this is a very important part a pre-made pre-configured virtual machine environment that also has all of the dependencies pre-downloaded all of the example scripts already there ready for you to run so it's very very helpful platform for you to test out your missions before going out to the field so with all that me and wally better be better be getting out of here before buster the drone starts to get a little jealous about uh me and wally's time together so i'll see you in a video shortly
Info
Channel: The Drone Dojo
Views: 4,097
Rating: undefined out of 5
Keywords: ardurover, ugv, pixhawk, rover, ardupilot, drone dojo, jetson nano, nvidia jetson
Id: paPXfGOhqfo
Channel Id: undefined
Length: 140min 30sec (8430 seconds)
Published: Mon Oct 11 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.