generated from Galaxia5987/robot-template-2022
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Commit all, explain later #103
Open
Se-gol
wants to merge
26
commits into
district-4
Choose a base branch
from
suppliers-and-caching
base: district-4
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 6 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
a6f4e4a
Commit all, explain later
Se-gol 22011a3
Better LEDs, revert if it creates problems
Se-gol 4707714
Add constants for tolerances
Se-gol 5661036
Delete some unused code
Se-gol ba19905
Quick fix to LEDs
Se-gol 47b0ddb
Reformat code
vichik123 e159e83
Update zero positions
Se-gol 78e3c9c
Add paths
GaiaZano05 6ad7776
Add auto path
GaiaZano05 ad97c3c
Add warmup function
GaiaZano05 c2acd5a
Change name
GaiaZano05 060df3c
Change path
GaiaZano05 d0ee300
add fade and (5,6) ball
AlonSchwierz 3303309
Change path
GaiaZano05 37c06f2
Change path
GaiaZano05 3fae4ee
Change path
GaiaZano05 dd83b4b
Working 4 ball
Se-gol 7ca6fde
Five ball stuff, and just shoot
Se-gol 9ec682f
Merge branch 'autoPaths-newFour' into suppliers-and-caching
Se-gol 58d6c7c
Fix warmup
Se-gol b37bec8
Merge remote-tracking branch 'origin/back-up-cases' into suppliers-an…
Se-gol 4913360
Add wait for vision adjustment in shooting
vichik123 ae57656
Latest (five cargo)
Se-gol 450c5a1
Warm up fix and a more reliable option
cb28fd6
Driver's practice and autonomous
4483aba
Change to 5
Se-gol 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 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 |
---|---|---|
@@ -1,40 +1,32 @@ | ||
package frc.robot.auto; | ||
|
||
import edu.wpi.first.math.geometry.Rotation2d; | ||
import edu.wpi.first.wpilibj2.command.InstantCommand; | ||
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup; | ||
import frc.robot.RobotContainer; | ||
import edu.wpi.first.wpilibj2.command.ParallelDeadlineGroup; | ||
import frc.robot.subsystems.conveyor.Conveyor; | ||
import frc.robot.subsystems.conveyor.commands.ConveyToShooter; | ||
import frc.robot.subsystems.conveyor.commands.Convey; | ||
import frc.robot.subsystems.drivetrain.SwerveDrive; | ||
import frc.robot.subsystems.drivetrain.commands.AdjustToTargetOnCommand; | ||
import frc.robot.subsystems.flap.Flap; | ||
import frc.robot.subsystems.hood.Hood; | ||
import frc.robot.subsystems.intake.Intake; | ||
import frc.robot.subsystems.shooter.Shooter; | ||
import frc.robot.subsystems.shooter.commands.Shoot; | ||
import frc.robot.utils.PhotonVisionModule; | ||
|
||
public class FourBallAuto extends SaarIsAutonomous { | ||
public FourBallAuto(SwerveDrive swerveDrive, Shooter shooter, Conveyor conveyor, Intake intake, Hood hood, Flap flap, PhotonVisionModule visionModule) { | ||
super(swerveDrive, shooter, conveyor, intake, hood, flap, visionModule, "Alon 4 ball #1"); | ||
addCommands(new InstantCommand(() -> RobotContainer.cachedDistanceForHood = 3.4)); | ||
addCommands(new InstantCommand(() -> RobotContainer.cachedSetpointForShooter = Shoot.getSetpointVelocity(RobotContainer.cachedDistanceForHood))); | ||
addCommands(new InstantCommand(() -> shooter.setVelocity(RobotContainer.cachedSetpointForShooter))); | ||
addCommands(reachVelocityByDistance(3.35)); | ||
addCommands(followPathAndPickup("Alon 4 ball #1")); | ||
addCommands(turnToAngle(() -> Rotation2d.fromDegrees(79.28))); | ||
new ParallelCommandGroup( | ||
new ConveyToShooter(conveyor, () -> !conveyor.isPreFlapBeamConnected(), shooter::getVelocity), | ||
new AdjustToTargetOnCommand(swerveDrive, () -> visionModule.getYaw().orElse(0), visionModule::hasTargets) | ||
).withTimeout(3); | ||
addCommands(new ParallelDeadlineGroup( | ||
turnToAngle(() -> Rotation2d.fromDegrees(79.28)), | ||
new Convey(conveyor, -0.25).withTimeout(0.075) | ||
)); | ||
addCommands(new AdjustToTargetOnCommand(swerveDrive, () -> visionModule.getYaw().orElse(0), visionModule::hasTargets).withTimeout(0.3)); | ||
addCommands(confirmShooting().withTimeout(2)); | ||
addCommands(reachVelocityByDistance(4.03)); | ||
addCommands(followPathAndPickup("Alon 4 ball #2")); | ||
addCommands(followPath("Alon 4 ball #3")); | ||
addCommands(new InstantCommand(() -> RobotContainer.cachedDistanceForHood = 4.5)); | ||
addCommands(new InstantCommand(() -> RobotContainer.cachedSetpointForShooter = Shoot.getSetpointVelocity(RobotContainer.cachedDistanceForHood))); | ||
addCommands(new InstantCommand(() -> shooter.setVelocity(RobotContainer.cachedSetpointForShooter))); | ||
new ParallelCommandGroup( | ||
new ConveyToShooter(conveyor, () -> !conveyor.isPreFlapBeamConnected(), shooter::getVelocity), | ||
new AdjustToTargetOnCommand(swerveDrive, () -> visionModule.getYaw().orElse(0), visionModule::hasTargets) | ||
).withTimeout(3); | ||
addCommands(new AdjustToTargetOnCommand(swerveDrive, () -> visionModule.getYaw().orElse(0), visionModule::hasTargets).withTimeout(0.3)); | ||
addCommands(confirmShooting()); | ||
} | ||
} |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it's a good idea to have Ma'ayan shoot the cargo? If the adjustment doesn't work it could cause problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I also thought about it. Paulo recommended it and I also think it helps with the flow of the game. All Maayan has to do is press and hold once until balls go in. We'll see how well that, and the adjustment work. If the adjustment doesn't work we'll find safeties or split it. And if Maayan prefers it, we'll let you do it