ODROID-Powered LIDAR: Light Detection and Ranging with the ODROID-XU4

LIDAR: Light Detection & Ranging with the ODROID-XU4

I just recently ordered an ODROID-XU4 to power my latest project, an Earth Rover, which is a 6-wheeled rover, with the aim to navigate inside and outside areas autonomously. I'm using a LIDAR pulled out of an old robotic vacuum cleaner, the Neato XV-11 LIDAR. This project covers interfacing the ODROID with the LIDAR, receiving scan measurements, and integrating them into a SLAM, Simultaneous Localisation and Mapping, system for building a map of the area. I chose the ODROID because it was the only board powerful enough to process the measurements into a map in real time.

It has eight cores, four run at 2Ghz, and four run at 1.6Ghz. Remember your original Pentium 133Mhz? This thing runs fifteen times faster than it, and does it four times at once— and has another four cores just for kicks, and it fits inside your coffee cup. How much is it? $59. Plug it in, HDMI, power, USB keyboard & mouse, USB wifi. And first up, run the following commands to completely update your system:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade
Due to the NEON multi-processing instruction set, the performance is quite good, http://bit.ly/2zG12Ix, for particular tasks such as SLAM, even compared to the powerful Pi, as shown in Figure 1.

Figure 1 - Scans Per Second comparison for various SBC devices

First, clone the installation system and run it:

$ sudo apt-get install git
$ git clone https://github.com/tjacobs/betabot
$ cd betabot/install
$ ./install
Now we have lots of good applications such as Python, PIP, OpenCV, FFMPEG, and Alsa, let’s install BreezySLAM:
$ git clone https://github.com/simondlevy/BreezySLAM
$ cd BreezySLAM/python
$ sudo python setup.py install
$ cd ../examples
$ make pytest
Figure 2 - A preliminary image of a SLAMed room using LIDAR

As shown in Figure 2, we’re seeing a SLAMed room! This is from its built-in data file, so no external physical LIDAR is available yet. Let’s try watching the thing run live, which requires matplotlib:

$ sudo apt-get install python-matplotlib
$ make movie
Figure 3 - A live movie version of a SLAMed room using LIDAR

As shown in Figure 3, we can see it run, and a map is being generated. The next step is to try out the LIDAR, which requires xvlidar, pip, and pyrserial:

$ git clone https://github.com/simondlevy/xvlidar
$ sudo python setup.py install
$ python lidarplot.py
$ wget https://bootstrap.pypa.io/get-pip.py
$ sudo python get-pip.py
$ sudo pip install pyserial
The output now reads:
SerialException could not open port /dev/ttyACM0
Since it’s trying to access the serial port, we can check that device:
$ ls /dev/tty*
$ /dev/ttyACM99
It turns out that the device is actually in another port:
$ /dev/ttySAC0
To find out where to plug the LIDAR, we can refer to the ODROID-XU4 manual at http://bit.ly/2xYZhco, but it’s not mentioned. The information that we need is at http://bit.ly/2hYj8NQ, and Figure 4 illustrates the pins that we are looking for.

Figure 4 - GPIO configuration for a LIDAR project on the ODROID-XU4

The receive and transmit pins are UART_0.RXD (#6) and UART_0.TXD (#8). Let’s take a ground (#2) and a 5v power (#1) as well. Most XV Lidars are 5v, as described at http://bit.ly/2gBSiPc. I used the 1.8v pin to power the LIDAR motor, which hopefully supplies enough amperage. After running lidarplot.py again, I get a spinning lidar, and a blank plot with a single dot in it, and the occasional “Checksum fail” when I wiggle the plugs. So it’s getting something, but not anything useful yet, as shown in Figure 5.

Figure 5 - The initial output of the LIDAR configuration on the ODROID-XU4

After adding some printouts, I see that the serial port is generating lots of 82’s along the 360 degree array. I assume that means “Not spinning fast enough”, because I used a Raspberry Pi 2 to generate the correct voltage at 3.3v, and was able to get LIDAR scans. It also updates very quickly, since when I put my hand in front of it, the change is reflected within a second or so.

Figure 6 - The tweaked output using a 3.3v motor of the LIDAR configuration on the ODROID-XU4

Now we are ready to run the SLAM application:

$ cd BreezySLAM/examples
$ python xvslam.py
Figure 7 - SLAM on the ODROID-XU4

For comments, questions, and suggestions, please visit the original article at: http://bit.ly/2xX6ObL.

Be the first to comment

Leave a Reply