Skip to content

Commit

Permalink
update the note position, then stop the motors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob1010-h committed Jan 24, 2024
1 parent 3940508 commit 36e6e60
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/main/java/frc/robot/commands/handoff/Handoff.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public Command stopAllMotors() {
}

// TODO: We assume that the note is already in the claw when we want to shoot
public Command clawToShooter(){
public Command noteToShoot(){
// this.notePosition = NotePosition.CLAW; ^^^
Command shoot = emptyCommand;
this.shooterCalc.prepareFireMovingCommand(() -> true, swerve);
Expand All @@ -78,27 +78,28 @@ public Command clawToShooter(){
indexer.toShooter()
.andThen(intake.inCommand()) // TODO: is this correct? because the top and bottom motors are seperate
.andThen(claw.expel())
.andThen(() -> this.notePosition = NotePosition.SHOOTER)
.andThen(Commands.waitSeconds(1)) // TODO: Change this to a wait until the note is in the shooter?
.andThen(() -> this.notePosition = NotePosition.NONE)
.andThen(stopAllMotors());

this.notePosition = NotePosition.SHOOTER;
//TODO: Then once we are done shooting, we want the variable to be set to NONE
}

return shoot;
}

public Command clawToTrap() {
public Command noteToTrap() {
Command shoot = emptyCommand;

if ( this.notePosition == NotePosition.CLAW ) {
// maybe make setPosition a command ORR Make the Elevator Command
shoot = Commands.runOnce(
() -> elevator.setPosition(TrapConstants.TRAP_POS)
).andThen(
Commands.waitUntil(elevator.isAtTargetPosition())
).andThen(claw.expel())
.andThen(new WaitCommand(1))
.andThen(stopAllMotors());
shoot =
Commands.runOnce(
() -> elevator.setPosition(TrapConstants.TRAP_POS) )
.andThen(
Commands.waitUntil(elevator.isAtTargetPosition())
).andThen(claw.expel())
.andThen(new WaitCommand(1))
.andThen(stopAllMotors());

this.notePosition = NotePosition.CLAW;

Expand Down

0 comments on commit 36e6e60

Please sign in to comment.