Closed ChuweyBar closed 6 years ago
There's sample code for using the navX AHRS class as an input to the PIDController
and using the output to rotate the robot. It's pretty straightforward, but will need to be implemented in the TurnToHeading
command.
In autonomous, sometimes we need to turn the robot to some specific degrees. Ex: Turn left 15 degrees, turn right 20 degrees. Using the Gyro we can control the robot to output the exact power to turn to the angle we desire. Look into last year's code, the following "TurnToHeading" would help. https://github.com/NRG948/NRGRobot2017/blob/master/NRGRobot2017/src/org/usfirst/frc/team948/robot/commands/TurnToHeading.java Ask for mentor or leadership's assistance on this issue. Don't commit any changes without mentor's approval.