From f6cd6accecd696d0b7b4ceb34d7ffeca82ac4b2e Mon Sep 17 00:00:00 2001 From: mayabartels Date: Mon, 28 Jan 2019 16:28:12 -0800 Subject: [PATCH] Changed angle stuff from wrist to arm --- .../main/java/org/usfirst/frc4388/robot/Robot.java | 3 ++- .../org/usfirst/frc4388/robot/subsystems/Arm.java | 11 +++++++++++ .../org/usfirst/frc4388/robot/subsystems/Wrist.java | 11 ----------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/2019robot/src/main/java/org/usfirst/frc4388/robot/Robot.java b/2019robot/src/main/java/org/usfirst/frc4388/robot/Robot.java index b4543fa..de0d898 100644 --- a/2019robot/src/main/java/org/usfirst/frc4388/robot/Robot.java +++ b/2019robot/src/main/java/org/usfirst/frc4388/robot/Robot.java @@ -71,7 +71,8 @@ public class Robot extends IterativeRobot operationModeChooser.addObject("Competition", OperationMode.COMPETITION); SmartDashboard.putData("Operation Mode", operationModeChooser); - wrist.setInitAngle(); + //Initializing the angle of the arm to be + arm.setInitAngle(); //ledLights.setAllLightsOn(false); } diff --git a/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Arm.java b/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Arm.java index 7e8d8e7..29fc99c 100644 --- a/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Arm.java +++ b/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Arm.java @@ -28,6 +28,8 @@ public class Arm extends Subsystem implements Loop // 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 double ARM_ANGLE_DEGREES = 0; + // Defined speeds 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 public void initDefaultCommand() { } diff --git a/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Wrist.java b/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Wrist.java index 33e2628..ffc431e 100644 --- a/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Wrist.java +++ b/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Wrist.java @@ -42,8 +42,6 @@ public class Wrist extends Subsystem //Encoder ticks to inches for encoders public static final double ENCODER_TICKS_TO_INCHES = Constants.kArmEncoderTicksPerDegree; public static final double ENCODER_TICKS_TO_DEGREES = Constants.kWristEncoderTicksPerDegree * Math.PI; - - public double WRIST_ANGLE_DEGREES = 0; // PID controller and params 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 private synchronized void setWristControlMode(WristControlMode controlMode) {