Adding Lidar Navigation to a Robot

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] foreign [Music] we're gonna play with the better Navigator today and do some navigating with a lidar and a robot so what I have here that we're going to be using um don't be intimidated by all the hardware on this guy we're only going to be using the lidar I'll turn the camera on just so that we can see what the robot's doing but we're not going to do any like Vision tracking or something so this is a robotous turtlebot it's a good platform that I like to use for testing sensors and testing very various different lidars and stuff with specifically because it's um it's so modular right you can just screw anything you want in now what lidar we're using today is the RPI lidar so if I were to uh I'm not even sure which which USB port here it's plugged into oh that one so you can see here RP RP lidar not RPI lidar sorry RP lidar and don't worry about the Intel real sense we're not going to be using that today so we're just going to use the RP lidar we have an onboard computer running Windows this is a rock pie these are great little devices plugged into it is a USB USB this is an HDMI um Faker I guess you can call it so it simulates a monitor because without this plugged in the graphics card will default to a resolution and that resolution I think is something small like 800 by 600 or something ridiculous so with this plugged in we can set the resolution to 1080. um whatever the graphics card supports so we also have Wi-Fi it's powered by The Rock pie is powered by this uh brick so there's a power brick I think it's I don't know how many amps it is it's uh well it says it's 20 20 amps um whether that is correct or not who knows right Amazon I don't know why we're not focusing on that but you have to believe me that's what it says and as far as that's just running the rock pie right it's plugged into USBC and it's running all the accessories and then for the actual movement for the robot to move we just have a uh 11 volt lipo three cell plugged in there hooked up to a um a robotis uh I can't remember what microcontroller that board that is but and then it's connected to these robotous dynamexal servos so what we're going to do is um first we're just going to make sure we get this thing working like driving around so I've uh already installed VNC on this computer and as you can see we're vnc'd into it and from here we should be able to load up Arc now I already have a project that we can play with if we want to just see how it works and then I'll create a a new project from scratch to show you how to do it so this project here is one that I've created at the oh I guess we'll put it on the ground first before we start the lidar but let's just make sure this robot drives we'll connect to it through a connection here Intel real sense we can get rid of that we're not going to be using the real sense and everything else that's here we will actually be needing so let's just make sure we can drive yeah we can thank you perfect so let's place this guy in the ground and that'll be our home position the starting position so we're going to do is uh get back to our desktop here we've connected to the robot we know that it drives now let's start up the camera so we can see what the robot's seeing so we'll put this here now let's start up the RPI lidar so we can see it's starting to detect the room um which case I guess we can start driving the robot around and we'll see what the room starts to look like okay so we're starting to get a good idea of the room and you can see that the room is getting mapped out and we're driving up to a snowboard here okay so our home position is where we started and I have a fireplace here I guess that's because I last time I ran this I was probably at my cabin and I was playing with it so let's select home and then say go to the Waypoint so it's going to navigate and it can see it created a path as soon as I selected it it created an automatic path on how to get there that's using a path planning algorithm so if something were to get in the way it would automatically Create A New Path and you can start to see the room really building out because you know as it's a 360 degree lidar anything that's in the way will uh prevent it from seeing stuff behind things right so that's why we're slowly starting to see things that it's learning as it drives okay so we should be home there she is booyah now where we just were was someplace up in this area here where the stairs are so if I were to right click and say add a new Waypoint I can call it stairs and if I select it from the list here on the left here you'll see that it's created a path that it thinks oh this is how I know how to get to stairs so if I were to put something in the way here it would actually Create A New Path on in order to get to stairs so it'll dynamically create the path based upon what's in the way and let's instruct it to go to where we just were to the stairs and there we go we reach our stairs point and if I were to select home again you're going to see it's created a path right to home what I'm going to do is I'm going to put a box right here and that's going to prevent the robot from being able to drive that way so we're going to see what once the box is there we're going to see that the net better Navigator is going to figure out A New Path on how to get to home so let me go just do that right now I'll turn the robot around so you'll be able to watch me place that box there so now there's a box in the way and it thinks that this is the way it's going to drive so let's just say go so we're telling it to go to the home position right now and off it goes so it says I can't go that way and the path changed and now all of a sudden poof we're going a different route it's decided that it knows how to get to where we're going we've reached home once again so let's start the project from scratch and show you how we just did everything we did so that you can do it too so we're gonna first connect to the robot controller so that is on com port number three we know that I mean we can test each one we can connect to each of these com ports and see which which one is what but we know it's uncomporter 3 because uh the project we were just using and now what I'm going to do is I'm going to add in a Servo driver for the dynamaxel servos because that's what we're using and there we have the dynamaxel servo driver so let's edit this I believe that our Dynamax will servos are connected to Port one we're not sure yet so why don't we just do a um a test we can go to utilities here and we can do a scan okay so that wasn't correct let's try Port zero okay let's try Port two there we go so Port two it is and we have an XL 430 or XL 320s found at ID number one and number two so what we'll do is we'll go to ID number one number two and we'll select those as the Excel um 320s I think that they're the XL XL 430s actually we'll select those and the number of positions that's fine as well and we'll save that now we want the robot to be able to move so we need a movement panel so we'll do is We'll add under movement panels because these are servos they'll operate like continuous rotation servos so we're going to run the continuous rotation Servo movement panel and what I'll do here is We'll add V1 and V2 we have no idea if these are going to be correct for movement yet so let's find out rather than just pushing these buttons and moving why don't we add in a joystick it's just a little easier to work with so if I go into remote control tab here we have a movement joystick and this is nice to use let's configure that and see if there's any settings need to be specified no max speed of 255 should be okay so we'll push forward I don't see a robot moving so let's take a look at our Dynamic configuration here and see what we're missing oh here's what we're missing under mode it's under position we want to turn this to wield oh I hear it moving let's take a look now the thing is it looks like it's complete completely backwards when I go forward it's going reverse when I go reverse is going forward let's take a look at the servo movement panel and I'm guessing that this one needs to be V2 and this one needs to be V1 so the left and right Wheels need to be swapped now let's try it okay something's a little bit goofy here we can go forward we can go reverse but when we turn right we're turning the wrong direction so we can reverse these forward and reverse values now let's try it oh that looks better left and right is working now this is great A robot moves now let's add in our camera so that we can see what the robot's actually doing there we go yeah perfect so now let's add the lidar in so that we can get that working and that's going to be under the navigation Tab and there's a few different lidars here this is the one we want which is the RPI lidar and we can select its com Port which I believe is com Port four is what we used before there we go oh we can see data this is wonderful so we can stop that because we'll get it running right now while we configure it so let's go into the configuration setting here and let's take a look what we have so we can say the baud rate how many degrees it's on and off well I can tell you this is that it's entirely reversed it's 180 degrees off because I mounted it onto the robot backwards okay and of course you can figure that out pretty quickly when you start looking at the uh the map that the robot is making and then we have something here set variables with location data we're not going to be using the variables we're not going to be doing any scripting so I'm going to keep that they don't need to be checked and we're going to fake the nms pose hint event that's the navigation messaging system what it does is it'll take the uh the data from different sensors and different pose sensors and it'll create a map and a path planning All That Jazz all the good fun stuff so we're going to do is we're not going to be using any wheel encoders and we're not going to be using anything like the Intel t265 tracking camera for getting a pose hint we're not going to do that we're going to we're gonna do all the pose hands internally with the um with the better Navigators uh Hector algorithm so we're going to select that that just means we don't have to use any other sensors like wheel encoders of course you can put your cursor over top of the question mark and read a little bit more about it or you can click on the question mark for the robot skill and read more about it so the next thing we need to do is add the better Navigator foreign ful naming convention we have the Navigator and the better Navigator and the better Navigator is indeed better so let's configure the better Navigator let's take a look all the different settings so we can have scripts that are going to run on the navigation to start when it ends we can have the robot speak and say you know I'm going to the living room or I'm done navigating to the living room and we have variables that can be stored but we're not going to set the real-time variables because we're not using those and we can save a little bit of memory and processing by doing that now under navigation so we have a bunch of different settings in here we can disregard distances that are within um you know anything less than a distance it's probably important to do who's looking at the robot I think 30 is probably too long I think we can probably do 15. just because the robot's only about 30 so 15 centimeters is fine disregarding distances that are higher than a certain distance this is because the lidar might not actually return accurate values above a specific this distance so this is 5 meters now pause the navigation if the distance is less than a certain degree so if it runs into an object we want the robot to stop but we're going to keep that off we don't need that and how much history to keep so it's going to draw a line on the screen as it drives and how many of those points is it going to keep behind itself 50 is fine and this is the number of pose frames update path planning so what that means is every time it receives a pose update which is an idea of where it is in the room is how often is it going to update its path to its destination because it's not going to update every single time it gets opposed because then your CPU is going to just be going bonkers doing so much calculations our font size is on the display how big the font is going to be our path plan and resolution and again we can read about all these different settings here how big the robot is so it's personal space in this case our robot isn't very big so we can only make we can make it something smaller maybe like 50 like half a meter how many path planning and iteration so when it goes to do the path Clan this is a number of attempts it'll try I get in the uh the path plant and again you can read all these different values and experiment with different settings so this is going to configure your movement speed so you can see how fast we're going to be moving forward and then we can enable Dynamic turning which is um how quickly we're going to be driving forward and turning at the same time so so the degrees of forgiveness while turning is don't bother turning if the object is say less than 10 degrees in front of me so if it's less than 10 degrees in front of me I'm not going to bother turning towards it but if it's uh say 50 degrees out it will turn so this is really just like your accuracy of how close it should turn and then finally we have these values down here for dynamic turning like I said which is when the robot's driving forward it will turn slightly to the left or slightly to the right or the right but it's only going to do that if the degree difference is less than a specific value so if it's less than we'll just say 30 degrees then dynamically turn towards the object where this type of turning up here this is actually a turn on the spot okay this is a complete dead stop turn on the spot where this one is driving forward and turning you're not going to want to drive forward and turning if the object is a further or the destination is a further number of degrees away so video stream allows us to publish the data the image from the uh from the lidar and navigation into a camera stream so we can use it through exosphere or through interfaces and then we have some Advanced tabs for enabling different values and stuff now the postage is going to be important because we're going to want to use the pose hint from the hector now remember we specified the value inside of the RPI lidar that said fake the pose hint well by faking the pose hint we need to specify where the proposed hands can be coming from internally within the uh the slam algorithm external means it'll be getting it from an external sensor like a t265 Intel real sense average is an average between the two differentials is obviously a differential between the two so what we're going to do is we're going to say use the hector let's start the RPI lardar here we are and we can see here our room is starting to map itself out now let's start driving the robot around and we'll create a more detailed map by doing so okay so we have our home position and we know where the robot is and this has got any look at that the uh the Shelf has been detected all the different departments within the Shelf isn't that neat that's that's wild actually so let's navigate to our home so we'll select it now it says okay I think I know how to get there let's say go to the Waypoint see how it navigated right through the toolbox and that pillar oh this is fantastic to watch here it comes okay we made it home and what we'll do for fun is let's go to our second workspace here and we're going to add an interface under remote control interface Builder and now under this interface we're going to add the camera we're going to add a joystick pad so we can have the robot driven around and then let's add a button and we're going to edit this we're going to call this button go home I'm going to edit the button and we're going to do is we're going to right click and we're going to query all of the robot skills to find out what they can do and here's the better Navigator and we can select go to a waypoint and as you can see here there's a waypoint already called home so we'll select that and we'll click save we'll make this our default interface and now if we go on to our full screen menu there we have it so we can push the go home button and the robot will start navigating home but what I think would be even really neat is we could do this but from our phone so why don't we do that why don't we go to our project and go to our properties tab for the project and we'll go to remote UI and enable the remote UI server we have the port specified now we just need a password I'll put my secret password in of one two three four that's the one we're going to use so on my mobile device I'm going to load up the arc UI app and it's going to automatically scan and find any of the robots that's on the network which we just discovered one turtlebot we'll select it and we'll go to our password and we'll type in one two three four and now we're going to say connect there's our interface we just created so we can drive the robot around as we please so we can do is we can say go home I could do that but why don't we go one more first step further I know I'm gonna keep leading you on here let's see what else we can do so we know that on our app we had an option in the better navigator to send the video of this to a camera so let's do that let's add another camera and on this camera what we're going to do is we're going to specify custom and we'll start that camera now we're going to edit our user interface and we're going to add another camera and this one we're going to drop down we're going to select a camera number two of course there's nothing in there right now right let's go back to our main workspace and under the better Navigator we're going to edit the configuration under video we're going to push the video stream to the camera number two now let's take a look at our full screen interface look at that so let's revisit the mobile app and as you can see we can see the robot's navigation we can use our joypad to control the robot and then we have our go home button so we push the button now we sit back and watch the robot Drive [Music] that wraps it up for the better Navigator tutorial video hope this was educational and I'm excited to see what you're all going to make with it foreign [Music]
Info
Channel: DJ Sures
Views: 15,780
Rating: undefined out of 5
Keywords:
Id: KiCSkkenwFo
Channel Id: undefined
Length: 23min 44sec (1424 seconds)
Published: Sun Nov 27 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.