-
Notifications
You must be signed in to change notification settings - Fork 0
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
Arm catapult check #64
base: main
Are you sure you want to change the base?
Changes from all commits
0829186
56cc3ee
7fdeb6d
accb00b
21e6fc6
7e8738e
9c84a10
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 @@ | ||
[] | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,6 +95,8 @@ public RobotContainer() { | |
setCubeInternalState(); | ||
|
||
m_PDH.setSwitchableChannel(false); | ||
|
||
SmartDashboard.putNumber("cataAngle", SmartDashboard.getNumber("cataAngle", 0)); | ||
Comment on lines
+98
to
+99
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. We don't use this value anywhere here |
||
} | ||
|
||
/** | ||
|
@@ -153,7 +155,7 @@ private void configureBindings() { | |
|
||
// Go to collect state sequence | ||
_operatorController.povDown().onTrue( | ||
m_ArmFunnelSuperStructure.getSetStateCommand(ArmState.COLLECT, FunnelState.CLOSED) | ||
m_ArmFunnelSuperStructure.getSetStateCommand(ArmState.COLLECT, FunnelState.CLOSED) | ||
.andThen(m_manipulator.setManipulatorStateCommand(ManipulatorState.OPEN))); | ||
|
||
_driverController.circle().whileTrue( | ||
|
@@ -176,10 +178,23 @@ private void configureBindings() { | |
new WaitCommand(0.5), | ||
m_ArmFunnelSuperStructure.getSetStateCommand(ArmState.COLLECT, FunnelState.CLOSED), | ||
m_manipulator.setManipulatorStateCommand(ManipulatorState.HOLD))); | ||
|
||
_operatorController.cross() | ||
.onTrue(m_ArmFunnelSuperStructure.getSetStateCommand(ArmState.REJECT, FunnelState.OPEN) | ||
.andThen(this.getCollectSequence())); | ||
// catapult | ||
_operatorController.povLeft() | ||
.onTrue( | ||
m_ArmFunnelSuperStructure.generateSetStateCommand(ArmState.MID_CUBE, FunnelState.COLLECT) | ||
.andThen( | ||
m_ArmFunnelSuperStructure.getSetStateCommand(ArmState.COLLECT, | ||
FunnelState.CLOSED))); | ||
|
||
// catapult collect | ||
_operatorController.triangle() | ||
.onTrue( | ||
m_manipulator.setManipulatorStateCommand(ManipulatorState.HOLD).andThen( | ||
m_ArmFunnelSuperStructure.getSetStateCommand(ArmState.COLLECT, FunnelState.OPEN))); | ||
Comment on lines
+189
to
+193
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 do we need atapult collect? Can't we collect normally and when we want to score call catapult collect followed by catapult |
||
|
||
// close funnle without opening manipulator | ||
_operatorController.povRight().onTrue( | ||
m_ArmFunnelSuperStructure.getSetStateCommand(ArmState.COLLECT, FunnelState.CLOSED)); | ||
Comment on lines
+181
to
+197
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. We already use almost every button on the controller, more buttons mean more chances for error. Did we practice this?
Comment on lines
+195
to
+197
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. how is this used in the sequence? |
||
|
||
} | ||
|
||
|
@@ -209,6 +224,8 @@ private void addToChooser(String pathName) { | |
|
||
private void initChooser() { | ||
SmartDashboard.putData("autonomous", this.chooser); | ||
this.chooser.addOption("catapult", getCatapultSequence() | ||
.andThen(m_ArmFunnelSuperStructure.generateSetStateCommand(ArmState.COLLECT, FunnelState.CLOSED))); | ||
// addToChooser("engage"); | ||
// addToChooser("1-gp-engage"); | ||
addToChooser("1-gp-leaveCommunity"); | ||
|
@@ -228,8 +245,13 @@ private void initChooser() { | |
this.chooser.addOption("cube-engage-gyro", getAutoCubeSequence().andThen(getEngageSequence())); | ||
// only engage | ||
this.chooser.addOption("engage-gyro", getEngageSequence()); | ||
|
||
this.chooser.addOption("cube-mobility-engage", getAutoCubeSequence().andThen(getMobilityEngageSequence())); | ||
|
||
this.chooser.addOption("catapult-mobility-engage", getCatapultSequence().andThen(getMobilityEngageSequence())); | ||
|
||
this.chooser.addOption("catapult-engage", getCatapultSequence().andThen(getEngageSequence())); | ||
|
||
// taxi | ||
this.chooser.addOption("taxi", _autoFactory.createAuto("engage-gyro")); | ||
|
||
|
@@ -258,6 +280,16 @@ public void updateTelemetry() { | |
m_drivetrain.updateTelemetry(); | ||
} | ||
|
||
private CommandBase getCatapultSequence() { | ||
return Commands.sequence( | ||
m_manipulator.setManipulatorStateCommand(ManipulatorState.HOLD), | ||
m_ArmFunnelSuperStructure.getSetStateCommand(ArmState.COLLECT, FunnelState.COLLECT), | ||
new WaitCommand(0.3), | ||
m_ArmFunnelSuperStructure.generateSetStateCommand(ArmState.MID_CUBE, FunnelState.COLLECT) | ||
|
||
); | ||
} | ||
|
||
private CommandBase getEngageSequence() { | ||
return Commands.sequence( | ||
_autoFactory.createAuto("engage-gyro"), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,4 +100,8 @@ public CommandBase overrideCommand() { | |
m_arm.getSetStateCommand(ArmState.MID_CONE, ArmTrapProfile.FAST), | ||
m_funnel.setFunnelStateCommand(FunnelState.CLOSED)); | ||
} | ||
|
||
public double getArmAngle() { | ||
return m_arm.getAngle(); | ||
} | ||
Comment on lines
+103
to
+106
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 function is not used anywhere here |
||
} |
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.
This file can be removed