This repository was archived by the owner on Nov 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Piece selector fix #52
Open
oliverstivers
wants to merge
6
commits into
master
Choose a base branch
from
piece-selector-fix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6964a3a
i think i fixed everything
oliverstivers 2cc1130
i did not fix everything before
oliverstivers ccdf69a
ok i think i actually fixed everything this time
oliverstivers db681e7
pull request changes
oliverstivers 12e7dbf
log the gamePiece to dashboard
oliverstivers c9d2e52
fixed smart dashboard
oliverstivers 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 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
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
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
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
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
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
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 |
|---|---|---|
| @@ -1,28 +1,30 @@ | ||
| package frc.robot.commands.Presets; | ||
|
|
||
| import java.util.function.BooleanSupplier; | ||
| import java.util.function.DoubleSupplier; | ||
|
|
||
| import edu.wpi.first.math.MathUtil; | ||
| import edu.wpi.first.wpilibj2.command.InstantCommand; | ||
| import edu.wpi.first.wpilibj2.command.ParallelCommandGroup; | ||
| import edu.wpi.first.wpilibj2.command.RunCommand; | ||
| import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; | ||
| import frc.robot.commands.RotatorToPosition; | ||
| import frc.robot.commands.TelescopeToPosition; | ||
| import frc.robot.subsystems.CrocodileSubsystem; | ||
| import frc.robot.subsystems.RotatorSubsystem; | ||
| import frc.robot.subsystems.TelescopeSubsystem; | ||
| import frc.robot.subsystems.CrocodileSubsystem.GamePiece; | ||
| import frc.robot.subsystems.CrocodileSubsystem.WristPosition; | ||
| import frc.robot.subsystems.RotatorSubsystem.RotatorPosition; | ||
| import frc.robot.subsystems.TelescopeSubsystem.TelescopePosition; | ||
|
|
||
| public class HighPresetSequence extends SequentialCommandGroup { | ||
| private DoubleSupplier intake; | ||
| private double multiplier = 1; | ||
| public HighPresetSequence(TelescopeSubsystem telescope, RotatorSubsystem rotator, CrocodileSubsystem crocodile, DoubleSupplier intake) { | ||
| public HighPresetSequence(TelescopeSubsystem telescope, RotatorSubsystem rotator, CrocodileSubsystem crocodile, DoubleSupplier intake, BooleanSupplier gamePiece) { | ||
| this.intake = intake; | ||
| addRequirements(rotator,telescope,crocodile); | ||
|
|
||
| if(crocodile.getGamePiece() == GamePiece.CUBE){ | ||
| if(!gamePiece.getAsBoolean()){ | ||
| multiplier = -1; | ||
| } | ||
| addCommands( | ||
|
|
@@ -32,5 +34,6 @@ public HighPresetSequence(TelescopeSubsystem telescope, RotatorSubsystem rotator | |
| crocodile.setWristToPositionCommand(WristPosition.CONE_SCORE).withTimeout(2) | ||
|
|
||
| ); | ||
| deadlineWith(new RunCommand(() -> crocodile.setIntakeSpeed(MathUtil.clamp((0.25 + intake.getAsDouble()), -1, 1) * multiplier))); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whoa, this doesn't do anything. Pop quiz for why, and why it's not a compiler nor runtime error. It also seems unrelated to this PR.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why doesn't it do anything? Is it the run Command? |
||
| } | ||
| } | ||
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
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 |
|---|---|---|
|
|
@@ -3,18 +3,28 @@ | |
| import java.util.function.BooleanSupplier; | ||
|
|
||
| import edu.wpi.first.wpilibj2.command.InstantCommand; | ||
| import edu.wpi.first.wpilibj2.command.RunCommand; | ||
| import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; | ||
| import frc.robot.commands.AutoIntakeCommand; | ||
| import frc.robot.commands.RotatorToPosition; | ||
| import frc.robot.commands.TelescopeToPosition; | ||
| import frc.robot.subsystems.CrocodileSubsystem; | ||
| import frc.robot.subsystems.RotatorSubsystem; | ||
| import frc.robot.subsystems.TelescopeSubsystem; | ||
| import frc.robot.subsystems.CrocodileSubsystem.GamePiece; | ||
| import frc.robot.subsystems.CrocodileSubsystem.WristPosition; | ||
| import frc.robot.subsystems.TelescopeSubsystem.TelescopePosition; | ||
|
|
||
| public class StowPresetSequence extends SequentialCommandGroup { | ||
| public StowPresetSequence(TelescopeSubsystem telescope, RotatorSubsystem rotator, CrocodileSubsystem crocodile, BooleanSupplier gamePiece) { | ||
| addRequirements(telescope,rotator,crocodile); | ||
| double multiplier = gamePiece.getAsBoolean() == true ? 1 : -1; | ||
| addCommands( | ||
| new TelescopeToPosition(telescope, TelescopePosition.RETRACTED).withTimeout(2), | ||
| new RotatorToPosition(rotator, telescope, 90).withTimeout(2), | ||
| crocodile.setWristToPositionCommand(WristPosition.CONE_SCORE).withTimeout(2) | ||
| ); | ||
| deadlineWith(new RunCommand(() -> crocodile.setIntakeSpeed(0.25 * multiplier))); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, nop. |
||
| } | ||
| public StowPresetSequence(TelescopeSubsystem telescope, RotatorSubsystem rotator, CrocodileSubsystem crocodile) { | ||
| addRequirements(telescope,rotator,crocodile); | ||
| addCommands( | ||
|
|
||
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
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
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.