Skip to content

Commit

Permalink
Iterative Autonomous Framework. Line and side switches complete (unte…
Browse files Browse the repository at this point in the history
…sted)
  • Loading branch information
ccruise committed Oct 14, 2018
1 parent 75c5683 commit 2c7d6a4
Show file tree
Hide file tree
Showing 5 changed files with 388 additions and 70 deletions.
24 changes: 16 additions & 8 deletions src/main/java/org/usfirst/frc/team1700/robot/Robot.java
Expand Up @@ -27,13 +27,13 @@ public class Robot extends IterativeRobot {
public static AutonomousBase auto;

// Control variables
double leftIntakeSpeed = 0;
double rightIntakeSpeed = 0;
Boolean desiredGrabIntakeState = false;
Boolean desiredFoldIntakeState = true;
double leftSpeed = 0;
double rightSpeed = 0;
double elevatorSpeed = 0;
public static double leftIntakeSpeed = 0;
public static double rightIntakeSpeed = 0;
public static Boolean desiredGrabIntakeState = RobotMap.GRAB_INTAKE_CLOSE;
public static Boolean desiredFoldIntakeState = true;
public static double leftSpeed = 0;
public static double rightSpeed = 0;
public static double elevatorSpeed = 0;

// State variables
Boolean hasGameData = false;
Expand Down Expand Up @@ -65,7 +65,8 @@ public void disabledPeriodic() {
public void autonomousInit() {
// Choose auton mode based on starting location
Boolean preferSwitch = true;
auto = new AutonomousBase(AutonomousBase.StartLocation.LEFT, preferSwitch);

auto = new AutonomousBase(AutonomousBase.StartLocation.LEFT, preferSwitch, driveSubsystem, intakeSubsystem, elevatorSubsystem);
}

/**
Expand All @@ -74,6 +75,13 @@ public void autonomousInit() {
@Override
public void autonomousPeriodic() {
auto.periodic();

// EXECUTE (Autonomous responsible for setting all of these values)
driveSubsystem.driveTank(leftSpeed, rightSpeed);
elevatorSubsystem.elevatorMove(elevatorSpeed);
intakeSubsystem.fold(desiredFoldIntakeState);
intakeSubsystem.grab(desiredGrabIntakeState);
intakeSubsystem.runIntake(leftIntakeSpeed, rightIntakeSpeed);
}

@Override
Expand Down

0 comments on commit 2c7d6a4

Please sign in to comment.