Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Technical Discussion (http://www.chiefdelphi.com/forums/forumdisplay.php?f=22)
-   -   LIDAR Sensor has arrived! (http://www.chiefdelphi.com/forums/showthread.php?t=132213)

seg9585 06-01-2015 01:39

LIDAR Sensor has arrived!
 
Just wanted to share that a new LIDAR (laser radar/rangefinder) is out on the market from "PulsedLight3D" for $90 -- Class I laser so it's FIRST legal. Just arrived today in the mail, and I hooked it up to my Arduino:



Did some initial testing via I2C, seems to be very accurate between ~20cm and 650cm (as far as I could test it tonight without finding a larger room), 0.5 deg beam width

Here's a snapshot of my Serial output with distance in cm (~100 Hz samples averaged and output at 5 Hz), sitting on my desk facing up to the ceiling.


http://pulsedlight3d.com/
We're going to have fun with this!

AllenGregoryIV 06-01-2015 02:07

Re: LIDAR Sensor has arrived!
 
We got ours today as well. Similar results to your tests. Very excited about this little guy.

runneals 06-01-2015 02:42

Re: LIDAR Sensor has arrived!
 
Being a geospatial geek, this is TOTALLY COOL!!!!!!!

TylerStaudigel 06-01-2015 08:24

Re: LIDAR Sensor has arrived!
 
This might be a newbie question, but this can be connected to the robo-rio via the I2C and programmed in labview to give us the distance. Right. I haven't done much work dealing with I2C and am not sure what to expect.::rtm::

seg9585 06-01-2015 14:47

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by TylerStaudigel (Post 1422591)
This might be a newbie question, but this can be connected to the robo-rio via the I2C and programmed in labview to give us the distance. Right. I haven't done much work dealing with I2C and am not sure what to expect.::rtm::

The sensor has 2 output formats: I2C and PWM. I have tested via I2C and it works great. To use PWM, you'd need to create a low-pass filter to smooth the output which could then be read by the roboRio analog input.

I will be coding up a Java Class this week to interface with I2C on the roboRio, which I'd be happy to share.

tech2077 08-01-2015 00:15

Re: LIDAR Sensor has arrived!
 
In case anyone is interested, I wrote up a java class for this, you can use the start/stop functions to use the built in updater Timer, or use the update function to only poll distance when needed.
LIDAR.java

PaulDavis1968 08-01-2015 00:40

Re: LIDAR Sensor has arrived!
 
Ordered! I have been drooling over this for 6 months. And we might have a use for it. I was going to buy it for my self regardless. If it works out I will get one for the team so we have two.

dellagd 08-01-2015 06:21

Re: LIDAR Sensor has arrived!
 
Based on the datasheet it seems this wouldn't work on polycarbonate, since it transmittance is just as high at 905nm as it is in the visible spectrum, and the laser would mostly go right through. I really don't know much about LIDAR systems, so does anyone else with more experience know if this would be the case?

PaulDavis1968 08-01-2015 09:46

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by dellagd (Post 1424166)
Based on the datasheet it seems this wouldn't work on polycarbonate, since it transmittance is just as high at 905nm as it is in the visible spectrum, and the laser would mostly go right through. I really don't know much about LIDAR systems, so does anyone else with more experience know if this would be the case?


I asked this question on their forum.

https://groups.google.com/forum/#!forum/pulsedlight3d

Jared Russell 08-01-2015 10:27

Re: LIDAR Sensor has arrived!
 
Polycarbonate doesn't have 100% transmittance for near IR, but it's still very high. You will get a small amplitude return from polycarb, which will be higher if there are scratches or dirt on the surface, or if you are getting specular returns from other light sources. You can configure the LIDAR-Lite to present either the strongest, first, or last return to you, and I'd expect whatever is behind the panel to be the strongest return the vast majority of the time (but not always).

Experientially, LIDAR sucks for detecting transparent objects and requires lots of signal processing and integration of multiple scans over time to have any chance of accurately detecting a transparent object.

seg9585 08-01-2015 11:01

Re: LIDAR Sensor has arrived!
 
FYI, I have detected distance to transparent windows with moderate levels of success. I'd assume polycarbonate behaves similarly, but would have to do more testing. We are programming up the LIDAR against the roboRio tonight so I'll try it out.

NotInControl 08-01-2015 11:06

Re: LIDAR Sensor has arrived!
 
For those that have these sensors, what is the jitter on the returned distance value you are receiving for a given period of time?

Does the returned value go unstable at any point in operation (i.e bouncing around different values) or is it pretty accurate, to what level of accuracy have you noticed? (i.e +/- 1 cm)?

Are you using the RoboRio or other embedded device to power and read the sensor?

Thanks for your response.

Thanks,
Kevin

dellagd 08-01-2015 15:17

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by seg9585 (Post 1424265)
FYI, I have detected distance to transparent windows with moderate levels of success. I'd assume polycarbonate behaves similarly, but would have to do more testing. We are programming up the LIDAR against the roboRio tonight so I'll try it out.

Not quite. Glass is actually opaque to IR light, just like a piece of metal would be, while polycarbonate behaves just the same as it would in the visible spectrum (for a good bit). Things change when you move to different wave lengths, like, for instance, a black trash bag is totally transparent.

seg9585 08-01-2015 15:55

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by dellagd (Post 1424408)
Not quite. Glass is actually opaque to IR light, just like a piece of metal would be, while polycarbonate behaves just the same as it would in the visible spectrum (for a good bit). Things change when you move to different wave lengths, like, for instance, a black trash bag is totally transparent.

True for some IR bands but not near-infrared. Glass transparency doesn't drop off until approx 2000nm but this laser operates at 900nm.

One source:
http://www.molalla.net/members/leeper/transmis.png

dellagd 08-01-2015 16:12

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by seg9585 (Post 1424431)
True for some IR bands but not near-infrared. Glass transparency doesn't drop off until approx 2000nm but this laser operates at 900nm.

One source:
http://www.molalla.net/members/leeper/transmis.png

Fair enough, then I'm curious how the LIDAR is operating as well as it does. Interesting.

PaulDavis1968 08-01-2015 23:53

Re: LIDAR Sensor has arrived!
 
From the products google groups

https://groups.google.com/forum/#!to...3d/ebRaHl6sylM



Paul,

That's very exciting... in the course of looking at the forum I found Innovation First International... I grew up fairly near Greenville, TX. Will be joining the forum to follow along... have been getting into ROS.org and robotics in my hobby-time.

@Polycarbonate - the way the sensor acquires readings is by sending a bunch of pulses out and then capturing what comes back, combining those into a "correlation record" and then measuring the distance between the crossing point in the reference signal and the next strongest signal (or if you ask for it, the second strongest).

There are a few surfaces and conditions it can't "see" but in my experimental experience it can detect most surfaces from one angle or another. Sometimes with reflective and clear surfaces you can get unexpected results, but that's where that second reference comes in handy. You can use it to see a reflection or an object on the far side of a clear object if you are picking up your strongest signal from the clear object.

Pg. 17 "Signal Acquisition process" through pg 22 "Processing" of our manual goes into detail about how the sensor records information: http://pulsedlight3d.com/pages/docs

Let me know if you have any more questions very happy to help! We're excited about what the chiefdelphi.com community is going to do with LIDAR-Lite!

- Austin

seg9585 10-01-2015 22:06

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by tech2077 (Post 1424117)
In case anyone is interested, I wrote up a java class for this, you can use the start/stop functions to use the built in updater Timer, or use the update function to only poll distance when needed.
LIDAR.java

tech2077, are you having any luck with this code? When I attempt to run I get zero distance data. Also, the i2c.read() function returned "true" (aborted). I'm passing in Port.kOnBoard and the sensor is plugged into the I2C port on the roboRio

tech2077 11-01-2015 03:33

Re: LIDAR Sensor has arrived!
 
Strange, it has worked for me. I've been using the mxp port so far, so I'll test with the on board one.

tech2077 11-01-2015 04:16

Re: LIDAR Sensor has arrived!
 
Right now it seems that only the MXP port is supported with the LIDAR, I'm still investigating, but using the same power source and code, only the MXP I2C port will return data.

Poseidon5817 11-01-2015 10:20

Re: LIDAR Sensor has arrived!
 
Quote:

Dimensions: 21 X 48.3 X 35.5 mm
• Performance: Range: 0-40m Laser Emitter
• Accuracy: +/- 0.025m
• Power: 5vdc, <100ma
• Acquisition Time: < 0.02 sec
• Rep Rate: 1-100Hz
• Interface: I2C or PWM
•Max Operating Temp.: 70° C
•Eye safe, laser hazard free
Works up to 40 m, + or - 2.5 cm, <20 ms acquisition time.

We have ordered one.

seg9585 11-01-2015 15:16

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by tech2077 (Post 1426115)
Right now it seems that only the MXP port is supported with the LIDAR, I'm still investigating, but using the same power source and code, only the MXP I2C port will return data.

Ah, thank you! I originally wrote up my own test code without the scheduler implementation and couldn't get it to work in this port, so I switched to yours with similar results. They seem to work just fine in the expansion port, making me curious if the I2C onboard has a bug or is otherwise disabled on the roboRio. I'll contact NI and let them know.
For now, works perfectly on the MXP, thanks again!

JesseK 11-01-2015 15:39

Re: LIDAR Sensor has arrived!
 
I might get one of these to poke around with. Our programming team is talking crazy talk for autonomous, and I don't know that the drive train will have quite the precision they require to squeak in under 15 seconds.

Anyone tried this out on diamond plate? I bet more than my team has felt a twinge of failure with ultrasonics when moving from the lab to the field.

tech2077 11-01-2015 16:08

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by seg9585 (Post 1426303)
Ah, thank you! I originally wrote up my own test code without the scheduler implementation and couldn't get it to work in this port, so I switched to yours with similar results. They seem to work just fine in the expansion port, making me curious if the I2C onboard has a bug or is otherwise disabled on the roboRio. I'll contact NI and let them know.
For now, works perfectly on the MXP, thanks again!

Poking around the linux side with i2ctools there are definitive read/write errors showing up for the onboard port, so I'll be sure to let them know.

Quote:

Originally Posted by JesseK (Post 1426316)
I might get one of these to poke around with. Our programming team is talking crazy talk for autonomous, and I don't know that the drive train will have quite the precision they require to squeak in under 15 seconds.

Anyone tried this out on diamond plate? I bet more than my team has felt a twinge of failure with ultrasonics when moving from the lab to the field.

Anything solid and IR opaque should have good data from this sensor. The diamond plate will definitely give good distance readings, but totes and lexan still need to be tested.

DavisC 11-01-2015 18:34

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by tech2077 (Post 1424117)
In case anyone is interested, I wrote up a java class for this, you can use the start/stop functions to use the built in updater Timer, or use the update function to only poll distance when needed.
LIDAR.java

How do you (or anyone that has gotten this to work) implement this with the main class. I specifically am using the "Getting Started" example.

I tried using it something like this (don't have the exact code in front of me...):
Where variables are declared:
Code:

LIDAR myLidar = new LIDAR(port.kOnboard);
then in teleopPeriodic() I did:
Code:

myLidar.update();
System.out.println(myLidar.getPID());

However, 0.0 is only ever printed out to the Riolog. (I also tried having the myLidar.start() and myLidar.stop() inside of teleopInit and disabledInit respectively.

Thanks in advance,
DavisC

tech2077 11-01-2015 20:23

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by DavisC (Post 1426400)
How do you (or anyone that has gotten this to work) implement this with the main class. I specifically am using the "Getting Started" example.

I tried using it something like this (don't have the exact code in front of me...):
Where variables are declared:
Code:

LIDAR myLidar = new LIDAR(port.kOnboard);
then in teleopPeriodic() I did:
Code:

myLidar.update();
System.out.println(myLidar.getPID());

However, 0.0 is only ever printed out to the Riolog. (I also tried having the myLidar.start() and myLidar.stop() inside of teleopInit and disabledInit respectively.

Thanks in advance,
DavisC

It's been discovered that the on board I2C port is having communication problems, use the I2C on the MXP port until the issue is resolved.

DavisC 11-01-2015 21:39

Re: LIDAR Sensor has arrived!
 
Thanks, so I just use kMXP instead of kOnBoard and connect to the expansion port bottom left 2 pins for sda and scl?

seg9585 11-01-2015 21:45

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by DavisC (Post 1426481)
Thanks, so I just use kMXP instead of kOnBoard and connect to the expansion port bottom left 2 pins for sda and scl?


Correct. I still had my sensor power pins plugged into the I2C power and ground ports, which seem to work (for what it's worth).

Also, if you execute myLidar.start(); in your init area or constructor, you can access myLidar.getDistance() in both autonomous and teleOp methods and allow it to run its own thread, which will help avoid bogging down the rest of your code (because the update() method includes delay timers up to ~10ms to write and read).

JesseK 11-01-2015 22:33

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by tech2077 (Post 1426332)
Anything solid and IR opaque should have good data from this sensor. The diamond plate will definitely give good distance readings, but totes and lexan still need to be tested.

The raised diamonds on the diamond plate caused excessive backscatter with the sonar sensor. A better way to put the question is, do the diamond shapes cause the Lidar laser to reflect/refract as the robot moves down the wall next to the diamond plate? If so, is it momentary and how long does it take to recover?

tech2077 11-01-2015 23:01

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by JesseK (Post 1426512)
The raised diamonds on the diamond plate caused excessive backscatter with the sonar sensor. A better way to put the question is, do the diamond shapes cause the Lidar laser to reflect/refract as the robot moves down the wall next to the diamond plate? If so, is it momentary and how long does it take to recover?

I'll do testing on this as soon as I can, but from what I have tested most surfaces do not refract it enough to actually change the measurements. The only situations I've noticed a problem is with a few thin plastics they are entirely transparent to the IR laser.

WDB 12-01-2015 20:45

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by seg9585 (Post 1426487)
Correct. I still had my sensor power pins plugged into the I2C power and ground ports, which seem to work (for what it's worth).

Also, if you execute myLidar.start(); in your init area or constructor, you can access myLidar.getDistance() in both autonomous and teleOp methods and allow it to run its own thread, which will help avoid bogging down the rest of your code (because the update() method includes delay timers up to ~10ms to write and read).

We tried the I2C port too and failed. Moved over to the MXP and still getting zeroes.

Using lidar.start() in the teleopInit and calling lidar.getDistance() in teleopPeriodic which is returning zero. Am I missing anything?

Thanks!

seg9585 13-01-2015 02:25

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by WDB (Post 1427073)
We tried the I2C port too and failed. Moved over to the MXP and still getting zeroes.

Using lidar.start() in the teleopInit and calling lidar.getDistance() in teleopPeriodic which is returning zero. Am I missing anything?

Thanks!

I assume you have the correct wires connected per the datasheet and are using the correct pins on the MXP?
I added an execution counter to the lidar class' update() method to ensure the code was properly executing (and output this counter to the SmartDashboard). Could you do this as well as a form of troubleshooting?

jhersh 13-01-2015 10:51

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by tech2077 (Post 1426332)
Poking around the linux side with i2ctools there are definitive read/write errors showing up for the onboard port, so I'll be sure to let them know.

What port in Linux are you referring to? What is the dev path you are using?

seg9585 13-01-2015 11:32

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by tech2077 (Post 1426524)
I'll do testing on this as soon as I can, but from what I have tested most surfaces do not refract it enough to actually change the measurements. The only situations I've noticed a problem is with a few thin plastics they are entirely transparent to the IR laser.

Based on discussion with NI, I'm led to believe the problem may be specific to Java and not the controller itself. NI claims their ADXL345 accelerometer works just fine with I2C when using LabView modules, but I can't get the accelerometer to work with the onboard port either when using Java.

https://decibel.ni.com/content/thread/26778

Joe Ross 13-01-2015 11:44

Re: LIDAR Sensor has arrived!
 
Can you try in C++ as well (either the accelerometer or the LIDAR). Java and C++ share a lot of code, and that might help pinpoint where the issue is.

tech2077 16-01-2015 01:42

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by Joe Ross (Post 1427335)
Can you try in C++ as well (either the accelerometer or the LIDAR). Java and C++ share a lot of code, and that might help pinpoint where the issue is.

Verified to have the same error.

marshall 16-01-2015 09:57

Re: LIDAR Sensor has arrived!
 
We picked up one of these... it seems very sensitive to glossy/reflective surfaces. Much more so than the lidar system we yanked from a Neato vacuum robot. Not sure what others are seeing. We haven't dived into the sample code yet beyond running it.

Tom Line 17-01-2015 16:12

Re: LIDAR Sensor has arrived!
 
We have 2 of these and played with them today with LabVIEW. We have been unable to get them to work with the native I2C port on the roborio. However, we have them working just fine on the MXP expansion I2C with identical code. We've pinned them out, swapped the lasers themselves, and still have zero luck with the native port.

The native port DOES know the sensor is connected. We received read and read/write errors stating that the device is busy. This is different that the 'resource not found' error we get when the device is not plugged into to power or not plugged into the I2C.

On the MxP I2C port we are reading then writing in alternating 20 ms loops. We lowered the timing of these loops incrementally until we started getting errors. At 10 ms polling we receive all zeros, at 15 ms we receive data, so 20 ms is where we are (50 hz). We average 5 loops in a moving average filter and the data looks very good.

I know we can improve this by doing the write then checking for the ready bit, but this worked just as well and gave us a resolution we're happy with. Plus after 6 hours of banging our head against the native port we were already pretty frustrated.

We have noticed that when the sensor was aiming at the ceiling and our flourescent lights we got highly inaccurate results.

Merfoo 20-01-2015 00:22

Re: LIDAR Sensor has arrived!
 
How would one program the LIDAR Sensor for use via DIO in Java?

IronicDeadBird 20-01-2015 11:09

Man I wanted one of these and I don't even have a reason...
Any cool uses for them I have a couple ideas but none of them are viable this year cause auto too short...

marshall 20-01-2015 11:17

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by Merfoo (Post 1430851)
How would one program the LIDAR Sensor for use via DIO in Java?

I don't know that you can. It's designed to work via PWM output or I2C. The I2C implementation should be pretty similar to the arduino example on their website. The PWM setup will likely just be reading analog input values but don't quote me on that.

tech2077 20-01-2015 11:27

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by Merfoo (Post 1430851)
How would one program the LIDAR Sensor for use via DIO in Java?

Two possible methods:
  1. Use a low pass filter and read through analog (less programming but requires a resistor and capacitor connected to the output, or
  2. Directly measure the pwm pulse and convert the timing to distance (more programming, but the sensor just drops in and works)

I plan on eventually writing up a pwm based class due to the problems teams have had with this sensor and the onboard i2c port.

PaulDavis1968 23-01-2015 12:09

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by IronicDeadBird (Post 1430930)
Man I wanted one of these and I don't even have a reason...
Any cool uses for them I have a couple ideas but none of them are viable this year cause auto too short...


I wanted one of these period. I don't care if we use it.

co1inw 02-02-2015 11:23

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by tech2077 (Post 1424117)
In case anyone is interested, I wrote up a java class for this, you can use the start/stop functions to use the built in updater Timer, or use the update function to only poll distance when needed.
LIDAR.java

Please correct me if I'm wrong, but there appears to be a bug in this file. You are calling updater.scheduleAtFixedRate(), which would be fine if you didn't already have a while() loop inside your TimerTask. Since you have a while loop, the run() function will never exit, so essentially your timer is useless and is acting like just a Thread object to run this function in the background indefinitely. The 'period' argument isn't being used, so the sensor will be polled every 10ms.

Also, since it came into the discussion, our team is using Java and we have been able to successfully use our RoboRio I2C port for a MaxBotix ultrasonic sensor, but not for the LIDAR sensor. Trying to use the LIDAR gives us write and read errors.

Pi Fighter 02-02-2015 18:48

Re: LIDAR Sensor has arrived!
 
5 Attachment(s)
Hello all, a while ago our team posted that we were able to successfully collect data from the Lidar sensor using LabVIEW. Today I'm posting the code we're using to collect the data, as well as pictures of the placement of these VI's in the robot project. Feel free to use them as needed.

muvicado 07-02-2015 13:11

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by seg9585 (Post 1422533)
Just wanted to share that a new LIDAR (laser radar/rangefinder) is out on the market from "PulsedLight3D" for $90 -- Class I laser so it's FIRST legal. Just arrived today in the mail, and I hooked it up to my Arduino:



Did some initial testing via I2C, seems to be very accurate between ~20cm and 650cm (as far as I could test it tonight without finding a larger room), 0.5 deg beam width

Here's a snapshot of my Serial output with distance in cm (~100 Hz samples averaged and output at 5 Hz), sitting on my desk facing up to the ceiling.


http://pulsedlight3d.com/
We're going to have fun with this!

Do you know if more than one LIDAR-Lite can be connected via CAN through the MXP's can bus?

The LIDAR-Lite appears to have a fixed slave address - 0xC4.

LIDAR-Lite Spec

Why would they not make it configurable? Seems like that would prevent one from being able to use multiple LIDAR-Lites on the same I2C bus.

Maybe I'm missing something. The LIDAR's slave address must be configurable somehow. :confused:

Alan Anderson 07-02-2015 14:59

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by muvicado (Post 1439733)
Maybe I'm missing something. The LIDAR's slave address must be configurable somehow. :confused:

The pre-release descriptions all talk vaguely about being able to control multiple devices on the I2C bus, but none of the available documentation I've been able to find mentions anything about configuring the slave address.

muvicado 07-02-2015 15:41

Re: LIDAR Sensor has arrived!
 
Quote:

Originally Posted by muvicado (Post 1439733)
Do you know if more than one LIDAR-Lite can be connected via CAN through the MXP's can bus?

The LIDAR-Lite appears to have a fixed slave address - 0xC4.

LIDAR-Lite Spec

Why would they not make it configurable? Seems like that would prevent one from being able to use multiple LIDAR-Lites on the same I2C bus.

Maybe I'm missing something. The LIDAR's slave address must be configurable somehow. :confused:

Okay, I discovered the slave address can't be changed on the current version of LIDAR_Lite. From PulsedLight's forum, I learned a work-around for this. Using a DIO pin for each LIDAR, connect pin 2 of connector J1 on the LIDAR to a dedicated DIO pin on the RIO, using this as a "device select" line. Just before and just after the Write/Read sequence to each LIDAR, set teh LIDAR's device select high and low, respectively. We will try this out, using a C++ application.

MrRoboSteve 09-02-2015 11:50

Re: LIDAR Sensor has arrived!
 
I'm having trouble getting this working via C++ -- created a separate post on the topic -- any thoughts?

http://www.chiefdelphi.com/forums/sh...d.php?t=134212

FlyOldPlanes 22-02-2015 19:10

Re: LIDAR Sensor has arrived!
 
Here is what we did with java:

The big thing was we had to add a pull up resistor on the clock pin.

http://www.chiefdelphi.com/forums/sh...ighlight=lidar

Lennie


All times are GMT -5. The time now is 04:53.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi