View Single Post
  #1   Spotlight this post!  
Unread 08-02-2015, 15:45
Arbalest007 Arbalest007 is offline
Registered User
FRC #2496
 
Join Date: Sep 2014
Location: Irvine, California
Posts: 19
Arbalest007 is an unknown quantity at this point
Help! Gyro Not Helping With Strafing!!

Hi everyone. So our team tested this method on the practice bot with mecanum wheels to see if it would allow the bot to strafe perfectly straight during teleop in order to minimize driver error when strafing.

//This method is called during TeleopPeriodic()
public void driveStraight() {
while(stick.getRawButton(1)) {
double stickDegrees = 0;

if(Math.abs(stick.getDirectionDegrees() % 90) < 30 || Math.abs(stick.getDirectionDegrees() % 90 > 60) {
if(Math.abs(stick.getDirectionDegrees() > 60 && Math.abs(stick.getDirectionDegrees()) < 120) {
if(stick.getDirectionDegrees < 0)
stickDegrees = -90.0;
else
stickDegrees = 90.0;
}
}

gyro.reset();
wholeDrive.mecanumDrive_Polar(stick.getMagnitude() , -stickDegrees, -gyro.getAngle() * .05);
}

This code used to let our practice bot strafe perfectly (The robot would kinda curve back and forth to correct itself to still strafe straight). However, on our competition bot the robot strafes and then starts to curve inwards and I'm not sure what is going on....
Reply With Quote