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 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:


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