#227 The ugly truth about LIDARs for obstacle avoidance (RPLIDAR A1, Arduino, ESP8266)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

I'm really interested in seeing this video. I'm an EE undergrad senior design TA, and LIDAR based obstacle avoidance has become a hot topic lately (self driving cars being all the rage). If the video is good, maybe cross-post to /r/ece

👍︎︎ 3 👤︎︎ u/mindokiller 📅︎︎ Oct 13 2018 🗫︎ replies
Captions
obstacle avoidance is an essential topic for self-driving vehicles in this discussion we often hear the word lidar these devices recently got cheaper and affordable for many makers but are they worth your money for obstacle avoidance Realty youtubers here is the guy with the Swiss accent with the new episode and fresh ideas around sensors and microcontrollers let's first define the problem obstacle avoidance means that a vehicle must not collide with any other vehicle or obstacle simple please do not mix obstacle avoidance with simultaneous localization and mapping or slam these are two different things an obstacle avoidance system has to create a stop signal to avoid damage the purpose of a slam system is more to optimize the path which objects around our vehicle are obstacles which have to be avoided let's take our tank we need to be able to detect all barriers from the surface up to maybe 30 centimeters from left to right we need about 50 centimeters and how far we have to be able to detect obstacles this distance depends on the speed of our vehicle and its braking distance for a tank this is only a few centimeters for a drone it can be 50 meters and for a car even more so for obstacle avoidance for our tank we need to know the distance to everything in this cubicle and if we only want to drive forward automatically we do not need to watch back so our problem is very similar to the issue of James Bond at this moment Mr Bond I trust you had a pleasant fry [Laughter] now the problem is defined and we can go on and see if lidar is the solution I test it fixed lidar systems in an earlier video you should find the link in the top right corner of your screen they can measure distance in one direction and for sure we're not able to fulfill the task and now the f robot sends me this cool RP lidar a1 which costs around $100 for a test it rotates typically seven times per second and measures the distance continuously in all directions a massive improvement over the fixed ligers it uses a laser beam and triangulation to measure the distance to an object so let's give this device a simple task I connect it with a FTDI adapter to my PC and start the software which comes with it as a first test I put the lidar in a box what does it see a rectangle of course nice and if we move the sensor the square moves to only if one of the walls get closer than about 15 centimeters or six inches the lidar does not see it anymore because it is blind on short distances so the lidar works and does exactly what we expect it sees all obstacles around it with high speed and precision and because we know all walls we could calculate the size of the room or plant for an optimized route which covers every inch of an area very good for a cleaning robot with some math we even could calculate the movement of the robot relative to these walls this is very usable for slam but is it also good for obstacle avoidance one question could be is it capable of detecting small obstacles like this 0.8 millimeter thick ruler yes it does on short distance but not always as we see still astonishing the angle which is covered by this ruler is only 0.25 degrees you can imagine that quite a lot of data is created by this device in standard configuration it measures 200 points per rotation makes 200 times 7 equals 1400 measurements per second the time between two values therefore is only 700 microseconds so the loop of your sketch must not take more than 700 microseconds which is not a lot and Arduino in general is too slow for that in reality the things are a little bit more complex maybe the room is long and your robot drives in parallel to a wall fixed lighters or ultrasonic sensors would not detect this wall why is that because both need a reflected signal to measure distance a wall reflects the beam in another direction not back to the receiver and is therefore not detectable by the way this is one reason why stealth bombers are invisible for radar systems they use surfaces which do not reflect the beam back to the radar station they reflect it in other directions this is why the first stealth plane looked so strange for our purpose however this effect is terrible because parallel walls are invisible to fix sliders as well as ultrasonic sensors our vehicle collides in such situations with the wall how does our new 360 degrees lidar behave in this situation this is how it sees a parallel wall it is also invisible to him at a certain distance but it is clearly visible on short ranges because the laser is reflected a clear advantage over the two other concepts it protects from all obstacles from left to right but what happens if we have a small obstacle laying on the floor or a hanging obstacle the laser beam is very narrow and only covers one plane this is why it is called 2d lidar to show you this effect I move the Box a little over this measuring plane it becomes completely invisible to our lidar so we are not safe at all for hanging obstacles if our laser is lower than the highest point which is always the case because we do not need the lidar working behind us we can tilt it a little and now we see hanging obstacles which can become dangerous for us like that we protected the top but it does no more see small obstacles which lay on the floor this is one reason I selected a tank so no problem our tank is not stopped by such small barriers but this is not a real situation we have to stop also for small barriers to solve this problem we could tip our lidar to the other direction of course hanging obstacles would be a problem again a typical dilemma which cannot be solved with our 2d lidar this is the reason why lie doors on self-driving cars are three-dimensional with several beams which give results on several levels but these devices still are costly I found such 3d radars which cost less than a thousand dollars but they only cover an angle of 130 degrees which might not be sufficient to deal with the wall problem from before and 9 degrees vertically is also quite small the next problem if we want to drive fast the reach of our lidar can become an issue the range in the specifications of our RP lidar a 1 is 0.15 to 6 meters we already tested the shortest distance so let's examine the long distance at our usual location in the garage which is indoors with low light levels the walls are grey and I put the lidar on the floor precisely at 6 meters from the wall and indeed it shows results we see the walls and also the motorcycle which by the way is not mine so the specifications are met if I only move a few centimeters back we lose the signal so this device can be used by reasonable fast vehicles at least if they have good brakes the last question which can be asked is not relevant for obstacle avoidance how accurate is it this box measures 43 times 35 centimeters the lidar measures 41 times 35 which is a little short and you see the value fluctuates around 2 to 3 millimeters the specifications say it should be able to measure below 0.5 millimeters which is definitely not true in standard mode if we change to stability mode we get this stability the accuracy however is more or less the same the last obstacle is if the road suddenly disappears then the vehicle would fall this obstacle cannot be detected by all sensors we discussed so far cleaning robots typically have an IR diode pointing to the floor as soon as it is no more reflect the robot stops for fast-moving devices this is a severe problem because most cars are damaged by quite shallow holes in a road summarized the RP lidar is a neat device and it fulfills its specifications it is a 2d lidar and can detect walls and obstacles in one plane it is very good for slam applications for obstacle avoidance it has a clear advantage over fixed sliders or ultrasonic sensors because it detects barriers in a much wider range and can avoid collisions with walls its spatial resolution is excellent and it can detect an obstacle of 0.8 millimeters or 0.25 degrees on short distances however it is not sufficient for small things laying on the floor or low-hanging obstacles because it only measures in two dimensions it creates tons of data so your sketch has to be quite fast to cope with the speed maybe you even need a subsystem only for obstacle detection all in all it is a massive improvement over fixed lidar systems and an improvement over ultrasonic sensors what can we do a combination of such a lidar with an ultrasonic sensor pointing in the driving direction would keep all the advantages of the lighter plus would avoid the problem of small obstacles ultrasonic devices have an opening angle of about 30 degrees a cheap system consisting of at least five ultrasonic sensors would most probably be better for obstacle avoidance I built ones one with three sensors covering about 90 degrees but this sensor was not capable of solving the long wall problem for that we have to cover 180 degrees a 2d lidar definitely is not a solution this is the ugly truth even if manufacturers try to advertise it for that purpose I hope this video was useful or at least interesting for you if true please consider supporting the channel to secure its future existence you find the links in the description thank you bye you
Info
Channel: Andreas Spiess
Views: 163,120
Rating: 4.8842778 out of 5
Keywords: rplidar tutorial, lidar, esp8266 datasheet, esp32 datasheet, esp32, diy, simple, lidar arduino, wemos, esp8266, esp32 weather station, ttgo, esp32 project, smart home, lorawan, rplidar a1, projeect, guide, arduino project, esp8266 project, rplidar a1m8, slam, nodemcu, greatscott, wifi, rplidar, dfrobot lidar, 360 lidar, iot, dfrobot, hack, beginners, electronics, hobby, eevblog, 360 lidar scanner, arduino, how to, do-it-yourself, esp32 tutorial, rplidar arduino
Id: AERfie9wlWM
Channel Id: undefined
Length: 12min 26sec (746 seconds)
Published: Sat Sep 22 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.