View Single Post
  #4   Spotlight this post!  
Unread 02-02-2015, 11:23
co1inw co1inw is offline
Student
AKA: Colin Willoughby
FRC #1768 (Nashoba Robotics)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: United States
Posts: 2
co1inw is an unknown quantity at this point
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
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.

Last edited by co1inw : 02-02-2015 at 11:45.