Log in

View Full Version : SPI port gryo and accelerometer help


Andrew V
20-03-2016, 11:45
Does anyone know how to program the gyro that plugs into the SPI port of the roborio in java specifically this: http://firstchoicebyandymark.com/fc16-000

I've seen labview tutorials but none for java, any help would be appreciated, thanks.

nickbrickmaster
20-03-2016, 11:50
Use the ADXRS450_Gyro class. Here's the source:

https://github.com/robotpy/allwpilib/blob/master/wpilibj/src/athena/java/edu/wpi/first/wpilibj/ADXRS450_Gyro.java

Here's the docs:

http://first.wpi.edu/FRC/roborio/release/docs/java/edu/wpi/first/wpilibj/ADXRS450_Gyro.html

bdaroz
20-03-2016, 14:31
We found calibration to be key for this. Because of an awesome field reset team (we were very close to, or even ahead of schedule much of the time), and robots ready to go far more often than not, we were moving the robot in a powered up state. Our original plan was to plant the robot and THEN power it up as the FMS was reconfiguring. Thus the auto-calibration of the gyro should be sufficient.

In reality that didn't work so well. We ended up using a calibration command (Command-based robot) we could call when disabled to force the calibration before match start.

It seemed to significantly help with drift during our auto.