View Single Post
  #14   Spotlight this post!  
Unread 11-01-2015, 18:34
DavisC DavisC is offline
Registered User
FRC #0539 (Titans)
Team Role: College Student
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Virginia
Posts: 200
DavisC is just really niceDavisC is just really niceDavisC is just really niceDavisC is just really nice
Re: LIDAR Sensor has arrived!

Quote:
Originally Posted by tech2077 View Post
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
__________________
FRC Team 539
Student Member: 2010 Breakaway - 2014 Aerial Assist
Mentor: 2015 Recycle Rush - present