Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Shooter assist #116

Merged
merged 29 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c4b6ee9
driverOI handlePre
qntmcube Mar 30, 2024
29c2f92
changed autons to old shootNow
qntmcube Mar 30, 2024
4508b32
adjusted auton path
qntmcube Mar 30, 2024
7583e9c
re-added DriverShootVelocityIntake in driverOI
qntmcube Mar 30, 2024
69c68c4
added timeout to auto intake and removed incorrect context ownership
qntmcube Mar 31, 2024
5506a75
resets gyro to 180 degrees of current after auton is done
qntmcube Mar 31, 2024
115597d
stop shooter at the end of an auton and other context stuff
qntmcube Apr 1, 2024
716cfda
Started making a more complete set of autons
qntmcube Apr 1, 2024
93625bc
renamed autoIntake
qntmcube Apr 2, 2024
df4e12b
defualt 4800
Leek865 Apr 2, 2024
f87f579
Shooter 4800 Changes and added center auton
qntmcube Apr 2, 2024
77d10e7
slight path tweaks
qntmcube Apr 3, 2024
4d733ae
spotless
qntmcube Apr 3, 2024
677b025
updated path
qntmcube Apr 3, 2024
288d9bf
Added midfield autons
qntmcube Apr 3, 2024
d3d8094
increased moveClimbersToBottom speed
qntmcube Apr 3, 2024
fb39f2b
slightly decreased the intake feeding time into shooter for auton
qntmcube Apr 3, 2024
21ac302
lowered climber speed back down, since it doesn't actually slow down …
qntmcube Apr 3, 2024
75f17c4
moved prox sensor threshold into a constant
qntmcube Apr 3, 2024
558ab50
Added minimal changes for shooter assist.
Leek865 Apr 4, 2024
01365d6
Added some comments.
Leek865 Apr 4, 2024
de17ba2
reverted changes
qntmcube Apr 4, 2024
fbcc394
changed intake feeding time to 1.2 seconds
qntmcube Apr 4, 2024
4271155
Changed logic to rely on should run instead of target speed.
Leek865 Apr 4, 2024
d32ee62
commented log
qntmcube Apr 4, 2024
455578d
spotless
qntmcube Apr 4, 2024
dfb73d2
Merge remote-tracking branch 'origin/Better-Auton-Paths' into Shooter…
dejabot Apr 4, 2024
96a1d07
Merge remote-tracking branch 'origin/Better-Auton-Paths' into Shooter…
dejabot Apr 4, 2024
29103d6
Merge remote-tracking branch 'origin/main' into Shooter-Assist
dejabot Apr 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/main/java/com/team766/robot/reva/BoxOpOI.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,19 @@ protected void handleOI(Context context) {
shoulder.rotate(ShoulderPosition.SHOOT_LOW);
context.releaseOwnership(shoulder);
} else if (gamepad.getButtonPressed(InputConstants.XBOX_X)) {
// other shoot pos
// amp shot
context.takeOwnership(shoulder);
shoulder.rotate(ShoulderPosition.AMP);
context.releaseOwnership(shoulder);
} else if (gamepad.getButtonPressed(InputConstants.XBOX_Y)) {
// amp shot
// shooter assist
context.takeOwnership(shoulder);
shoulder.rotate(ShoulderPosition.TOP);
shoulder.rotate(ShoulderPosition.SHOOTER_ASSIST);
// Currently it will only modify the speed if the right trigger is already held.
// TODO: Make this more tolerant for when Y is pressed before right trigger.
if (shooter.getShouldRun()) {
shooter.shoot(Shooter.SHOOTER_ASSIST_SPEED);
}
context.releaseOwnership(shoulder);
} else if (gamepad.getPOV() == 0) {
context.takeOwnership(shoulder);
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/com/team766/robot/reva/mechanisms/Shooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
import com.team766.library.RateLimiter;

public class Shooter extends Mechanism {
private static final double DEFAULT_SPEED =
public static final double DEFAULT_SPEED =
4800.0; // motor shaft rps, does not take gearing into account
public static final double SHOOTER_ASSIST_SPEED = 4000.0;
private static final double NUDGE_INCREMENT = 100.0;
private static final double CURRENT_LIMIT = 40.0; // needs tuning
private static final double MAX_SPEED = 5600.0; // spec is 6000.0
Expand Down Expand Up @@ -57,6 +58,10 @@ private double getShooterSpeedBottom() {
return shooterMotorBottom.getSensorVelocity();
}

public boolean getShouldRun() {
return shouldRun;
}

public void shoot(double speed) {
targetSpeed = com.team766.math.Math.clamp(speed, MIN_SPEED, MAX_SPEED);
shoot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public enum ShoulderPosition {
BOTTOM(0),
INTAKE_FLOOR(0),
SHOOT_LOW(15),
SHOOTER_ASSIST(18.339),
SHOOT_MEDIUM(30),
SHOOT_HIGH(80),
AMP(90),
Expand Down
Loading