Skip to content

Commit

Permalink
2 Cube Auto/Set Elevator Heights
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniCIM committed Mar 22, 2018
1 parent 55589c1 commit 5accf92
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 32 deletions.
52 changes: 43 additions & 9 deletions src/main/java/com/frcteam1939/powerup2018/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,55 @@ public void autonomousInit() {
Thread.sleep(5);
} catch (InterruptedException ie) {}
gameData = DriverStation.getInstance().getGameSpecificMessage();

}

// DEFAULT
// if (gameData.length() > 0) {
// this.autonomousCommand = this.getAutonomousCommand(gameData);
// }

if (gameData.charAt(1) == 'L') {
this.autonomousCommand = new LeftWallToLeftScale();
} else if (gameData.charAt(0) == 'L') {
this.autonomousCommand = new LeftWallToLeftSwitch();
} else {
this.autonomousCommand = new CrossAutoLine();
}
// CENTER
// if (gameData.charAt(0) == 'L') {
// this.autonomousCommand = new CenterWallToLeftSwitch();
// } else if (gameData.charAt(0) == 'R') {
// this.autonomousCommand = new CenterWallToRightSwitch();
// }

// CHOOSE BETWEEN LEFT SIDE - PRIORITIZE SWITCH
// if (gameData.charAt(0) == 'L') {
// this.autonomousCommand = new LeftWallToLeftSwitch();
// } else if (gameData.charAt(1) == 'L') {
// this.autonomousCommand = new LeftWallToLeftScale();
// } else {
// this.autonomousCommand = new CrossAutoLine();
// }

// CHOOSE BETWEEN RIGHT SIDE - PRIORITIZE SWITCH
// if (gameData.charAt(0) == 'R') {
// this.autonomousCommand = new RightWallToRightSwitch();
// } else if (gameData.charAt(1) == 'R') {
// this.autonomousCommand = new RightWallToRightScale();
// } else {
// this.autonomousCommand = new CrossAutoLine();
// }

// CHOOSE BETWEEN LEFT SIDE - PRIORITIZE SCALE
// if (gameData.charAt(1) == 'L') {
// this.autonomousCommand = new LeftWallToLeftScale();
// } else if (gameData.charAt(0) == 'L') {
// this.autonomousCommand = new LeftWallToLeftSwitch();
// } else {
// this.autonomousCommand = new CrossAutoLine();
// }

// CHOOSE BETWEEN RIGHT SIDE - PRIORITIZE SCALE
// if (gameData.charAt(1) == 'R') {
// this.autonomousCommand = new RightWallToRightScale();
// } else if (gameData.charAt(0) == 'R') {
// this.autonomousCommand = new RightWallToRightSwitch();
// } else {
// this.autonomousCommand = new CrossAutoLine();
// }

SmartDashboard.putString("Autonomous Command", this.autonomousCommand.getName());

Expand Down Expand Up @@ -211,7 +246,6 @@ public void teleopPeriodic() {
@Override
public void testPeriodic() {
LiveWindow.run();
// this.vision.testPixy1();
}

public static double getPressure() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.frcteam1939.powerup2018.robot.commands.auton;

import com.frcteam1939.powerup2018.robot.commands.cubemanipulator.CubeManipulatorLower;
import com.frcteam1939.powerup2018.robot.commands.cubemanipulator.IntakeCube;
import com.frcteam1939.powerup2018.robot.commands.cubemanipulator.OutputCubeMiddle;
import com.frcteam1939.powerup2018.robot.commands.drivetrain.SetDrivetrainMotorsSpeed;
import com.frcteam1939.powerup2018.robot.commands.drivetrain.TurnToAngle;
Expand All @@ -22,5 +24,25 @@ public CenterWallToLeftSwitch() {
this.addSequential(new Wait(3.3));
this.addSequential(new SetDrivetrainMotorsSpeed(0));
this.addSequential(new OutputCubeMiddle());
this.addSequential(new SetDrivetrainMotorsSpeed(0.3));
this.addSequential(new Wait(0.5));
this.addSequential(new SetDrivetrainMotorsSpeed(0));
this.addSequential(new TurnToAngle(80));
this.addSequential(new CubeManipulatorLower());
this.addSequential(new SetDrivetrainMotorsSpeed(-0.3));
this.addSequential(new Wait(1));
this.addSequential(new SetDrivetrainMotorsSpeed(0));
this.addSequential(new IntakeCube());
this.addSequential(new SetDrivetrainMotorsSpeed(0.3));
this.addSequential(new Wait(1));
this.addSequential(new SetDrivetrainMotorsSpeed(0));
this.addSequential(new TurnToAngle(-80));
this.addSequential(new SetElevatorMotorSpeed(1.0));
this.addSequential(new Wait(1.25));
this.addSequential(new SetElevatorMotorSpeed(0));
this.addSequential(new SetDrivetrainMotorsSpeed(-0.3));
this.addSequential(new Wait(0.5));
this.addSequential(new SetDrivetrainMotorsSpeed(0));
this.addSequential(new OutputCubeMiddle());
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.frcteam1939.powerup2018.robot.commands.auton;

import com.frcteam1939.powerup2018.robot.commands.cubemanipulator.CubeManipulatorLower;
import com.frcteam1939.powerup2018.robot.commands.cubemanipulator.IntakeCube;
import com.frcteam1939.powerup2018.robot.commands.cubemanipulator.OutputCubeMiddle;
import com.frcteam1939.powerup2018.robot.commands.drivetrain.SetDrivetrainMotorsSpeed;
import com.frcteam1939.powerup2018.robot.commands.drivetrain.TurnToAngle;
Expand All @@ -22,5 +24,25 @@ public CenterWallToRightSwitch() {
this.addSequential(new Wait(3.2));
this.addSequential(new SetDrivetrainMotorsSpeed(0));
this.addSequential(new OutputCubeMiddle());
this.addSequential(new SetDrivetrainMotorsSpeed(0.3));
this.addSequential(new Wait(0.5));
this.addSequential(new SetDrivetrainMotorsSpeed(0));
this.addSequential(new TurnToAngle(-80));
this.addSequential(new CubeManipulatorLower());
this.addSequential(new SetDrivetrainMotorsSpeed(-0.3));
this.addSequential(new Wait(1));
this.addSequential(new SetDrivetrainMotorsSpeed(0));
this.addSequential(new IntakeCube());
this.addSequential(new SetDrivetrainMotorsSpeed(0.3));
this.addSequential(new Wait(1));
this.addSequential(new SetDrivetrainMotorsSpeed(0));
this.addSequential(new TurnToAngle(80));
this.addSequential(new SetElevatorMotorSpeed(1.0));
this.addSequential(new Wait(1.25));
this.addSequential(new SetElevatorMotorSpeed(0));
this.addSequential(new SetDrivetrainMotorsSpeed(-0.3));
this.addSequential(new Wait(0.5));
this.addSequential(new SetDrivetrainMotorsSpeed(0));
this.addSequential(new OutputCubeMiddle());
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.frcteam1939.powerup2018.robot.commands.cubemanipulator;

import com.frcteam1939.powerup2018.robot.Robot;
import com.frcteam1939.powerup2018.robot.subsystems.CubeManipulator;
import com.frcteam1939.powerup2018.util.Wait;

Expand All @@ -13,10 +12,8 @@ public IntakeCube() {
this.addSequential(new CubeManipulatorWheelsOut());
this.addSequential(new SetCubeManipulatorSpeed(CubeManipulator.IN_SPEED));
this.addSequential(new Wait(1));
if (Robot.cubeManipulator.haveCube()) {
this.addSequential(new CubeManipulatorWheelsIn());
this.addSequential(new SetCubeManipulatorSpeed(0));
this.addSequential(new CubeManipulatorMiddle());
}
this.addSequential(new CubeManipulatorWheelsIn());
this.addSequential(new SetCubeManipulatorSpeed(0));
this.addSequential(new CubeManipulatorMiddle());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public PigeonWrapper(int deviceNumber) {
super(deviceNumber);
}

public PigeonWrapper(TalonSRX talonSrx) {
super(talonSrx);
public PigeonWrapper(TalonSRX talonSRX) {
super(talonSRX);
}

@Override
Expand Down

0 comments on commit 5accf92

Please sign in to comment.