public class Climber
extends Subsystem
Modifier and Type | Field and Description |
---|---|
static double |
CLIMBER_TICKS_PER_ROTATION |
static double |
DISTANCE_BETWEEN_FRONT_AND_BACK_PISTONS_IN_INCHES |
static double |
GEAR_RATIO |
static double |
MAXIMUM_PISTON_POWER |
static double |
MINIMUM_PISTON_POWER |
static int |
PISTON_ENCODER_FLAT |
static int |
PISTON_ENCODER_LEVEL_THREE |
static int |
PISTON_ENCODER_LEVEL_TWO |
static double |
WINCH_DIAMETER |
Constructor and Description |
---|
Climber(MustangSensors sensors) |
Modifier and Type | Method and Description |
---|---|
static double |
convertPistonTicksToInches(int ticks) |
void |
drivePistons(double frontPower,
double backPower)
Drives the pistons down with percent power
|
void |
enableClimberPIDControllers(int setPoint)
Enables the PIDControllers to get them running
|
boolean |
getBackControllerOnTarget()
Returns true if the back controller is on target and false if not
|
boolean |
getBackPistonsRetracted()
Returns whether or not the command for retracting the back pistons has been called and finished
|
boolean |
getBackPistonsRetractionInProgress()
Returns whether or not the command for retracting the back pistons has been called and is in progress
|
double |
getBackTalonPositionInInches()
Returns the position of the back pistons in inches
|
int |
getBackTalonPositionInTicks()
Returns the position of the back pistons in ticks
|
boolean |
getFrontControllerOnTarget()
Returns true if the front controller is on target and false if not
|
boolean |
getFrontPistonsRetracted()
Returns whether or not the command for retracting the front pistons has been called and finished
|
boolean |
getFrontPistonsRetractionInProgress()
Returns whether or not the command for retracting the front pistons has been called and is in progress
|
double |
getFrontTalonPositionInInches()
Returns the position of the front pistons in inches
|
int |
getFrontTalonPositionInTicks()
Returns the position of the front pistons in ticks
|
double |
getPitchFromEncoders()
Returns pitch calculated from the difference in the front and back piston encoders.
|
void |
handleTilt(boolean goingUp,
double tiltTolerance,
double tiltAdjustment)
Method to set output ranges of piston controllers in response to an input of tilt adjustment.
|
void |
initDefaultCommand() |
void |
setBackPIDControllerSetpoint(int setpoint)
Sets a setpoint for the back PID controller
|
void |
setBackPistonOutputRange(double minValue,
double maxValue)
Sets the output range of the back pistons
|
void |
setBackPistonsRetracted(boolean setRetracted)
Sets whether or not the command for retracting the back pistons has been called and finished
|
void |
setBackPistonsRetractionInProgress(boolean setRetractionInProgress)
Sets whether or not the command for retracting the back pistons has been called and is in progress
|
void |
setFrontPIDControllerSetpoint(int setpoint)
Sets a setpoint for the front PID controller
|
void |
setFrontPistonOutputRange(double minValue,
double maxValue)
Sets the output range of the front pistons
|
void |
setFrontPistonsRetracted(boolean setRetracted)
Sets whether or not the command for retracting the front pistons has been called and finished
|
void |
setFrontPistonsRetractionInProgress(boolean setRetractionInProgress)
Sets whether or not the command for retracting the front pistons has been called and is in progress
|
public static final int PISTON_ENCODER_FLAT
public static final int PISTON_ENCODER_LEVEL_TWO
public static final int PISTON_ENCODER_LEVEL_THREE
public static final double MINIMUM_PISTON_POWER
public static final double MAXIMUM_PISTON_POWER
public static final double WINCH_DIAMETER
public static final double GEAR_RATIO
public static final double CLIMBER_TICKS_PER_ROTATION
public static final double DISTANCE_BETWEEN_FRONT_AND_BACK_PISTONS_IN_INCHES
public Climber(MustangSensors sensors)
public void drivePistons(double frontPower, double backPower)
frontPower
- the desired percent power for the front motorsbackPower
- the desired percent power for the front motorspublic void setFrontPistonOutputRange(double minValue, double maxValue)
minValue
- the minimum output for the front PID controllermaxValue
- the maximum output for the front PID controllerpublic void setBackPistonOutputRange(double minValue, double maxValue)
minValue
- the minimum output for the back PID controllermaxValue
- the maximum output for the back PID controllerpublic void setFrontPIDControllerSetpoint(int setpoint)
setpoint
- the desired setpoint for the front PID controllerpublic void setBackPIDControllerSetpoint(int setpoint)
setpoint
- the desired setpoint for the back PID controllerpublic int getFrontTalonPositionInTicks()
public int getBackTalonPositionInTicks()
public double getFrontTalonPositionInInches()
public double getBackTalonPositionInInches()
public boolean getFrontPistonsRetracted()
public boolean getBackPistonsRetracted()
public void setFrontPistonsRetracted(boolean setRetracted)
setRetracted
- Whether or not the command for retracting the front pistons has been called and finishedpublic void setBackPistonsRetracted(boolean setRetracted)
setRetracted
- Whether or not the command for retracting the back pistons has been called and finishedpublic boolean getFrontPistonsRetractionInProgress()
public boolean getBackPistonsRetractionInProgress()
public void setFrontPistonsRetractionInProgress(boolean setRetractionInProgress)
setRetractionInProgress
- Whether or not the command for retracting the front pistons has been called and is in progresspublic void setBackPistonsRetractionInProgress(boolean setRetractionInProgress)
setRetractionInProgress
- Whether or not the command for retracting the back pistons has been called and is in progresspublic boolean getFrontControllerOnTarget()
public boolean getBackControllerOnTarget()
public double getPitchFromEncoders()
public static double convertPistonTicksToInches(int ticks)
public void enableClimberPIDControllers(int setPoint)
setPoint
- the desired end goal of the piston climbpublic void handleTilt(boolean goingUp, double tiltTolerance, double tiltAdjustment)
goingUp
- True if robot is climbing up and false if coming downtiltTolerance
- The tolerance past which the robot is considered too unbalanced in either directiontiltAdjustment
- The amount of adjustment desired for the robotpublic void initDefaultCommand()