Skip to content

Skid detection#96

Open
SCool62 wants to merge 9 commits intomainfrom
skid-detection
Open

Skid detection#96
SCool62 wants to merge 9 commits intomainfrom
skid-detection

Conversation

@SCool62
Copy link
Copy Markdown
Contributor

@SCool62 SCool62 commented Mar 16, 2025

Currently, if it detects a skidding module, it will set that module's delta position to the average of the other modules.

@SCool62 SCool62 requested a review from Lyssia-Seiden March 17, 2025 19:26
Comment thread src/main/java/frc/robot/utils/SkidDetection.java Outdated
Comment thread src/main/java/frc/robot/utils/SkidDetection.java
Comment thread src/main/java/frc/robot/subsystems/swerve/SwerveSubsystem.java Outdated
- (rotationalComponentState.speedMetersPerSecond
* rotationalComponentState.angle.getSin());
}
double xTransComponentAverage = Arrays.stream(xTransComponents).average().getAsDouble();
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.

i think its more correct to find the avg and std dev of the speed of each module, rather than the components, but idt it makes a huge difference at the end of the day.


boolean[] result = new boolean[4];
for (int i = 0; i <= moduleStates.length; i++) {
// If the measurement deviates by more than 2 standard deviations assume it's skidding (TODO: TUNE)
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.

it could be worth setting up a way to see how off one module needs to be for this to take effect, either with a desmos project or running some test values through this method

Comment thread src/main/java/frc/robot/utils/SkidDetection.java Outdated
Comment thread src/main/java/frc/robot/subsystems/swerve/SwerveSubsystem.java
@spellingcat spellingcat linked an issue Mar 25, 2025 that may be closed by this pull request
Comment thread src/main/java/frc/robot/subsystems/swerve/SwerveSubsystem.java Outdated
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.

Skid detection

2 participants