Skip to content

Commit

Permalink
Fix some bugs related to red alliance start
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnGilb committed Feb 20, 2024
1 parent 2fc74f8 commit 4ef5d0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public FromMidShootCollectShoot(
this.autoSelector = autoSelector;
// Force our location
var startInFrontOfSpeaker = pose.createSetPositionCommand(
PoseSubsystem.SubwooferCentralScoringLocation);
() -> PoseSubsystem.convertBlueToRedIfNeeded(PoseSubsystem.SubwooferCentralScoringLocation));
this.addCommands(startInFrontOfSpeaker);

// Shoot the pre-loaded note from the subwoofer
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/competition/subsystems/pose/PoseSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@


import java.util.Optional;
import java.util.function.Supplier;


@Singleton
Expand Down Expand Up @@ -220,6 +221,10 @@ public Command createSetPositionCommand(Pose2d pose) {
return Commands.runOnce(() -> setCurrentPosition(pose));
}

public Command createSetPositionCommand(Supplier<Pose2d> poseSupplier) {
return Commands.runOnce(() -> setCurrentPosition(poseSupplier.get()));
}

private void improveFusedOdometryUsingPhotonLib(Pose2d recentPosition) {
var photonEstimatedPoses = vision.getPhotonVisionEstimatedPoses(recentPosition);

Expand Down

0 comments on commit 4ef5d0e

Please sign in to comment.