Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Robot2019/src/main/java/frc/robot/commands/Climb.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public class Climb extends Command {
private final double climbDown = -1;
private final double retract = -1;
private final double overrideThreshold = 0.1; // TODO: Set this to reasonable/tested value;
private final double retractGoal = 0; // TODO: Set this to reasonable/tested value;
private final double offGroundHeight = 10; // TODO: Set this to reasonable/tested value;
private final double retractGoal = 15; // This only needs to be off the ground. Climb is 19 inches.
private final double offGroundHeight = 10;

public Climb(Climber climber, Drivetrain dt, Joystick joy) {
// Use requires() here to declare subsystem dependencies
Expand Down
5 changes: 3 additions & 2 deletions Robot2019/src/main/java/frc/robot/commands/KeepClimber.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
public class KeepClimber extends Command {
private Climber climber;

private final double retractSpeed = -1; // TODO: Confirm number
private final double retractSpeed = -1;

public KeepClimber(Climber climber) {
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
Expand All @@ -29,7 +30,7 @@ protected void initialize() {
// Called repeatedly when this Command is scheduled to run
@Override
protected void execute() {
if(climber.slipping()) {
if (climber.slipping()) {
climber.runClimber(retractSpeed);
} else {
climber.stopClimber();
Expand Down
8 changes: 4 additions & 4 deletions Robot2019/src/main/java/frc/robot/subsystems/Climber.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public class Climber extends Subsystem {
private DoubleSolenoid pistons;

final private double minTilt = 0; // In degrees // TODO: Update wtih actual number
final private double minDist = 13; // In inches // TODO: Update with actual number
final private double minDist = 20; // In inches // TODO: Update with actual number
final private double maxTilt = 30; // In degrees // TODO: Update with actual number
final private double maxDist = 15; // In inches // TODO: Update with actual number
final private double maxDist = 24; // In inches // TODO: Update with actual number
final private double slipTolerance = 0.5; // In inches // TODO: Update with actual number;

public Climber(VictorSP motor, Encoder enc, AHRS ahrs, DoubleSolenoid pistons) {
Expand All @@ -33,7 +33,7 @@ public Climber(VictorSP motor, Encoder enc, AHRS ahrs, DoubleSolenoid pistons) {
this.ahrs = ahrs;
this.pistons = pistons;

double pulseFraction = 1.0/256;
double pulseFraction = 1.0 / 256;
double pitchDiameter = 1.790; // https://www.vexrobotics.com/35-sprockets.html#Drawing
enc.setDistancePerPulse(pulseFraction * Math.PI * pitchDiameter);
enc.reset();
Expand All @@ -51,7 +51,7 @@ public void stopClimber() {
motor.stopMotor();
}

//We are erring on the side of changing directions too much
// We are erring on the side of changing directions too much
public boolean needToClimb() {
double angle = Math.atan2(ahrs.getRawAccelZ(), ahrs.getRawAccelX());
angle *= 180 / Math.PI;
Expand Down