Permalink
Browse files

robot going forward forever

  • Loading branch information...
gatorbotics committed Oct 4, 2018
1 parent bc7a746 commit b3e23d84a950b62067a612f3be6da7468a871544
Showing with 62 additions and 42 deletions.
  1. +0 −1 bin/.gitignore
  2. BIN bin/org/usfirst/frc/team1700/robot/Robot.class
  3. BIN bin/org/usfirst/frc/team1700/robot/commands/AutoCGs/AutoForward.class
  4. BIN bin/org/usfirst/frc/team1700/robot/commands/AutoCGs/CenterScaleAuto.class
  5. BIN bin/org/usfirst/frc/team1700/robot/commands/AutoCGs/CenterSwitchAuto.class
  6. BIN bin/org/usfirst/frc/team1700/robot/commands/AutoCGs/LeftScaleAuto.class
  7. BIN bin/org/usfirst/frc/team1700/robot/commands/AutoCGs/LeftSwitchAuto.class
  8. BIN bin/org/usfirst/frc/team1700/robot/commands/AutoCGs/RightScaleAuto.class
  9. BIN bin/org/usfirst/frc/team1700/robot/commands/AutoCGs/RightSwitchAuto.class
  10. BIN bin/org/usfirst/frc/team1700/robot/commands/AutoCGs/testAutoCG.class
  11. BIN bin/org/usfirst/frc/team1700/robot/commands/Drivetrain/DriveAutoCommand.class
  12. BIN bin/org/usfirst/frc/team1700/robot/commands/Drivetrain/DriveForwardTimeOutCommand.class
  13. BIN bin/org/usfirst/frc/team1700/robot/commands/Drivetrain/SimpleDriveForwardCommand.class
  14. BIN bin/org/usfirst/frc/team1700/robot/commands/Elevator/ElevatorForTimeCommand.class
  15. BIN bin/org/usfirst/frc/team1700/robot/commands/Elevator/ElevatorMoveCommand.class
  16. BIN bin/org/usfirst/frc/team1700/robot/commands/Elevator/ElevatorResetCommand.class
  17. BIN bin/org/usfirst/frc/team1700/robot/commands/Elevator/ElevatorToInchesCommand.class
  18. BIN bin/org/usfirst/frc/team1700/robot/commands/Intake/AutoReleaseIntakeCommand.class
  19. BIN bin/org/usfirst/frc/team1700/robot/commands/Intake/GrabIntakeCommand.class
  20. BIN bin/org/usfirst/frc/team1700/robot/commands/Intake/IntakeInCommand.class
  21. BIN bin/org/usfirst/frc/team1700/robot/commands/Intake/StopIntakeCommand.class
  22. BIN bin/org/usfirst/frc/team1700/robot/subsystems/DriveSubsystem$AngleType.class
  23. BIN build/org/usfirst/frc/team1700/robot/Robot.class
  24. BIN build/org/usfirst/frc/team1700/robot/commands/AutoCGs/LeftSwitchAuto.class
  25. BIN build/org/usfirst/frc/team1700/robot/commands/AutoCGs/RightSwitchAuto.class
  26. BIN build/org/usfirst/frc/team1700/robot/commands/Drivetrain/DriveAutoCommand.class
  27. BIN build/org/usfirst/frc/team1700/robot/commands/Elevator/ElevatorMoveCommand.class
  28. BIN build/org/usfirst/frc/team1700/robot/commands/Elevator/ElevatorToInchesCommand.class
  29. BIN dist/FRCUserProgram.jar
  30. +1 −1 src/org/usfirst/frc/team1700/robot/Robot.java
  31. +20 −18 src/org/usfirst/frc/team1700/robot/commands/AutoCGs/LeftSwitchAuto.java
  32. +20 −18 src/org/usfirst/frc/team1700/robot/commands/AutoCGs/RightSwitchAuto.java
  33. +1 −1 src/org/usfirst/frc/team1700/robot/commands/Drivetrain/DriveAutoCommand.java
  34. +19 −2 src/org/usfirst/frc/team1700/robot/commands/Elevator/ElevatorMoveCommand.java
  35. +1 −1 src/org/usfirst/frc/team1700/robot/commands/Elevator/ElevatorToInchesCommand.java

This file was deleted.

Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN +550 Bytes (100%) dist/FRCUserProgram.jar
Binary file not shown.
@@ -102,7 +102,7 @@ public void autonomousInit() {
autonomousCommand = new LeftSwitchAuto();
// chooser.getSelected();
if (autonomousCommand.getName() == "testAutoCG" && DriverStation.getInstance().isFMSAttached()) {
autonomousCommand = new CenterSwitchAuto();
autonomousCommand = new LeftSwitchAuto();
}
DriverStation.getInstance().reportWarning(autonomousCommand.getName(), false);
if (autonomousCommand != null) {
@@ -42,26 +42,28 @@ public LeftSwitchAuto() {
}
DriverStation.getInstance().reportWarning("at drivetodistance logic", false);
if(gameData.charAt(0) == 'R') {
if(gameData.charAt(1) == 'L') {
DriverStation.getInstance().reportWarning("Switch on right, scale on left; scale", false);
addSequential(new DriveToDistanceCommand(Robot.driveSubsystem.sameScaleDist, 0));

addParallel(new ElevatorToInchesCommand(Robot.elevatorSubsystem.scaleHeight));
addSequential(new DriveToAngleCommand(60,0));
addSequential(new DriveToDistanceCommand(Robot.driveSubsystem.finalDistToScale, 0)); //distance given in inches

addSequential(new FoldIntakeCommand(false));

start = Instant.now();
while (Duration.between(start, Instant.now()).toMillis() < Robot.driveSubsystem.waitTime) {
}

addSequential(new GrabIntakeCommand(true));
addSequential(new ReleaseIntakeCommand(-0.4));
DriverStation.getInstance().reportWarning("finished left scale auto", false);
}
else {
DriverStation.getInstance().reportWarning("Switch on right: cross line", false);
addSequential(new DriveToDistanceCommand(Robot.driveSubsystem.distToAutoLine, 0)); //distance given in inches
// if(gameData.charAt(1) == 'L') {
// DriverStation.getInstance().reportWarning("Switch on right, scale on left; scale", false);
// addSequential(new DriveToDistanceCommand(Robot.driveSubsystem.sameScaleDist, 0));
//
// addParallel(new ElevatorToInchesCommand(Robot.elevatorSubsystem.scaleHeight));
// addSequential(new DriveToAngleCommand(60,0));
// addSequential(new DriveToDistanceCommand(Robot.driveSubsystem.finalDistToScale, 0)); //distance given in inches
//
// addSequential(new FoldIntakeCommand(false));
//
// start = Instant.now();
// while (Duration.between(start, Instant.now()).toMillis() < Robot.driveSubsystem.waitTime) {
// }
//
// addSequential(new GrabIntakeCommand(true));
// addSequential(new ReleaseIntakeCommand(-0.4));
// DriverStation.getInstance().reportWarning("finished left scale auto", false);
// }
}
// else if(gameData.charAt(1) == 'R') {
// DriverStation.getInstance().reportWarning("Switch on right, scale on right; cross scale", false);
// addSequential(new DriveToDistanceCommand(Robot.driveSubsystem.crossScaleDist1, 0));
@@ -42,26 +42,28 @@ public RightSwitchAuto() {
}
DriverStation.getInstance().reportWarning("at drivetodistance logic", false);
if(gameData.charAt(0) == 'L') {
if(gameData.charAt(1) == 'R') {
DriverStation.getInstance().reportWarning("Switch on left, scale on right; scale", false);
addSequential(new DriveToDistanceCommand(Robot.driveSubsystem.sameScaleDist, 0));

addParallel(new ElevatorToInchesCommand(Robot.elevatorSubsystem.scaleHeight));
addSequential(new DriveToAngleCommand(-45,0));
addSequential(new DriveToDistanceCommand(Robot.driveSubsystem.finalDistToScale, 0)); //distance given in inches

addSequential(new FoldIntakeCommand(false));

start = Instant.now();
while (Duration.between(start, Instant.now()).toMillis() < Robot.driveSubsystem.waitTime) {
}

addSequential(new GrabIntakeCommand(true));
addSequential(new ReleaseIntakeCommand(-0.6));
DriverStation.getInstance().reportWarning("finished right scale auto", false);
}
else {
addSequential(new DriveToDistanceCommand(Robot.driveSubsystem.distToAutoLine, 0)); //distance given in inches
DriverStation.getInstance().reportWarning("Switch on left; cross line", false);
// if(gameData.charAt(1) == 'R') {
// DriverStation.getInstance().reportWarning("Switch on left, scale on right; scale", false);
// addSequential(new DriveToDistanceCommand(Robot.driveSubsystem.sameScaleDist, 0));
//
// addParallel(new ElevatorToInchesCommand(Robot.elevatorSubsystem.scaleHeight));
// addSequential(new DriveToAngleCommand(-45,0));
// addSequential(new DriveToDistanceCommand(Robot.driveSubsystem.finalDistToScale, 0)); //distance given in inches
//
// addSequential(new FoldIntakeCommand(false));
//
// start = Instant.now();
// while (Duration.between(start, Instant.now()).toMillis() < Robot.driveSubsystem.waitTime) {
// }
//
// addSequential(new GrabIntakeCommand(true));
// addSequential(new ReleaseIntakeCommand(-0.6));
// DriverStation.getInstance().reportWarning("finished right scale auto", false);
// }
}
// else if(gameData.charAt(1) == 'L') {
// DriverStation.getInstance().reportWarning("Switch on left, scale on left; cross scale", false);
// addSequential(new DriveToDistanceCommand(Robot.driveSubsystem.crossScaleDist1, 0));
@@ -37,7 +37,7 @@
// CONSTANTS (change these)

private double turningAngleProportion = 0.01;
private double maxAngleSpeed = 0.7;
private double maxAngleSpeed = 0.4;
private double driveD = -0.005;
private double driveP = 0.006;
private double maxDistanceSpeed = 0.8;
@@ -25,12 +25,29 @@ protected void initialize() {

// Called repeatedly when this Command is scheduled to run
protected void execute() {
Robot.elevatorSubsystem.elevatorMove(-OI.coJoy.getRawAxis(1));
// if (Robot.elevatorSubsystem.touchingSwitch(true) || Robot.elevatorSubsystem.touchingSwitch(false)) {
// Robot.elevatorSubsystem.elevatorMove(0);
// DriverStation.getInstance().reportWarning("Elevator hit top or bottom!", false);
// } else {
Robot.elevatorSubsystem.elevatorMove(-OI.coJoy.getRawAxis(1));
DriverStation.getInstance().reportWarning(Integer.toString(Robot.elevatorSubsystem.getCurrentPos()), false);
// double currTicks = Robot.elevatorSubsystem.getCurrentPos();
// DriverStation.reportWarning("Elevator ticks: " + currTicks, false);
// if(OI.coJoy.getRawAxis(1) > 0) {
// if(currTicks < (Robot.elevatorSubsystem.switchHeight * Robot.elevatorSubsystem.inchesToTicks - 60)) {
// Robot.elevatorSubsystem.elevatorMove(-OI.coJoy.getRawAxis(1));
// }
// else if (currTicks < Robot.elevatorSubsystem.switchHeight * Robot.elevatorSubsystem.inchesToTicks){
// Robot.elevatorSubsystem.elevatorMove(-0.5*OI.coJoy.getRawAxis(1));
// }
// else {
// Robot.elevatorSubsystem.elevatorMove(0);
// }
// }
// else {
// Robot.elevatorSubsystem.elevatorMove(-OI.coJoy.getRawAxis(1));
// }
//
// DriverStation.getInstance().reportWarning(Integer.toString(Robot.elevatorSubsystem.getCurrentPos()), false);
// DriverStation.getInstance().reportWarning(Double.toString(-OI.coJoy.getRawAxis(1)), false);
//1 = up, 0 = stopped, -1 = down
}
@@ -15,7 +15,7 @@
int deadband = 5; //change later
int ticks;
double maxSpeed = 0.88;
double P = 0.009; // not tuned
double P = 0.007; // not tuned
double D = 0.000; // not tuned
double tickDiff;
double calcVel;

0 comments on commit b3e23d8

Please sign in to comment.