Advertisement
Guest User

Untitled

a guest
Jan 26th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.46 KB | None | 0 0
  1.     public void velocityDrive()
  2.     {
  3.         frontLeftDrive.setVelocity(frontLeftPower*2600);
  4.         frontRightDrive.setVelocity(frontRightPower*2600);
  5.         backLeftDrive.setVelocity(backLeftPower*2600);
  6.         backRightDrive.setVelocity(backRightPower*2600);
  7.     }
  8.  
  9.         frontLeftDrive.setVelocityPIDFCoefficients(1.20, 0.126, 0, 12.6);
  10.         frontRightDrive.setVelocityPIDFCoefficients(1.20, 0.126, 0, 12.6);
  11.         backLeftDrive.setVelocityPIDFCoefficients(1.20, 0.126, 0, 12.6);
  12.         backRightDrive.setVelocityPIDFCoefficients(1.20, 0.126, 0, 12.6);
  13.  
  14.     /**
  15.      * Sets drivetrain zero power behavior to brake
  16.      */
  17.     public void setBrake ()
  18.     {
  19.         robot.frontLeftDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);
  20.         robot.frontRightDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);
  21.         robot.backLeftDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);
  22.         robot.backRightDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);
  23.     }
  24.  
  25.     /**
  26.      * Sets drivetrain zero power behavior to float
  27.      */
  28.     public void setFloat ()
  29.     {
  30.         robot.frontLeftDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.FLOAT);
  31.         robot.frontRightDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.FLOAT);
  32.         robot.backLeftDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.FLOAT);
  33.         robot.backRightDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.FLOAT);
  34.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement