daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest Jul 11th, 2018 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     Notifier notifier = new Notifier (() -> {
  2.         double Loutput = left.calculate(Robot.mDriveTrain.getLeftDistanceRaw());
  3.         double Routput = right.calculate(-Robot.mDriveTrain.getRightDistanceRaw());
  4.         double gyro_heading = -Robot.mGyro.getYaw();    // Assuming the gyro is giving a value in degrees
  5.         double desired_heading = Pathfinder.r2d(left.getHeading());  // Should also be in degrees
  6.         angleDifference = Pathfinder.boundHalfDegrees(desired_heading - gyro_heading);
  7.         turn = 1.2 * (-1.0/80.0) * angleDifference;
  8.         SmartDashboard.putNumber("Desired Heading", desired_heading);
  9.         SmartDashboard.putNumber("gyro_heading", gyro_heading);
  10.         SmartDashboard.putNumber("Turn:", turn);
  11.         Robot.mDriveTrain.tankDrive(-(Loutput + turn), -(Routput - turn), false);
  12.         SmartDashboard.putNumber("Loutput", Loutput);
  13.         SmartDashboard.putNumber("Routput", Routput);
  14.         SmartDashboard.putBoolean("JaciFinished", false);
  15. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top