-
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
New Button Mapping for pilot and operator #50
Conversation
Additional things: add last years vision files in, limelight and maybe limelightcommands add reef and intake station in sim, expand size create a sendable chooser for triggers
public final Trigger score_RB = rightBumper.and(noFn, teleop); | ||
public final Trigger climbPrep_RDP = rightDpad.and(noFn, teleop); | ||
public final Trigger stationIntake_LT = A.and(noFn, teleop); | ||
public final Trigger stationExtendedIntake_LT = A.and(fn, teleop); |
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.
should probably be named with _LB_LT
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.
fixed
Do you want to add the states for ground intaking with the corAl? Also I think the original plan was to keep the coral intaking on the left side and the algae intaking on the right side, but I assume you changed that to accommodate the station extended intaking. What are your thoughts? |
coralIntake.setDefaultCommand( | ||
log(coralIntake.runStop().ignoringDisable(true).withName("intake.default"))); | ||
log(coralIntake.runVelocityTcFocRpm(() -> -500).withName("intake.default"))); |
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.
minor change if you want: intake should be coralIntake
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.
From what I know about intaking on the corAl, I think moving the motor one way intakes coral and ejects algae, while moving the motor the other way ejects coral and intakes algae, so this may have to be an adaptable value (otherwise it wouldn't hold one of the game pieces)
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 probably gonna make coralIntake and Coraleject different from algaeIntake and algaeEject as like different command, I think that's the easiest way to fix this?
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.
But what about the default command? It would have to know whether to run a positive or negative velocity depending on what it's holding
|
||
coastMode.whileTrue(log(coastMode())); | ||
coastMode.onFalse(log(ensureBrakeMode())); | ||
} | ||
|
||
private static Command handOffAlgae() { | ||
private static Command handOff() { |
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.
For the reason I stated above, you may have to make two handOff and two score commands for coralIntake
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.
done
scoreState.and(L3Coral).and(backwardMode).onTrue(log(score3())); | ||
scoreState.and(L4Coral).and(backwardMode.not()).onTrue(log(score4())); | ||
scoreState.and(L4Coral).and(backwardMode).onTrue(log(score4())); | ||
|
||
L2Algae.and(backwardMode.not()).whileTrue(log(l2Algae())); |
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 have to also implement action ready stuff with retrieving algae?
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.
Nope, the idea for retrieving algae, atleast based on my understanding, is that we're going to be doing it as basically a pilot intake command, so pilot presses a button, and then drives in, so there's no need for a operator to control sm
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.
But wouldn't the arm be moving and the robot be aligning for this? Would the operator have to stage the arm for the reef algae before the pilot drives in?
} | ||
|
||
public static DoubleSupplier getPosition() { | ||
return () -> elbow.getPositionPercentage(); | ||
} | ||
|
||
public static DoubleSupplier switchSigns(DoubleSupplier supplier) { |
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 still need this?
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.
nope, deleted, ty
@@ -87,10 +126,6 @@ public static Command l4Coral() { | |||
.withName("Elbow.l4Coral"); | |||
} | |||
|
|||
public static Command barge() { | |||
return elbow.moveToPercentage(() -> elbow.checkReversed(config::getBarge)) |
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 think I actually need this for the position reversing. Sorry for not catching this earlier!
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.
The barge command? I'll add it back
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.
Just the check reversed part. Ty!
@@ -83,6 +96,15 @@ private static Command fullExtend() { | |||
return elevator.moveToRotations(config::getFullExtend).withName("Elevator.fullExtend"); | |||
} | |||
|
|||
private static Command score() { |
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 entirely sure if this could happen, but if the pilot accidentally presses the actionready button and then releases it while the elevator is at zero, would that cause issues?
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.
Not really, I've tested it and it kinda just spins the coralIntake, nothing too bad happens, and if the operator presses home again everything goes back to being fine
@@ -15,18 +14,20 @@ public class InClimbStates { | |||
|
|||
public static void setupDefaultCommand() { | |||
inClimb.setDefaultCommand( | |||
log(inClimb.runHoldInClimb().ignoringDisable(true).withName("InClimb.default"))); | |||
log(InClimbStates.home().ignoringDisable(true).withName("InClimb.default"))); |
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.
Just checking, if the operator tries to prep for climbing and lets go of the button, the default would send the climber home, so the operator needs to hold prep climb at all times? That might make it weird for the transition to finishing the climb on pilot.
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 orginally changed it to auto go back home, so that after the intake of the coral or the algae it automatically folds back on itself, or in emergencies if the operator is caught in the open or smth, they can just let go of the button to bring back inclimb instead of trying to press smth else
On the other hand good point, I'll change it so that default command is changed when you press prepclimb
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.
You can just have an onFalse for the intaking commands so that the inClimb goes back after the button is released
public final Trigger eject_fA = A.and(fn, teleop); | ||
public final Trigger score_RB = rightBumper.and(noFn, teleop); | ||
public final Trigger climbPrep_RDP = rightDpad.and(noFn, teleop); | ||
public final Trigger stationIntake_LT = A.and(noFn, teleop); |
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 want to keep this as A for now?
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.
Nah, I'll change it back, testing seems fine.
@@ -35,9 +46,10 @@ public static void setStates() { | |||
L3Coral.and(backwardMode).whileTrue(log(reverse(l3Coral()))); | |||
L4Coral.and(backwardMode.not()).whileTrue(log(l4Coral())); | |||
L4Coral.and(backwardMode).whileTrue(log(reverse(l4Coral()))); | |||
barge.and(backwardMode.not()).whileTrue(log(barge())); |
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.
Why was barge removed?
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.
barge wasn't removed, just shifted to another place in the setup commands, right below the other algae things
score.whileTrue(log(intake())); | ||
handOffAlgae.whileTrue(log(handOffAlgae())); | ||
stationExtendedIntake.whileTrue(log(intake())); | ||
scoreState.whileTrue(log(score())); |
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 think this will try to score as long as the action button isn't being pressed? That means that the default will never run and might cause issues when scheduling other commands that require coralIntake? (But I haven't tested it so I'm not sure)
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.
In the definition I wrote for score, and the new def I wrote for algaeScore, there will be triggers to prevent the coralIntake from running forever, in this case they check to see if the coral/algae is still there and if not they stop the command
L2Coral.and(backwardMode.not()).whileTrue(log(l2Coral())); | ||
L2Coral.and(backwardMode).whileTrue(log(reverse(l2Coral()))); | ||
L3Coral.and(backwardMode.not()).whileTrue(log(l3Coral())); | ||
L3Coral.and(backwardMode).whileTrue(log(reverse(l3Coral()))); | ||
L4Coral.and(backwardMode.not()).whileTrue(log(l4Coral())); | ||
L4Coral.and(backwardMode).whileTrue(log(reverse(l4Coral()))); | ||
|
||
barge.and(backwardMode.not()).whileTrue(log(barge())); |
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.
Same question about action ready with barge. I think action ready isn't just for scoring, but any action that might require prep and alignment like intaking.
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 think I mentioned that barge is the only algae command that'll use action ready, the other two can just be pilot commands and then the pilot drives in and intakes cuz they aren't as complicated or take as long of a time to do as the other score commands
I dont think states for ground intakign with corAl is necessary for our first events? I remember Allen saying something like having that might be too complicated and require too confusing mapping, however they could be added later. Like having 3 ways to intake two game pieces means like 6 different intake buttons which seems kinda insane for right now. |
@JosephBye some minor fixes for things I noticed in testing If these look okay to you, I'll go ahead and pull the branch (finally! sorry for taking so long) Also you can use axis 2 and axis 3 of keyboard0 to simulate the controller triggers in simulation
No description provided.