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

Wheel radius charaterization #225

Merged
merged 3 commits into from
Mar 3, 2024
Merged

Wheel radius charaterization #225

merged 3 commits into from
Mar 3, 2024

Conversation

RudyG252
Copy link
Contributor

@RudyG252 RudyG252 commented Mar 3, 2024

No description provided.

@RudyG252 RudyG252 requested a review from GalexY727 March 3, 2024 04:44
Copy link
Member

@GalexY727 GalexY727 left a comment

Choose a reason for hiding this comment

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

Unfortunately implements Logged doesn't work well on Commands, so this should be good to go to el mainereies. Review comments before merging 🤪

@@ -470,6 +473,7 @@ private void prepareNamedCommands() {
NamedCommands.registerCommand("PrepareShooterW3", shooterCmds.prepareFireCommand(() -> FieldConstants.W3_POSE, Robot::isRedAlliance));
NamedCommands.registerCommand("PrepareShooter", shooterCmds.prepareFireCommand(pathPlannerStorage::getNextShotTranslation, () -> false));
NamedCommands.registerCommand("PrepareSWD", shooterCmds.prepareSWDCommand(swerve::getPose, swerve::getRobotRelativeVelocity));
NamedCommands.registerCommand("WheelRadiusCharacterization", wheelRadiusChar);
Copy link
Member

Choose a reason for hiding this comment

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

This is only for pp, we dont need it

Copy link
Member

Choose a reason for hiding this comment

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

Format this file quickly with ctrl k+ f teehee


private Swerve swerve;

private final SlewRateLimiter omegaLimiter = new SlewRateLimiter(1.0);
Copy link
Member

Choose a reason for hiding this comment

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

we don't need allat

public WheelRadiusCharacterization(Swerve swerve) {
this.swerve = swerve;
addRequirements(this.swerve);
// Use addRequirements() here to declare subsystem dependencies.e
Copy link
Member

Choose a reason for hiding this comment

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

did you know? you can use addRequirements() here to declare subsystem dependencies.e!1!


startWheelPositions = swerve.getWheelRadiusCharacterizationPosition();

omegaLimiter.reset(0);
Copy link
Member

Choose a reason for hiding this comment

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

i'm listening

Comment on lines +338 to +340
public double[] getWheelRadiusCharacterizationPosition() {
return Arrays.stream(swerveModules).mapToDouble(module -> module.getDrivePositionRadians()).toArray();
}
Copy link
Member

Choose a reason for hiding this comment

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

what the formatting

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤫 🧏‍♂️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm literally mechanical advantage

@@ -329,6 +335,10 @@ public double getSpeedMultiplier() {
return this.speedMultiplier;
}

public double[] getWheelRadiusCharacterizationPosition() {
return Arrays.stream(swerveModules).mapToDouble(module -> module.getDrivePositionRadians()).toArray();
Copy link
Member

Choose a reason for hiding this comment

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

you got that. nice stuff, Jonas.

@@ -410,7 +410,8 @@ public static final class ModuleConstants {
// Calculations required for driving motor conversion factors and feed forward
public static final double DRIVING_MOTOR_FREE_SPEED_RPS = NeoMotorConstants.VORTEX_FREE_SPEED_RPM / 60;
public static final double WHEEL_DIAMETER_METERS = 0.0762;
public static final double WHEEL_CIRCUMFERENCE_METERS = WHEEL_DIAMETER_METERS * Math.PI;
public static final double WHEEL_TO_MOTOR_ROTATIONS = 3.5625;
public static final double WHEEL_CIRCUMFERENCE_METERS = WHEEL_DIAMETER_METERS * Math.PI;
Copy link
Member

Choose a reason for hiding this comment

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

bro is spaced out

@@ -77,6 +77,13 @@ public SwerveModulePosition getPosition() {
new Rotation2d(turningSpark.getPosition() - chassisAngularOffset));
}


// gets the rotations of the wheel converted to radians
// TODO: change 3.5 into a real number from thad
Copy link
Member

Choose a reason for hiding this comment

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

Todo!!1!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it was todone

// gets the rotations of the wheel converted to radians
// TODO: change 3.5 into a real number from thad
public double getDrivePositionRadians() {
return (drivingSpark.getPosition() / (ModuleConstants.DRIVING_ENCODER_POSITION_FACTOR * ModuleConstants.WHEEL_TO_MOTOR_ROTATIONS)) * 2 * Math.PI;
Copy link
Member

Choose a reason for hiding this comment

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

just confirm the parenthesis are perfect rq while you are here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks good to me!!!

@RudyG252 RudyG252 merged commit 6f53fc7 into main Mar 3, 2024
1 check passed
@RudyG252 RudyG252 deleted the Wheel-Radius-Charaterization branch March 3, 2024 05:01
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