Lidar (Raspberry Pi)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] Oh [Music] what's going on guys I know it's been a while since I last posted on the channel but I've been busy you know doing R&D and today I have a really exciting tutorial for you guys so we're going to go ahead and set up a light on our unit and hook it up to the Raspberry Pi so before we get started let's talk build materials the things that you will need you're going to need a Raspberry Pi 3 a XV 11 lidar unit me USB cable a XV 11 mount so I got this I found this online on Thingiverse and 3d print it if you have a 3d printer you can also pay to have a printer for you I'll post all the links to these components in the description something you're also going to need is this XV 11 lighter control unit so get surreal comm sell this for roughly 30 bucks and it's essentially a Tinky board so that's like an Arduino type board to interpret this serial data and then pass it along to the Raspberry Pi and finally you're going to need a breadboard and a generic the breadboard power supply unit so you can definitely run the power from this teensy board however I don't like doing that because it puts strain on the Raspberry Pi rather control the power certainly using a separate power supply so just make sure if anything that you have 3.3 volt power supply available to you because you'll get better results in my experience and a note on the XV 11 and wide are unit so you can source these on eBay and they run for roughly $150 so it's sort of a specialized specialized part but it's definitely one of the cheaper wire units available currently so with all that said let's go ahead and start hooking everything up so the first thing you want to do is take the water unit and it sort of just mounted to the three printed mouth here so it just drops in when I screw it down right now we're just going to sort of go ahead and get this set up so it can test it so you want to route these wires there's two sets of wires that are that come with the xB 11 lot our units so you have your data cables so oddly this is like the raw serial data and then your power that drives this motor here in the back so essentially what we're going to do is just hook this up to the the teensy board breakout right here and now that that's done I'm going to go ahead and not plug the power into the titi board power input but I'm actually going to use this separate power supply so I've already human look here I've set this switch to 3.3 volts and then I have positive and ground and then I'm just going to hook them up to the corresponding connection so red and white are positive so I'll go ahead and hook that up real quick so I got positive and thank you what's up so there we go that's hooked up and now what we need to do is get our mini USB cable and plug that into the teensy board so when you get your teensy board the terminal will be already uploaded so you don't have to worry about upload anything to this Arduino but we're going to need to go ahead and test to make sure that we don't have a defective light our unit and our liar controller is working properly so now we're going to head over the computer and I'm going to show you how to test do a quick test using the Arduino IDE so let's go ahead and switch over I'm over here at get to real website and if you scroll down we should be presented with this quick test link for the x11 moderate or go ahead and click that it'll give it'll pump to you with all the instructions to run the test so before we do that we're going to get our environment set up so if you don't have our Camino I to you so you have to go and do that in my experience when you head over to the arduino case don't install the latest item you go ahead and solve we're in 1.06 or the classic ID because i romantic ongoing is your version so your model here your experience may differ for mine but just go ahead and do that so download this software what platform you have and then after you install that go ahead and go over to the computer you know page and then install this too so this will just essentially put this add-on into your ide system so once that's done go ahead and open your REE unreal I see I already have done that here so before we hook up the USB connection to that few people have to just make sure of a couple settings so if you go this tools tab right here you want to change the board and make sure to constancy to funky arrow USB type-c real and CPU 16 megahertz loudly that's the default and then when we plug in this USB it should recognize and this menu should change let's go ahead and do that right now actually need to hook up our real quick so about took a power right now so power on this breadboard power supply and you can see that the motor starts spinning right away so there's our frame here really justice sorry for the messy wiring but the extra long cable here so yeah now the light are spinning but you don't see anything happening with the large control unit so once we plug it in USB into my PC should light up so there we go you should see this blinking orange LED and now if we look at this this tools tab we can see that it's detected the device on Cheryl com3 so now we know it's good so go ahead and click this serial monitor an important a few settings which are really important you want to set this bottom right setting to new line and the baud rate to 115200 if you're seeing all this garbled data don't fret this is actually a good sign it means our lidar is unit this is literally the Rafi we're going to get or we're getting currently so to get some relevant information we're going to send a command to the water control unit so we're going to type show D is T and hit enter and then we should see the formatted data so what you're seeing here is event is essentially the the angle the distance and the signal value and it's just constantly constantly you know dumping this data or constantly just pushing this data to this Arduino IDE so there's other commands to that you test so we can do show rpm show repeat okay I think my syntaxes incorrect so give me one second it should say here show rpm okay no problem we just closed this out start over again so just go to tools zero monitor show rpm so there we go now it's showing us the RPM value so it should be pretty close to three hundred revolutions per minute one important note is the teensy board is setup for I believe three and a half volts but the needle robot runs at five volt so it spins a lot faster but currently on the setup with all the software just make sure you're running it on no more than three and a 3.3 volts because then it you won't get any usable output so now that that's up let's go ahead and get it hooked up on the PI okay so I just put the larger unit on a roll of tape so that way it's lifted off the ground slightly so that way we don't get interference with you know some of the objects here when we go to test it so now we're just going to take the USB and plug it into an available USB slot on the Raspberry Pi so there we go right there now we need a supply power I have this USB power supply that splits into dual outputs l1 set up to the DC or D the microUSB port on the breadboard power supply and then this will just go into the micro s the micro USB power on the PI sorry my words jumbled there so I don't know if you can see everything so now everything's hooked up so we got power goes and drives the motor for the light our unit we have the serial connected serial data cables connect to the lidar controller the controller hooked up to the PI all right so now let's go ahead and head over to the computer okay so I just gone ahead and connected to my reservoir through the BNC so that's because one we want to when I run the visualization test we got to make sure that we can see it on a screen essentially so go ahead and open up a terminal and the first thing we do is figure out where or where the device the USB devices mountain so you're going to run LS USB and just make sure that you see this right here so informatica teensy do we know serial that's good that means the Raspberry Pi detected the device but now we need to know the actual path essentially so we type message I forget what is called like pipe grep TTY so this is the command you're going to use to figure out where your device is so right here we can see tty ACM zero USB ACM device and then so that's the actual the actual device name I believe so now we need to go back to the gets real page and [Applause] we're going to need to click on the visual test for X to the 11th lidar so if you look here there's a few things that you're going to need you're going to need five serial and V Python and also the lidar script so go ahead and click this link and download the letter script I already actually this light on our script we can see here it takes the comm port and baud rate so we want to make sure those match up with what we have on the Raspberry Pi so essentially it shows you examples of what they can be but this one here on the right is what we want so we're just going to go ahead and copy this copy and change column 32 to what was it on the device I believe it was ATM 0 yeah so TTY ATM 0 that's what ACM 0 and just double check to make sure that the baud rate set to 115200 and then go ahead and save that and upload this to the Raspberry Pi already going ahead and done that so I'm not going to show you how to do that but now we're going to set up our PI do a few things there to your environment set so the first thing you want to do is pick install PI serial I already have that installed took it'll tell me the requirements are satisfied and then next thing needs me to do is stall V Python so I believe it's sudo apt-get install I believe it's V Python I'm not entirely sure I'll definitely post the link in this video but once you do that you should be set so let's go ahead and clear everything and then I already updated lidar py here so let's do a sudo python Lyotard py and run that so that's good now that we can see that it's working it's going to take a second to initialize just be patient and essentially you're at first you're presented with this essentially horizontal plane of a picture and that's not really what we want right I initially thought that it was broken but it's not all you need to do is go ahead and click on the middle point and then you can rotate all right I believe you can rotate there we go I think it's right-click so right click rotate and then it gives us the the point map really sure what you call it I think we have it upside down here yeah I spare with me for a second I'm just trying to get the annotation I yeah you can see here all my walls and I think this is me sitting here so if I move my hand closer you can see that the the points actually moved so if I move my hands farther away let me go ahead and end up so you can see I'll just sort of walk around and you see the dots or the group of dogs moving and yeah that's pretty much it that's how you get the water you know I've been learning on the Raspberry Pi real quick so just before I sign off here I just want to give you props to the people who put all this stuff together you know would have taken me Dave if not weeks to get all this up and running but thanks to the people I gets real for providing that light our unit or light our controller board with the teensy USB I was really awesome and the people who develop the library than the software to interpret all the garbled data on the XP 11 can't pay you guys enough and yeah state I hope you enjoyed this video stay tuned I'm going to be doing a lot more stuff out if you saw our previous video with the Nomad robot this is sort of the next iteration so now that we have a lot our unit we can develop our obstacle avoidance system even more and and yes you know like subscribe and thanks thanks guys peace
Info
Channel: PiddlerInTheRoot
Views: 147,226
Rating: undefined out of 5
Keywords: XV-11, Lidar, Raspberry Pi
Id: yLPM2BVQ2Ws
Channel Id: undefined
Length: 18min 58sec (1138 seconds)
Published: Sat May 13 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.