Quote:
Originally Posted by tech2077
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