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

Commit

Permalink
fix: don't reset field orientation on scoring if odometry isn't updated
Browse files Browse the repository at this point in the history
  • Loading branch information
rutmanz committed Oct 17, 2023
1 parent a5ab15c commit 586927b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,12 @@ public boolean updateWithScoringApriltags() {

public Command updateOdometryAnd(Command cmd) {
return new ParallelCommandGroup(
new InstantCommand(this::updateWithScoringApriltags).andThen(new InstantCommand(this::zeroFieldOrientation)),
new InstantCommand(() -> {
boolean isGood = this.updateWithScoringApriltags();
if (isGood) {
this.zeroFieldOrientation();
}
}),
cmd
);
}
Expand Down

0 comments on commit 586927b

Please sign in to comment.