-
Notifications
You must be signed in to change notification settings - Fork 0
Rt cancel #109
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
base: main
Are you sure you want to change the base?
Rt cancel #109
Changes from all commits
b123f24
cfe717b
75a453f
9698c24
b358474
3e1de9d
430742d
df42bfb
cdf59c1
8fb2677
64d6afe
3493523
630c589
4e7949a
1dd39ba
2128889
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| package frc.robot.commands.angler; | ||
|
|
||
| import frc.robot.subsystems.AnglerSubsystem; | ||
| import frc.robot.utils.logging.commands.LoggableCommand; | ||
|
|
||
| public class ResetAnglerEncoder extends LoggableCommand { | ||
|
|
||
| private final AnglerSubsystem subsystem; | ||
|
|
||
| public ResetAnglerEncoder(AnglerSubsystem subsystem) { | ||
| this.subsystem = subsystem; | ||
| addRequirements(subsystem); | ||
| } | ||
|
|
||
| @Override | ||
| public void initialize() { | ||
| subsystem.resetEncoderToZero(); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean isFinished() { | ||
| return true; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
|
|
||
| import choreo.auto.AutoFactory; | ||
| import frc.robot.commands.ShootButton; | ||
| import frc.robot.commands.angler.RunAnglerToReverseLimit; | ||
| import frc.robot.commands.angler.ResetAnglerEncoder; | ||
| import frc.robot.commands.shooter.SetShootingState; | ||
| import frc.robot.commands.turret.SetTurretAngle; | ||
| import frc.robot.constants.enums.ShootingState; | ||
|
|
@@ -26,7 +26,7 @@ public BlueDepotShoot( | |
| super( | ||
| new LoggableParallelCommandGroup( | ||
| new SetTurretAngle(turret, 0), | ||
| new RunAnglerToReverseLimit(angler) | ||
| new ResetAnglerEncoder(angler) | ||
|
Contributor
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. this is incorrect, it has to be stowAngler. the same is true for all the autonomous commands. I'm not sure why this was even changed in this PR, it shouldn't be part of it. This will create conflicts to Michael who is working on the autonomous commands. |
||
| ), | ||
| new SetShootingState(shootstate, ShootState.FIXED_2), //or some other shoot state | ||
| LoggableCommandWrapper.wrap(auto.resetOdometry("BlueDepotShoot")), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| // Copyright (c) FIRST and other WPILib contributors. | ||
|
Contributor
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 is this part of this PR? |
||
| // 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.intakeDeployment; | ||
| import edu.wpi.first.wpilibj.Timer; | ||
| import frc.robot.constants.Constants; | ||
| import frc.robot.subsystems.IntakeDeployerSubsystem; | ||
| import frc.robot.utils.logging.commands.LoggableCommand; | ||
|
|
||
| public class InitialDeploymentState extends LoggableCommand { | ||
| private final IntakeDeployerSubsystem subsystem; | ||
| private final Timer timer; | ||
|
|
||
| public InitialDeploymentState(IntakeDeployerSubsystem subsystem) { | ||
| timer = new Timer(); | ||
| this.subsystem = subsystem; | ||
| addRequirements(subsystem); | ||
| } | ||
|
|
||
| @Override | ||
| public void initialize() { | ||
| timer.restart(); | ||
| } | ||
|
|
||
| @Override | ||
| public void execute() { | ||
| switch (subsystem.getDeploymentState()) { | ||
| case UP -> subsystem.setSpeed(Constants.INITIAL_INTAKE_RETRACTION_SPEED); | ||
| case DOWN -> subsystem.setSpeed(Constants.INITIAL_INTAKE_DEPLOYMENT_SPEED); | ||
| case STOPPED -> subsystem.stopMotors(); | ||
| default -> subsystem.stopMotors(); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public void end(boolean interrupted) { | ||
| } | ||
|
|
||
| @Override | ||
| public boolean isFinished() { | ||
| return timer.hasElapsed(Constants.INTAKE_DEPLOYER_BURNOUT_TIMER); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| package frc.robot.commands.sequences; | ||
|
|
||
| import frc.robot.commands.angler.StowAngler; | ||
| import frc.robot.commands.climber.ClimberDown; | ||
| import frc.robot.commands.intakeDeployment.InitialDeploymentState; | ||
| import frc.robot.commands.intakeDeployment.SetDeploymentState; | ||
| import frc.robot.commands.shooter.SetShootingState; | ||
| import frc.robot.commands.shooter.StopShooter; | ||
| import frc.robot.commands.turret.RunTurretToRevLimit; | ||
| import frc.robot.constants.enums.DeploymentState; | ||
| import frc.robot.constants.enums.ShootingState; | ||
| import frc.robot.constants.enums.ShootingState.ShootState; | ||
| import frc.robot.subsystems.AnglerSubsystem; | ||
| import frc.robot.subsystems.ClimberSubsystem; | ||
| import frc.robot.subsystems.FeederSubsystem; | ||
| import frc.robot.subsystems.HopperSubsystem; | ||
| import frc.robot.subsystems.IntakeDeployerSubsystem; | ||
| import frc.robot.subsystems.IntakeSubsystem; | ||
| import frc.robot.subsystems.ShooterSubsystem; | ||
| import frc.robot.subsystems.TurretSubsystem; | ||
| import frc.robot.utils.logging.commands.LoggableParallelCommandGroup; | ||
| import frc.robot.utils.logging.commands.LoggableSequentialCommandGroup; | ||
|
|
||
| public class ResetAll extends LoggableSequentialCommandGroup { | ||
|
|
||
| public ResetAll(AnglerSubsystem anglerSubsystem, ClimberSubsystem climberSubsystem, | ||
| FeederSubsystem feederSubsystem, HopperSubsystem hopperSubsystem, | ||
| IntakeDeployerSubsystem intakeDeployerSubsystem, IntakeSubsystem intakeSubsystem, | ||
| ShooterSubsystem shooterSubsystem, TurretSubsystem turretSubsystem, ShootingState shootState) { | ||
| super( | ||
| new SetDeploymentState(intakeDeployerSubsystem, DeploymentState.UP), | ||
|
Contributor
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. the intake deployment mechanism changed, please talk to Jackson about what needs to be done here. |
||
| new LoggableParallelCommandGroup( | ||
| new InitialDeploymentState(intakeDeployerSubsystem), | ||
| new StowAngler(anglerSubsystem), | ||
| new ClimberDown(climberSubsystem), | ||
| new SetShootingState(shootState, ShootState.STOPPED), | ||
| new RunTurretToRevLimit(turretSubsystem))); | ||
| } | ||
| } | ||
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.
I'm not sure why this was added, we don't want to use this because it doesn't move the mechanism to the bottom position. the correct command is stowAngler. this should be removed from the PR.