frc538 / 2020-infinite-recharge

Robot code for FRC Team 538.
0 stars 0 forks source link

Gyro #61

Open drewwhis opened 4 years ago

drewwhis commented 4 years ago

We have a gyro attached to the robot but we're not doing anything with it right now.

We could easily add it to the Swerve Drive Subsystem and zero it on initialize. Then we could easily rotate until it reads the value we want it to read.

Example: https://github.com/juchong/ADIS16470-RoboRIO-Driver-Examples/blob/master/java/src/main/java/frc/robot/Robot.java

drewwhis commented 4 years ago

private ADIS16470_IMU mGyro = new ADIS16470_IMU(); should be how to instantiate it

drewwhis commented 4 years ago

mGyro.reset() can be called when the robot is facing forward to zero out the gyro.

drewwhis commented 4 years ago

It reads like the default axis of rotation is when the gyro/roboRIO are mounted flat, facing upward, so we won't need to configure that.

drewwhis commented 4 years ago

We may want to add a button on Shuffleboard and a command to zero the gyro. Note that the gyro should ONLY be zeroed when the robot is on the field facing directly forward.

drewwhis commented 4 years ago

Actually, we may just want to zero the gyro every match. We could do that during the start of autonomous.

drewwhis commented 4 years ago

Looks like this isn't done after all.