Skip to content

Commit

Permalink
Add potentiometer values
Browse files Browse the repository at this point in the history
  • Loading branch information
kylecorry31 authored and NicholasBottone committed Mar 4, 2019
1 parent 60d479e commit bd403e3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/main/java/frc/robot/RobotMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ public class RobotMap {

public static final int hatchPotentiometer = 1;

public static final int POTENTIOMETER_RANGE_DEGREES = 3600;

}
5 changes: 3 additions & 2 deletions src/main/java/frc/robot/subsystems/CargoManipulator.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class CargoManipulator extends PIDSubsystem implements IPiston {
public static final double MAXIMUM_SPEED = 0.9;
public static final double INTAKE_SPEED = 0.7; // TODO: Test to find ideal intake speed value.
public static final double RESTING_ANGLE = 0;
public static final double MAXIMUM_ANGLE = 11; // TODO: This is inaccurate, and is probably greater than 11 degrees in reality

public double shootingSpeed = DEFAULT_SPEED;

Expand Down Expand Up @@ -57,7 +58,7 @@ public CargoManipulator() {
cargoPiston = new Piston(new FRCSolenoid(0, RobotMap.cargoPiston));

cargoLimitSwitch = new LimitSwitch(RobotMap.cargoLimitSwitch);
cargoPotentiometer = new AnalogPotentiometer(RobotMap.cargoPotentiometer);
cargoPotentiometer = new AnalogPotentiometer(RobotMap.cargoPotentiometer, RobotMap.POTENTIOMETER_RANGE_DEGREES, 990); // TODO: the resting angle is somewhere around 990 degrees, but this estimate can be improved in testing

cargoSpeedControllerWrist = new GTalonSRX(RobotMap.cargoWristMotor);
cargoSpeedControllerWrist.setInverted(false);
Expand All @@ -73,7 +74,7 @@ public CargoManipulator() {
*/
@Override
public void initDefaultCommand() {
// setDefaultCommand(new ResetCargoManipulator()); TODO
// setDefaultCommand(new ResetCargoManipulator()); TODO enable this during testing
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/frc/robot/subsystems/HatchManipulator.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class HatchManipulator extends PIDSubsystem implements IPiston {

public static final double DEFAULT_SPEED = 0.1;
public static final double TOP_ANGLE = 0;
public static final double BOTTOM_ANGLE = 90; // TODO: Find this
public static final double BOTTOM_ANGLE = 112; // TODO: The robot was on the tote for this measurement, we need to test it on the floor though to get an accurate measurement
public static final double TOLERANCE = 10;

private IPiston hatchPiston;
Expand All @@ -38,7 +38,7 @@ public HatchManipulator() {
hatchSpeedController.setInverted(false);
hatchSpeedController.useBrakeMode();

hatchPotentiometer = new AnalogPotentiometer(RobotMap.hatchPotentiometer, 360*10, 0);
hatchPotentiometer = new AnalogPotentiometer(RobotMap.hatchPotentiometer, RobotMap.POTENTIOMETER_RANGE_DEGREES, 1562); // TODO: the resting angle is somewhere around 1562 degrees, but this estimate can be improved in testing

}

Expand All @@ -55,7 +55,7 @@ public HatchManipulator(IPiston piston, ITalonSRX talon, Potentiometer potentiom
@Override
public void initDefaultCommand() {
// Set the default command for a subsystem here.
// setDefaultCommand(new ResetHatchManipulator()); TODO
// setDefaultCommand(new ResetHatchManipulator()); TODO enable this when testing
}

@Override
Expand Down

0 comments on commit bd403e3

Please sign in to comment.