Posted 05/23/15
In my last post (DC motor speed control using optical tachometer) I described my effort to implement a speed controller for one of Wall-E’s wheel motors so I could use it as the drive for a spinning LIDAR system using theLIDAR-Lite unit from PulsedLIght (http://pulsedlight3d.com/products/lidar-lite). Although I got the speed controller working, delivery of the 4WD robot chassis I had ordered to carry the LIDAR-Lite system was delayed so I couldn’t fully implement the system. In the meantime, I decided to play with the NEATO LIDAR unit I had acquired from eBay.
The NEATO XV-11 unit is a very cool self-contained spinning LIDAR unit intended for use in the NEATO robot vacuum cleaner. I find it interesting and amusing that such a technically elegant and useful module was developed for what is essentially a luxury toy, and that it is available to hobbyists for a reasonable price! The bad news is that the XV-11 emits a binary data stream that requires a fair bit of processing to make useful. Fortunately for us mere mortals, Get Surreal (http://www.getsurreal.com/) produces a Teensy-based XV-11 controller (http://www.getsurreal.com/product/xv-lidar-controller-v1-2) that does most of the work; it has connectors to mate with the XV-11 on one end, and a USB connector on the other for data retrieval/control. All that is required is an upstream USB device with a serial monitor of some sort. In my case, I used my laptop and the RealTerm serial monitor (http://sourceforge.net/projects/realterm/) to do the job.
As an experiment, I placed the XV-11 in a 14 x 14 inch cardboard shipping box, and connected it up. After capturing some processed data using my laptop and RealTerm, I sucked the processed data into Excel 2013 for analysis. The data transmitted by the Get Surreal Teensy controller is formatted as colon and space delimited (angle, distance, SNR) triplets. Angle is in integer degrees, distance is in mm, and SNR is an integer in parentheses with 0 representing missing data, and large numbers indicating high SNR. At the end of each 360-degree set of data, the XV-11 reports the elapsed time (in integer millisec) for the previous data set. The screenshot below shows the last few lines of a complete 360 degree dataset, along with the elapsed time value.
Excel – at least the 2013 version – is a very cool data analysis program. Not quite as cool as MATLAB (which I used a lot as a research scientist at Ohio State), but still pretty good, and nowhere near as expensive (it was free for me at the university, but it is very expensive for civilians). Excel’s graphing routines are amazingly powerful and easy to use – much better IMHO than MATLAB’s. In any case, I used Excel to graph some of the XV-11 data I had just captured. I started with Excel’s stock polar graph (it’s called a Radar plot in Excel), and got the following plot with absolutely no effort on my part (other than selecting the Radar plot type)
This appears to be an excellent representation of the actual box, with a few data points missing (the missing points had SNR values of zero, so I could easily have gotten Excel to disregard them). Although I had physically placed the XV-11 in the box in such a way as to be parallel with the sides of the box, the data shows a tilt. This is due to the way that the XV-11 reports data – 0/360 degrees is not the physical front of the device – it is offset internally by about 11 degrees (no idea why)
As my original Wall-E robot was conceived as a wall-following device, I was interested in using the LIDAR data to do the same thing – follow the walls. So, I converted the polar (angle/radius) data into X/Y coordinates to see if I could condense the data down to something I could use for wall guidance. The next plot is the same dataset as in the above plot, but converted to X/Y coordinates.
This, although perfectly understandable given the box environment, wasn’t really helpful as a possible wall-following algorithm, so I decided to look at the line slope instead of just the raw X/Y coordinates. This gave me the next Excel plot, shown below.
This plot was interesting in that it definitely showed that there were only two slopes, and they were the negative reciprocals of each other, as would be expected from a box with two sets of parallel sides perpendicular to each other. Also, having only two values to deal with vastly simplifies the task of making left/right steering decisions, so I thought maybe I was on to something for LIDAR Wall-E.
As I drifted off to sleep that night, I was reviewing my results so far when it occurred to me that I was thinking of the problem the wrong way – or maybe I was trying to solve the wrong problem. I was trying to use LIDAR data to follow walls a la Wall-E, but what I really wanted to do was have the robot navigate typical indoor layouts without getting stuck anywhere. I had chosen a wall-following algorithm because that’s what I could do with ultrasonic ping sensors. Another possible way to solve the problem is to have the robot move in the direction that offers the least restriction; i.e. in the ‘most open’ direction. This would be very difficult to accomplish with ping sensors due to their limited range and inherent multipath and fratricide problems. However, with a LIDAR that can scan the entire 360 degrees in 200 msec, this becomes not only possible, but easy/trivial. So, the new plan is to mount the XV-11 LIDAR on Wall-E, and implement the ‘most open in the forward direction’ algorithm. This should result in something very like wall-following in a long hallway, where the most open forward direction would be along the length of the hall. When the robot gets near the end of the hall, then either the left or right perpendicular distance will become ‘the most open’ direction which should cause Wall-E to make a hard right or left turn, followed by another same-direction turn when it gets close to the other wall. After the two right-angle turns, Wall-E should be heading back down the hall in the opposite direction.
Stay tuned…
Frank
Pingback: LIDAR-Lite Gets its Own Motor - Paynter's Palace
Pingback: More work on the NEATO XV-11 LIDAR Module - Paynter's Palace