-
Notifications
You must be signed in to change notification settings - Fork 0
hood angles will change depending on each prep #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
src/main/java/frc/robot/commands/states/PrepOpponentToAlliance.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
52 changes: 52 additions & 0 deletions
52
src/main/java/frc/robot/commands/states/preps/BasePrep.java
This file contains hidden or 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,52 @@ | ||
| // Copyright (c) FIRST and other WPILib contributors. | ||
| // Open Source Software; you can modify and/or share it under the terms of | ||
| // the WPILib BSD license file in the root directory of this project. | ||
|
|
||
| package frc.robot.commands.states.preps; | ||
|
|
||
| import edu.wpi.first.units.measure.*; | ||
| import edu.wpi.first.wpilibj2.command.Command; | ||
| import frc.robot.Robot; | ||
| import frc.robot.RobotContainer; | ||
| import frc.robot.subsystems.StateMachine.RobotState; | ||
|
|
||
| /* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ | ||
| public class BasePrep extends Command { | ||
| AngularVelocity globalFlyWheelSpeed; | ||
| Angle globalHoodAngle; | ||
| RobotState globalState; | ||
|
|
||
| /** Creates a new BasePrep. */ | ||
| public BasePrep(AngularVelocity flyWheelSpeed, Angle hoodAngle, RobotState state) { | ||
| addRequirements(RobotContainer.stateMachineInstance); | ||
| globalFlyWheelSpeed = flyWheelSpeed; | ||
| globalHoodAngle = hoodAngle; | ||
| globalState = state; | ||
|
TaylerUva marked this conversation as resolved.
|
||
|
|
||
| // Use addRequirements() here to declare subsystem dependencies. | ||
| } | ||
|
|
||
| // Called when the command is initially scheduled. | ||
| @Override | ||
| public void initialize() { | ||
| RobotContainer.rotorsInstance.setFlyWheelSpeeds(globalFlyWheelSpeed); | ||
| RobotContainer.motionInstance.setHoodPivotAngle(globalHoodAngle); | ||
| RobotContainer.stateMachineInstance.setRobotState(globalState); | ||
| } | ||
|
|
||
| // Called every time the scheduler runs while the command is scheduled. | ||
| @Override | ||
| public void execute() { | ||
| } | ||
|
|
||
| // Called once the command ends or is interrupted. | ||
| @Override | ||
| public void end(boolean interrupted) { | ||
| } | ||
|
|
||
| // Returns true when the command should end. | ||
| @Override | ||
| public boolean isFinished() { | ||
| return false; | ||
| } | ||
| } | ||
This file contains hidden or 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
20 changes: 20 additions & 0 deletions
20
src/main/java/frc/robot/commands/states/preps/PrepCorner.java
This file contains hidden or 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,20 @@ | ||
| // Copyright (c) FIRST and other WPILib contributors. | ||
| // Open Source Software; you can modify and/or share it under the terms of | ||
| // the WPILib BSD license file in the root directory of this project. | ||
|
|
||
| package frc.robot.commands.states.preps; | ||
|
|
||
| import edu.wpi.first.wpilibj2.command.Command; | ||
| import frc.robot.constants.ConstMotion; | ||
| import frc.robot.constants.ConstRotors; | ||
| import frc.robot.subsystems.StateMachine.RobotState; | ||
|
|
||
| public class PrepCorner extends BasePrep { | ||
| /** Creates a new PrepNonOutpost. */ | ||
| public PrepCorner() { | ||
|
TaylerUva marked this conversation as resolved.
|
||
| super(ConstRotors.FLYWHEEL_CORNER_SPEED, ConstMotion.HOOD_CORNER_ANGLE, RobotState.PREP_CORNER); | ||
|
|
||
| // Use addRequirements() here to declare subsystem dependencies. | ||
| } | ||
|
|
||
| } | ||
22 changes: 22 additions & 0 deletions
22
src/main/java/frc/robot/commands/states/preps/PrepHub.java
This file contains hidden or 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,22 @@ | ||
| // Copyright (c) FIRST and other WPILib contributors. | ||
| // Open Source Software; you can modify and/or share it under the terms of | ||
| // the WPILib BSD license file in the root directory of this project. | ||
|
|
||
| package frc.robot.commands.states.preps; | ||
|
|
||
| import edu.wpi.first.wpilibj2.command.Command; | ||
| import frc.robot.RobotContainer; | ||
| import frc.robot.constants.ConstMotion; | ||
| import frc.robot.constants.ConstRotors; | ||
| import frc.robot.subsystems.StateMachine.RobotState; | ||
|
|
||
| public class PrepHub extends BasePrep { | ||
| /** Creates a new PrepDepot. */ | ||
| public PrepHub() { | ||
|
|
||
| super(ConstRotors.FLYWHEEL_HUB_SPEED, ConstMotion.HOOD_HUB_ANGLE, RobotState.PREP_HUB); | ||
|
|
||
| // setState | ||
| // Use addRequirements() here to declare subsystem dependencies. | ||
| } | ||
|
TaylerUva marked this conversation as resolved.
|
||
| } | ||
This file contains hidden or 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
22 changes: 22 additions & 0 deletions
22
src/main/java/frc/robot/commands/states/preps/PrepOpponentToAlliance.java
This file contains hidden or 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,22 @@ | ||
| // Copyright (c) FIRST and other WPILib contributors. | ||
| // Open Source Software; you can modify and/or share it under the terms of | ||
| // the WPILib BSD license file in the root directory of this project. | ||
|
|
||
| package frc.robot.commands.states.preps; | ||
|
|
||
| import frc.robot.constants.ConstMotion; | ||
| import frc.robot.constants.ConstRotors; | ||
| import frc.robot.subsystems.StateMachine.RobotState; | ||
|
|
||
| /* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ | ||
| public class PrepOpponentToAlliance extends BasePrep { | ||
| /** Creates a new PrepOpponentToAlliance. */ | ||
| public PrepOpponentToAlliance() { | ||
|
|
||
| super(ConstRotors.FLYWHEEL_OPPONENT_TO_ALLIANCE_SPEED, ConstMotion.HOOD_OPPENENT_TO_ALLIANCE_ANGLE, | ||
| RobotState.PREP_OPPONENT_TO_ALLIANCE); | ||
|
|
||
| // Use addRequirements() here to declare subsystem dependencies. | ||
| } | ||
|
|
||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.