Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
first:adxrs450_gyro_board_frc:java [24 Oct 2018 18:25] – [Sensor Initialization and Calibration] Kristen Chongfirst:adxrs450_gyro_board_frc:java [10 Dec 2018 21:10] (current) – [Re-Zeroing the Gyro] Kristen Chong
Line 13: Line 13:
 \\ \\
 \\ \\
-===== Sensor Initialization and Calibration =====+===== Sensor Initialization and Calibration with calibrate() =====
 Once your gyro is defined and instantiated, you will need to initialize it with a calibration where it will execute as soon as the robot is powered on, typically robotInit(). To do this, you will need to call the calibrate() method. Calibration is necessary for proper operation and **MUST** be performed before the gyro can be used. For more information, please see the [[first:adxrs450_gyro_board_frc|general FRC Gyro page]]. Once your gyro is defined and instantiated, you will need to initialize it with a calibration where it will execute as soon as the robot is powered on, typically robotInit(). To do this, you will need to call the calibrate() method. Calibration is necessary for proper operation and **MUST** be performed before the gyro can be used. For more information, please see the [[first:adxrs450_gyro_board_frc|general FRC Gyro page]].
 \\ \\
Line 21: Line 21:
 \\ \\
 \\ \\
-<note tip>As a general note, the GetAngle() method will count continuously, meaning when it reaches 360 degrees, it will continue to 361, not zero. This is to make any functionality in your code using the gyro angle easier to implement without having to keep track of where in the 0-360 range your robot is or how many rotations have happened. </note>+<note tip>As a general note, the getAngle() method will count continuously, meaning when it reaches 360 degrees, it will continue to 361, not zero. This is to make any functionality in your code using the gyro angle easier to implement without having to keep track of where in the 0-360 range your robot is or how many rotations have happened. </note>
 \\ \\
 \\ \\
-===== Checking Communications ===== +===== Re-Zeroing the Gyro with reset() ===== 
-If you ever need to check that the gyro is responding to the RoboRIO, you can do this by using isConnected(). It will return a Boolean indicating whether it is connected or not. You usually will not need to use this, but it's available if you need to. +Sometimes it may be necessary to reset the gyro's "zero degrees" position. All gyros will have some amount of drift over time and it's physically impossible to calibrate out all sources of drift. In this case, you can use reset() to reset the current gyro heading to 0 degrees. When doing this, your robot should be facing the direction you want zero degrees to be, particularly if you are driving with field-oriented drive using an omnidirectional drive base. Otherwise, your robot may begin to behave incorrectly. For this reason, you should never automate this routine. Note that this **does not** recalibrate the gyro, so you don't have to be sitting still to perform this method properly.
-\\ +
-\\ +
-===== Resetting the Gyro ===== +
-Sometimes it may be necessary to reset the gyro's "zero degrees" position. All gyros will have some amount of drift over time and it's physically impossible to calibrate out all sources of drift. In this case, you can use reset() to reset the current gyro heading to 0 degrees. When doing this, your robot should be facing the direction you want zero degrees to be, particularly if you are driving with field-oriented drive using an omnidirectional drive base. Otherwise, your robot may begin to behave incorrectly. For this reason, you should never automate this routine. Note that this *does not* recalibrate the gyro, so you don't have to be sitting still to perform this method properly.+
 \\ \\
 \\ \\
first/adxrs450_gyro_board_frc/java.txt · Last modified: 10 Dec 2018 21:10 by Kristen Chong