-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rename stopAll to stopAllDriveMotors * remove import * Start more OOP approach to codriver controls * implement OOP based codriver controls
- Loading branch information
Showing
11 changed files
with
133 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package frc.robot.RobotComponents; | ||
|
||
import frc.robot.Constants; | ||
import frc.robot.Robot; | ||
import frc.robot.auton.ExtendArms; | ||
import frc.robot.auton.RetractArms; | ||
|
||
public class Climber { | ||
|
||
private static void extendArms() { | ||
Robot.getTeleopActionRunner().addActionToRun(new ExtendArms()); | ||
Robot.getTeleopActionRunner().removeActionsOfType(RetractArms.class); | ||
} | ||
|
||
private static void retractArms() { | ||
Robot.getTeleopActionRunner().addActionToRun(new RetractArms()); | ||
Robot.getTeleopActionRunner().removeActionsOfType(ExtendArms.class); | ||
} | ||
|
||
public static void manualExtendArms() { | ||
Robot.motors.getLeftClimb().set(Constants.CLIMB_EXTENSION_SPEED); | ||
Robot.motors.getRightClimb().set(Constants.CLIMB_EXTENSION_SPEED); | ||
} | ||
|
||
public static void manualRetractArms() { | ||
Robot.motors.getLeftClimb().set(Constants.CLIMB_RETRACTION_SPEED); | ||
Robot.motors.getRightClimb().set(Constants.CLIMB_RETRACTION_SPEED); | ||
} | ||
|
||
public static void stopClimbMotors() { | ||
Robot.motors.getLeftClimb().stopMotor(); | ||
Robot.motors.getRightClimb().stopMotor(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package frc.robot.RobotComponents; | ||
|
||
import frc.robot.Robot; | ||
|
||
public class Intake { | ||
|
||
public static void startFloorIntake() { | ||
Robot.motors.getIntake().set(.5); | ||
} | ||
|
||
public static void stopFloorIntake() { | ||
Robot.motors.getIntake().stopMotor(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package frc.robot.RobotComponents; | ||
|
||
import frc.robot.Constants; | ||
import frc.robot.Robot; | ||
import frc.robot.auton.AutonShoot; | ||
import frc.robot.auton.AutonShooterFeed; | ||
|
||
public class Shooter { | ||
|
||
public static void startShooterMotors() { | ||
Robot.motors.getLeftFlywheel().setVelocity(Constants.SHOOTING_VELOCITY); | ||
Robot.motors.getRightFlywheel().setVelocity(Constants.SHOOTING_VELOCITY); | ||
} | ||
|
||
public static void stopShooterMotors() { | ||
Robot.motors.getLeftFlywheel().stopMotor(); | ||
Robot.motors.getRightFlywheel().stopMotor(); | ||
} | ||
|
||
public static void startFeedMotors() { | ||
Robot.getTeleopActionRunner().removeActionsOfType(AutonShooterFeed.class); | ||
Robot.getTeleopActionRunner().addActionToRun(new AutonShooterFeed()); | ||
} | ||
|
||
public static void autoShootIntoSpeaker() { | ||
Robot.getTeleopActionRunner().addActionToRun(new AutonShoot()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package frc.robot.auton; | ||
|
||
import edu.wpi.first.wpilibj.Timer; | ||
import frc.robot.Constants; | ||
import frc.robot.Robot; | ||
|
||
public class AutonShooterFeed extends AutonAction { | ||
|
||
private double revFinishedTime; | ||
|
||
@Override | ||
public boolean isDone() { | ||
return Timer.getFPGATimestamp() > revFinishedTime; | ||
} | ||
|
||
@Override | ||
public void initiate() { | ||
Robot.motors.getFeeder().set(0.75); | ||
revFinishedTime = Timer.getFPGATimestamp() + Constants.FEEDER_MOTOR_SHUTOFF_TIME; | ||
} | ||
|
||
@Override | ||
public void shutdown() { | ||
Robot.motors.getFeeder().stopMotor(); | ||
} | ||
} |