Minor fixes. Added to wrist

Added function to get angle
This commit is contained in:
mayabartels
2019-01-22 16:47:17 -08:00
parent d9e861e7dc
commit fcd28bc782
2 changed files with 34 additions and 5 deletions
@@ -23,12 +23,13 @@ public class Constants {
public static double kDriveStraightBasicMaxSteerMagnitude = 0.8; // keep absolute value of steer parameter below this
public static double kDriveTurnBasicTankMotorOutput = 0.4;
public static double kDriveTurnBasicSingleMotorOutput = 0.15;
public static double kElevatorWheelDiameterInches = 1;
public static double kArmWheelDiameterInches = 1; //Changes depending on mechanical design
// Encoders
public static int kDriveEncoderTicksPerRev = 4096;
public static double kDriveEncoderTicksPerInch = (double)kDriveEncoderTicksPerRev / (kDriveWheelDiameterInches * Math.PI);
// Elevator
// Arm
public static int kArmEncoderTickesPerRev = 256;
public static double kArmInchesOfTravelPerRev = 3.75;
public static double kArmEncoderTicksPerInch = 126.36;
@@ -39,9 +39,7 @@ public class Wrist extends Subsystem
{
//PID wrist encoder and talon
wristRight = new CANTalonEncoder(RobotMap.WRIST_LEFT_MOTOR_CAN_ID, ENCODER_TICKS_TO_INCHES, FeedbackDevice.QuadEncoder);
wristLeft = new WPI_TalonSRX(RobotMap.WRITST_RIGHT_MOTOR_CAN_ID);
//wristLeft = new WPI_TalonSRX(RobotMap.WRITST_RIGHT_MOTOR_CAN_ID);
}
catch(Exception e)
{
@@ -49,8 +47,38 @@ public class Wrist extends Subsystem
}
}
public double armAngle(double encoderValue)
{
double angle = 0;
//Insert conversion from encoder value to angle of arm
return angle;
}
public void stationaryWrist()
{
double angle = armAngle(ENCODER_TICKS_TO_INCHES);
}
@Override
public void initDefaultCommand()
{
}
public void updateStatus(Robot.OperationMode operationMode)
{
if (operationMode == Robot.OperationMode.TEST)
{
try
{
}
catch (Exception e)
{
System.err.println("Wrist update status error");
}
}
}
}