initialize variables and calculate error
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / driving / SlaveWheel.java
1 package org.usfirst.frc.team3501.robot.commands.driving;
2
3 import org.usfirst.frc.team3501.robot.Robot;
4
5 public class SlaveWheel {
6
7 // Left motor and wheel(s) are Master, right motor and wheel(s) are slave
8
9 double masterVal = Robot.getDriveTrain().getLeftSpeed();
10 double slaveVal = Robot.getDriveTrain().getRightSpeed();
11
12 double distL, distR;
13
14 double error = 0;
15 double k = 0.1;
16
17 public double calculateError() {
18 distL = Robot.getDriveTrain().getLeftEncoderDistance();
19 distR = Robot.getDriveTrain().getRightEncoderDistance();
20 error = distL - distR;
21 return error;
22 }
23
24 // repeat every 20 milliseconds?
25
26 }