Skip to content

Commit

Permalink
stop running intake after we intake
Browse files Browse the repository at this point in the history
  • Loading branch information
e-bauman committed Apr 18, 2024
1 parent 01b89b8 commit 34e4ea5
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 33 deletions.
10 changes: 2 additions & 8 deletions autonomous/routines/AMP_SKIP_2/auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,7 @@
path_2,
path_3
),
SequentialCommandGroup(
IntakeStageNote(Robot.wrist, Robot.intake),
AimWrist(Robot.wrist, Field.calculations)
)
IntakeThenAim(Robot.intake, Robot.wrist, Field.calculations)
),

# Shoot second note
Expand All @@ -194,10 +191,7 @@
path_4,
path_5
),
SequentialCommandGroup(
IntakeStageNote(Robot.wrist, Robot.intake),
AimWrist(Robot.wrist, Field.calculations)
)
IntakeThenAim(Robot.intake, Robot.wrist, Field.calculations)
),

# Shoot third note
Expand Down
10 changes: 2 additions & 8 deletions autonomous/routines/AMP_SKIP_2_2/auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,7 @@
path_2,
path_3
),
SequentialCommandGroup(
IntakeStageNote(Robot.wrist, Robot.intake),
AimWrist(Robot.wrist, Field.calculations)
)
IntakeThenAim(Robot.intake, Robot.wrist, Field.calculations)
),

# Shoot second note
Expand All @@ -194,10 +191,7 @@
path_4,
path_5
),
SequentialCommandGroup(
IntakeStageNote(Robot.wrist, Robot.intake),
AimWrist(Robot.wrist, Field.calculations)
)
IntakeThenAim(Robot.intake, Robot.wrist, Field.calculations)
),

# Shoot third note
Expand Down
10 changes: 2 additions & 8 deletions autonomous/routines/MIDLINE_NOTES/auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,7 @@
# ),
path_3
),
SequentialCommandGroup(
IntakeStageNote(Robot.wrist, Robot.intake),
AimWrist(Robot.wrist, Field.calculations)
)
IntakeThenAim(Robot.intake, Robot.wrist, Field.calculations)
),

# shoot second note
Expand All @@ -242,10 +239,7 @@
# ),
path_8
),
SequentialCommandGroup(
IntakeStageNote(Robot.wrist, Robot.intake),
AimWrist(Robot.wrist, Field.calculations)
)
IntakeThenAim(Robot.intake, Robot.wrist, Field.calculations)
),

# drive to shot zone
Expand Down
10 changes: 2 additions & 8 deletions autonomous/routines/MIDLINE_NOTES/auto_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,7 @@
# ),
path_3
),
SequentialCommandGroup(
IntakeStageNote(Robot.wrist, Robot.intake),
AimWrist(Robot.wrist, Field.calculations)
)
IntakeThenAim(Robot.intake, Robot.wrist, Field.calculations)
),

# shoot second note
Expand All @@ -242,10 +239,7 @@
# ),
path_8
),
SequentialCommandGroup(
IntakeStageNote(Robot.wrist, Robot.intake),
AimWrist(Robot.wrist, Field.calculations)
)
IntakeThenAim(Robot.intake, Robot.wrist, Field.calculations)
),

# drive to shot zone
Expand Down
2 changes: 1 addition & 1 deletion command/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
from command.wrist import SetWrist, FeedIn, FeedOut, ZeroWrist, PassNote, AimWrist, SetWristIdle
from command.flywheel import SetFlywheelLinearVelocity, SetFlywheelVelocityIndependent, SetFlywheelShootSpeaker, SetFlywheelShootFeeder
from command.controller import Giraffe, StageNote, AimWristSpeaker, Shoot, EnableClimb, UndoClimb, EmergencyManuver, IntakeStageNote, IntakeStageIdle, Amp, ScoreTrap, ClimbDown,\
ShootAuto, ControllerRumble, ControllerRumbleTimeout, IntakeStageNoteAuto, PathUntilIntake, AutoPickupNote, PathIntakeAim
ShootAuto, ControllerRumble, ControllerRumbleTimeout, IntakeStageNoteAuto, PathUntilIntake, AutoPickupNote, PathIntakeAim, IntakeThenAim
8 changes: 8 additions & 0 deletions command/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,14 @@ def __init__(self, wrist: Wrist, intake: Intake):
WaitUntilCommand(lambda: wrist.note_in_feeder()),
)

class IntakeThenAim(SequentialCommandGroup):
def __init__(self, intake: Intake, wrist: Wrist, calculations: TrajectoryCalculator):
super().__init__(
IntakeStageNote(wrist, intake),
IntakeIdle(intake),
AimWrist(wrist, calculations)
)


class PathUntilIntake(ParallelRaceGroup):
def __init__(self, path: Command, wrist: Wrist, intake: Intake,
Expand Down

0 comments on commit 34e4ea5

Please sign in to comment.