Skip to content

Adding finish modes for SwerveSimpleTrajectoryLogic#671

Open
Rongrrz wants to merge 4 commits intomainfrom
position-and-rotation-threshold-for-swerve-trajectory
Open

Adding finish modes for SwerveSimpleTrajectoryLogic#671
Rongrrz wants to merge 4 commits intomainfrom
position-and-rotation-threshold-for-swerve-trajectory

Conversation

@Rongrrz
Copy link
Copy Markdown
Contributor

@Rongrrz Rongrrz commented Apr 1, 2026

Why are we doing this?

Added a way for users to customize position and rotation thresholds before finishing such that they don't have to rely on pid. Also allow for setting a custom loose velocity.

Whats changing?

Additionally just refactored older logic so it looks better and is more maintainable.

Questions/notes for reviewers

How this was tested

  • unit tests added
  • tested on robot

@Rongrrz Rongrrz requested a review from a team as a code owner April 1, 2026 03:21
@Rongrrz Rongrrz requested a review from rokadias April 1, 2026 03:21
Copy link
Copy Markdown
Contributor

@rokadias rokadias left a comment

Choose a reason for hiding this comment

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

Note: I can make this work for this year since there's a BaseDriveWithSimpleBezierCommand where I can keep consistent loose points through out the two sets of movements.

Though imagine if we moved that into SCL. Would it make sense for it to hold what the loose values are it be properties/values coming from the logic.

I'd like to propose that it be a responsibility of the logic. To stick with a better information hiding principal.

}

if (finished) {
log.info(String.format("SwerveLogic recommends Finished, goal is %f away.", goalVector.getMagnitude()));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⭐ ⭐ ⭐ You're no longer using goalVector to determine finishing point.

This log message would be deceptive for debugging, and the variable looks like it's no longer useful.

Likely you want lastResult.distanceToTargetPoint?

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