mirror of
https://github.com/Team4388/2019-Hit-or-Miss.git
synced 2026-06-09 00:28:05 -06:00
Minor fixes. Added to wrist
Added function to get angle
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user