Log in

View Full Version : Using LIDAR Lite 2 sensor on RoboRIO I2C port


Gthe3rd
04-09-2016, 08:12
Hi all,

My team is checking new options for sensors and we came across the Lidar laser rangefinder.
I have look all over the forums for instruction on how to use the sensor, and how to wire it. Now I have a few unanswered questions:
- how exactly does one read from the sensor?
- I saw a few posts about how the RoboRIO I2C port isn't very good for this sensor. Can anyone explain why?
- I was wondering whether some team actually used this sensor in the games.

Thanks a lot!

P.S.
We program in java

euhlmann
04-09-2016, 11:58
Do you know the manufacturer / model number of this sensor?

Edit: Ah, I see. It's called the "LIDAR Lite 2"

This document lists the i2c registers on the sensor: http://www.robotshop.com/media/files/pdf2/pli-03_detailed_register_definitions.pdf
There's also sample code provided for the Arduino, which you may be able to adapt: http://www.robotshop.com/media/files/zip2/lidarlite_v2_arduino_library-master.zip

Gthe3rd
06-09-2016, 03:07
I'm still unclear on how the sensor connects to the roboRIO.
Naturally, as an I2C device, it connects to the I2C port. However, I've seen a few posts about connecting it through and MXP I2C port.
Can anyone explain this?
Thanks!

EmileH
06-09-2016, 16:18
IIRC, in 2015, there was no Java/C++ support for the dedicated I2C port on the RoboRIO - it had something to do with it only working in Labview and I don't really know the details. The easy way around this was to use the MXP port which did work (as long as you weren't using this port already for another device). I don't know if this was fixed for 2016 - somebody correct me if I'm wrong :P

To be safe, use the MXP port. This is my previous post (https://www.chiefdelphi.com/forums/showthread.php?p=1501843#post1501843) with our code and the base that it came from, but we were using v1 of the LIDAR module (silver label). It is likely that you are using v2 (blue label) and will need to modify the code as the v2 reads differently than v1. Check the manual for instructions on reading from the device.

Gthe3rd
07-09-2016, 11:24
Thanks a lot!