Changed angle stuff from wrist to arm

This commit is contained in:
mayabartels
2019-01-28 16:28:12 -08:00
parent 0fc322ec56
commit f6cd6accec
3 changed files with 13 additions and 12 deletions
@@ -71,7 +71,8 @@ public class Robot extends IterativeRobot
operationModeChooser.addObject("Competition", OperationMode.COMPETITION); operationModeChooser.addObject("Competition", OperationMode.COMPETITION);
SmartDashboard.putData("Operation Mode", operationModeChooser); SmartDashboard.putData("Operation Mode", operationModeChooser);
wrist.setInitAngle(); //Initializing the angle of the arm to be
arm.setInitAngle();
//ledLights.setAllLightsOn(false); //ledLights.setAllLightsOn(false);
} }
@@ -28,6 +28,8 @@ public class Arm extends Subsystem implements Loop
// One revolution of the 1-3 GEAR RATION ON THE ARM * 4096 ticks // One revolution of the 1-3 GEAR RATION ON THE ARM * 4096 ticks
public static final double ENCODER_TICKS_TO_DEGREES = (36.0 / 12.0) * (36.0 / 24.0) * (34.0 / 24.0) * 4096.0 / (1.88 * Math.PI); public static final double ENCODER_TICKS_TO_DEGREES = (36.0 / 12.0) * (36.0 / 24.0) * (34.0 / 24.0) * 4096.0 / (1.88 * Math.PI);
public double ARM_ANGLE_DEGREES = 0;
// Defined speeds // Defined speeds
public static final double JOYSTICK_INCHES_PER_MS_HI = 0.75; public static final double JOYSTICK_INCHES_PER_MS_HI = 0.75;
@@ -85,6 +87,15 @@ public class Arm extends Subsystem implements Loop
} }
} }
//Set the degree to negative angle after initializing
public void setInitAngle()
{
double armAngleToHoriz = 70;
double initAngle = ENCODER_TICKS_TO_DEGREES - armAngleToHoriz;
ARM_ANGLE_DEGREES = initAngle;
}
@Override @Override
public void initDefaultCommand() { public void initDefaultCommand() {
} }
@@ -42,8 +42,6 @@ public class Wrist extends Subsystem
//Encoder ticks to inches for encoders //Encoder ticks to inches for encoders
public static final double ENCODER_TICKS_TO_INCHES = Constants.kArmEncoderTicksPerDegree; public static final double ENCODER_TICKS_TO_INCHES = Constants.kArmEncoderTicksPerDegree;
public static final double ENCODER_TICKS_TO_DEGREES = Constants.kWristEncoderTicksPerDegree * Math.PI; public static final double ENCODER_TICKS_TO_DEGREES = Constants.kWristEncoderTicksPerDegree * Math.PI;
public double WRIST_ANGLE_DEGREES = 0;
// PID controller and params // PID controller and params
private MPTalonPIDController mpController; private MPTalonPIDController mpController;
@@ -91,15 +89,6 @@ public class Wrist extends Subsystem
} }
} }
//Set the degree to negative angle after initializing
public void setInitAngle()
{
double armAngleToHoriz = 70;
double initAngle = ENCODER_TICKS_TO_DEGREES - armAngleToHoriz;
WRIST_ANGLE_DEGREES = initAngle;
}
//Method for setting the control mode for the wrist //Method for setting the control mode for the wrist
private synchronized void setWristControlMode(WristControlMode controlMode) private synchronized void setWristControlMode(WristControlMode controlMode)
{ {