Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Better amp area floor shot
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanjcoderman committed Apr 18, 2024
1 parent 276c5cd commit 554144d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/main/java/frc/robot/config/CompConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ class CompConfig {
floorSpotDistanceToRPM.put(3.0, 1800.0);
floorSpotDistanceToRPM.put(5.8, 2700.0);
floorSpotDistanceToRPM.put(6.5, 2700.0);
floorSpotDistanceToRPM.put(500.0, 2700.0);
// Evil hacky way to have alternate shooter RPM for the amp area shot
floorSpotDistanceToRPM.put(581.0, 3200.0);
}),
new ClimberConfig(
19,
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/frc/robot/robot_manager/RobotManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ public void robotPeriodic() {
Rotation2d wristAngleForSpeaker = wrist.getAngleFromDistanceToSpeaker(speakerDistance);
Rotation2d wristAngleForFloorSpot = wrist.getAngleFromDistanceToFloorSpot(floorSpotDistance);
shooter.setSpeakerDistance(speakerDistance);
shooter.setFloorSpotDistance(floorSpotDistance);
shooter.setFloorSpotDistance(
floorSpotDistance > VisionSubsystem.FLOOR_SPOT_MAX_DISTANCE_FOR_SUBWOOFER
? 581.0
: floorSpotDistance);

// State transitions from requests
for (RobotFlag flag : flags.getChecked()) {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/frc/robot/vision/VisionSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.littletonrobotics.junction.Logger;

public class VisionSubsystem extends LifecycleSubsystem {
public static final double FLOOR_SPOT_MAX_DISTANCE_FOR_SUBWOOFER = 14.0;
private static final boolean CALIBRATION_RIG_ENABLED = false;
private static final boolean SHOOT_TO_SIDE_ENABLED = true;
public static final boolean LIMELIGHT_UPSIDE_DOWN = true;
Expand Down Expand Up @@ -269,7 +270,7 @@ public DistanceAngle getDistanceAngleFloorShot() {
var usedGoalPose = goalPoseSubwoofer;
var result = subwooferSpotDistance;

if (subwooferSpotDistance.distance() > 14.0) {
if (subwooferSpotDistance.distance() > FLOOR_SPOT_MAX_DISTANCE_FOR_SUBWOOFER) {
result = distanceToTargetPose(goalPoseAmpArea, usedRobotPose);
usedGoalPose = goalPoseAmpArea;
}
Expand Down

0 comments on commit 554144d

Please sign in to comment.