LIDAR-Lite is a laser ranging module from Pulsed Light, Inc. which is a lightweight and cost effective measurement device. LIDAR-Lite can be accessed over I2C or PWM. The JetsonHacks Github repository contains a small library for accessing the LIDAR-Lite v2 over I2C. Looky here:
The LIDAR-Lite v2 in the demo was purchased from Sparkfun.
Background
Earlier this year, we covered the LIDAR-Lite v1 installation. Refer to that article for a quick background on LIDAR and the device. Recently, a new and improved version was introduced. A summary of the new goodness taken from the Sparkfun website:
Each LIDAR-Lite v2 features an edge emitting, 905nm (75um, 1 watt, 4 mrad, 14mm optic), single stripe laser transmitter and a surface mount PIN, 3° FOV with 14mm optics receiver. The second version of the LIDAR-Lite still operates at 5V DC with a current consumption rate of <100mA at continuous operation. On top of everything else, the LIDAR-Lite has an acquisition time of only 0.02 seconds or less and can be interfaced via I2C or PWM.
The LIDAR-Lite v2 has received a number of upgrades from the previous version. With the implementation of a new signal processing architecture, LIDAR-Lite v2 can operate at measurement speeds of up to 500 readings per second offering greater resolution for scanning applications. Additionally, the LIDAR-Lite v2 has had its I2C communications improved to operate at 100 kbits/s or 400 kbits/s with you, the user, able to assign your own addressing! Just in case you are wondering: yes, the LIDAR-Lite v2 is compatible with its previous version in all primary functions and their compatibility will extend into the next version and beyond.
LIDAR-Lite v2 Installation
The LIDAR-Lite v2 runs on 5V, the I2C signals are 3.3V. Wiring to the Jetson TK1 is straightforward. In the video:
The LIDAR-Lite is connected to the Jetson J3A1 connector as follows:
LIDAR-Lite v2 5V to J3A1 Pin 1 (+)
LIDAR-Lite v2 GND J3A1 Pin 8 (-)
LIDAR-Lite v2 SCL J3A1 Pin 18 (C)
LIDAR-Lite v2 SDA J3A1 Pin 20 (D)
PulsedLight advises using a 680 uF capacitor between +5V and GND.
Software
Note: The LIDAR-Lite V2 software is not backward compatible with the LIDAR-Lite V1.
Once you have the LIDAR-Lite connected, you’re ready to test. There is a small library written for the Jetson to interface with the LIDAR-Lite over I2C available on Github. First, install some prerequisites:
$ sudo apt-get install libi2c-dev i2c-tools
You can then check to see if the Jetson TK1 can detect the LIDAR-Lite v2 address:
$ sudo i2cdetect -y -r 1
You should see ’62’ as one of the entries, which is the address of the LIDAR-Lite.
You can then run the example:
$ git clone https://github.com/jetsonhacks/JHLidarLite_V2.git
$ cd JHLidarLite_V2
$ cd example
$ make
After the example compiles, run:
$ sudo ./example
The sudo is required to access the I2C bus from user space. The example program will show the measured distance, the previous measured distance, and the velocity (rate of change) repeatedly. If the distance is always -1, even after passing your hand over the LIDAR-Lite, this probably means that it is not being recognized by the Jetson.
Also included in the examples folder is a little graphics plotting example as seen in the video. It’s beyond the scope of this article to give step by step instructions on how build the program, but the overview follows.
In order to compile the program, you will need to install Qt Creator as described in an earlier article. Using Qt Creator, compile the program contained in the ‘JHLidarLite_V2/example/LidarPlotSketch’. Once the program is compiled, find the executable in the build folder, and from a Terminal execute the application using ‘sudo’.
Note: This software was demonstrated using L4T 21.4.
Conclusion
The LIDAR-Lite v2 is a nice upgrade from the original product. As is usual for most products, the second version straightens out the niggles that the early adopters encountered, and adds useful features to make the product more user friendly and provide a basis for an even better product going forward.
27 Responses
Cool what was the problem with the V1 stuff? I just figured out the motor board and was going to start on this. Good thing I looked on twitter first 🙂
Two problems:
1) There weren’t enough sharks in the LIDAR-Lite v1 video.
2) The original routine ‘readLidarLite’ used ‘i2c_smbus_read_byte_data’.
The write/read needed a ‘STOP’ after the write on the v2, so it was changed to:
i2c_smbus_write_byte
i2c_smbus_read_byte
I want sharks with freakin laser beams attached to their heads too!
Spinning laser beams on top of Adafruit slip rings…at 120 rpm…http://www.adafruit.com/product/736
Who doesn’t want such a thing! I’m just curious as to how long the slip ring lasts under continuous use like that.
I don’t know. Anything over 10 hours and I would be happy to call it a replaceable wear item. Is that a mako maker shark?
I think the official part number I use in inventory is:
Part # MSP001
Description
Mako Shark – Plush
But I think it’s just because I like the word ‘plush’. Oh, and you do have to be a little careful, they do drink like a fish …
This rotating LIDAR-lite looks good to me.
https://www.youtube.com/watch?v=nIvOWfxFefc
LIDAR-lite v2 should be able to output one reading per degree at 120 rpm.
The step motor drive is fine for this task I think.
Common step motors are:
1.8 degrees per step at 200 steps/revolution
0.9 degrees per step at 400 steps/revolution
0.45 degrees per step at 800 steps/revolution
A once-per-revolution index pulse from a photo interrupter would be enough for orienting the scan in relation to the robot base.
Good range and much less expensive than off the shelf scanning lidar units.
Looks like a fun and interesting project.
One thing to remember is that the scanning rate on most commercial units is quite a bit higher over the range of the sweep. In other words, a commercial unit may have readings at 40hz over 270 or 360 degrees. At 120 rpm, using two LIDAR-Lites, that’s about 4hz. This is adequate for some applications, but for a fast moving vehicle it might not be.
An inexpensive entry in the 2D LIDAR is RPLidar which can run up to 10Hz scan rate with a sample frequency of 2000Hz. It’s in the $400 USD ballpark.
Most of the more expensive 2D LIDARs rotate a mirror above the electronics, rather than rotate the electronics themselves. That way they don’t have to worry about slip-rings at 2400 rpm. Also, as the speed goes up you have to worry about balancing, shock resistance, and environmental issues and such (dirt and debris getting in bearings is not much fun). Still, they are expensive and with the push in automotive markets to get the price down, one would think that eventually that filters out into the robotics market.
Yes, the 360 degree sweep may be asking a little too much out of this unit.
A first gen Kinect worked reasonably well as a ROS ‘fake’ indoor laser scanner for me.
The strength of the LIDAR-lite is it’s outdoor capability in full sunlight.
Kinect has a ~46 degree field of view.
Kinect2 and PrimeSense have ~60 degree field of view.
The ZED stereo camera has 110 degree diagonal field of view. Daytime use only of course.
The LIDAR-lite v2 spec sheet mentions 750 readings a second.
The ROS environment, in general, passes data around internally from 10 to 50Hz.
Lets take 10 to 30Hz as a nice hobby level -outdoor- lidar full sweep return signal frequency.
The ROS navigation packages would work well with a 75 degree sweep at 10Hz with 1 degree sensing resolution. (I have no ideas on the mechanicals yet!)
Verifying a 40 meter return in direct sunlight with your LIDAR-lite would be a test I would be very interested in seeing.
The LEGO builders rotating mirror over the LIDAR-lite got there first!
The LEGO guys are always a force to be reckoned with.
Hi,
I’m interested in the Jetson TK1 projects.
Could you explain about a C1 680uf capacitor more detail?
– Why do we need this part to work lidar lite?
– Where I can buy C1 680uf capacitor?
– Could you explain specification of the C1 680uf capacitor?
Hi Jony,
The manufacturer recommends the 680uF capacitor. From the part placement, it appears to be acting as a decoupling capacitor. A decoupling capacitor is used to decouple one part of an electrical network from another. One way to look at is is that the capacitor acts as local energy storage for the device so that there is a little reserve available if the current drops momentarily. The capacitor effectively maintains power-supply voltage in the nanosecond to millisecond range during an interruption.
You can buy capacitors almost everywhere. The one in the video is from here: http://amzn.to/1mtpZ2p
I happened to have some on hand already, you can resize them for your own project accordingly. Hope this helps.
Thank you for kindly answer 🙂
It’s really helpful to me.
i want to interface 3 lidars on I2C bus so whats is the pseudo code for three lidars??
how to assign devide adress for three lidars??
Do i need to open and close device in a loop or just one time open a devise ??
I don’t know what the term pseudo code means in this question.
One way to attach the Lidar-Lites to a Jetson is with a PCA9544A I2C Multiplexer, which allows I2C dvices to share the same I2C address. The LidarLite v2 also can have it’s address be assigned.
I’m not quite sure what you mean open and close device in a loop. See the example code for usage.
Lidar lite I2C runs at 3.3v and i want to interface it with jetson tk1 I2C pin at 1.8v so how to interface it.
Note : I2C pins of 3.3v in tk1 is already used so i can’t use it.
+ANSIC You have a couple of options. First, if you want to use the 1.8V Gen1 I2C pins on the Jetson, you can use an I2C friendly level converter between the Jetson and the Lidar-LITE. Here is an article doing something similar: https://jetsonhacks.com/2015/09/03/level-shifting-uart-and-gps-part-1-nvidia-jetson-tk1/ Make sure that you use a level converter that is meant for I2C, as the timing for I2C requires special handling.
An alternative is to hook up more than one device to the I2C 3.3V pins on the Jetson. If the devices have different addresses, this is straightforward. If not, then there are chips which can help provide different addresses for attached devices. This is demonstrated in: https://jetsonhacks.com/2016/01/11/imu-and-pwm-driver-over-i2c-for-nvidia-jetson-tx1/
Can I used v2 code for Lidar-lite v3?
Hi Kelvin,
I do not know, I have not tried the V3. Thanks for reading!
I tried v2 code for Lidar-Lite v3. example is working well but LidarPlotSketch isn’t. Trying to figure it out….
You’re more than half way there! The sketch probably isn’t worth the time to fix it if you’re going to use the Lidar-Lite in a real project. Glad to hear that the code works.
Sketch is working perfectly now for Lidar-Lite V3. I am trying to write the output data to a file by using example code….
Hi ,
Great post there, is it possible to interface multiple (3) lidarlite v2 using gpio pins, or PCA9544A is necessary for that.
Thank you for the kind words. There are 4 I2C busses available on the headers. Here’s the wiki info: http://elinux.org/Jetson/I2C
Note that you will need to check for the correct voltage, as the the bus runs at either 1.8 or 3.3V, and the wiring will need to change from that in the article. Good luck!
Hi Kangalow, Thanks for the quick response.
Is it possible to do it on the same i2c bus (instead of using different for each sensor) and change addresses of the lidars (lidar 1 – 0x62, lidar 2- 0x64..).
I have been trying to change address of single lidar, but as soon as I set(0x1e to 0x08, command to use non-default address for slave) lidar stops responding. I am following this link : https://github.com/PulsedLight3D/LIDARLite_v2_Arduino_Library/blob/master/LIDARLite/examples/Multiple%20Sensors/Change_I2C_Addresses/Change_I2C_Addresses.ino
Is there any thing in particular which needs to be changed so as to make it work on tx1.
Thanks
Here’s the article for the Jetson TX1: http://wp.me/p7ZgI9-qP
I do not have anything to share in regards to changing the address of the lidar. You’ll have to explore some and see what the solution ends of being.