Skip to content
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

Improve atPose clarity, routine-active safety, alliance-flipping safety #982

Merged
merged 4 commits into from
Dec 7, 2024

Conversation

shueja
Copy link
Collaborator

@shueja shueja commented Dec 7, 2024

Renamed atPose() triggers as atTranslation(), added new atPose() that requires rotation tolerance as well.
Fixed logic in those triggers that sampled an alliance-dependent pose too early
Made the triggers and(active()).

})
.orElse(false);
});
public Trigger atPose(Optional<Pose2d> pose, double toleranceMeters, double toleranceRadians) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this an optional? seems kinda leaky of the underlying implementation.

@@ -259,8 +259,48 @@ public static Supplier<Optional<Pose2d>> optionalFlipped(
* @return empty if the alliance is empty; the original pose if the alliance is blue; the flipped
* pose if the alliance is red
*/
public static Supplier<Optional<Pose2d>> optionalFlipped(
public static Supplier<Optional<Pose2d>> optionalFlippedPose2d(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these optionals are confusing me

Copy link
Collaborator

@oh-yes-0-fps oh-yes-0-fps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@shueja shueja marked this pull request as ready for review December 7, 2024 06:48
@shueja shueja enabled auto-merge December 7, 2024 06:53
@shueja shueja added this pull request to the merge queue Dec 7, 2024
Merged via the queue into SleipnirGroup:main with commit 6537808 Dec 7, 2024
32 checks passed
@shueja shueja deleted the at-pose-checks-rotation branch December 7, 2024 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants