Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Swerve drive proto #6

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open

Swerve drive proto #6

wants to merge 28 commits into from

Conversation

WAaron-500
Copy link

@WAaron-500 WAaron-500 commented May 20, 2022

(https://github.com/wpilibsuite/allwpilib/tree/main/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervecontrollercommand)
Need to do PID for position first in order to truly have it work
Most of the effort will be in tuning PID

@WAaron-500
Copy link
Author

Someone needs to check the odometry work because I have no clue what to do with odometry lol. Current system is how I imagine odometry will go down. Will change it for when better odometry gets made and tested

src/main/java/frc/util/SwerveModuleMath.java Outdated Show resolved Hide resolved
src/main/java/frc/util/SwerveModuleConfig.java Outdated Show resolved Hide resolved
src/main/java/frc/util/SwerveModuleConfig.java Outdated Show resolved Hide resolved
src/main/java/frc/util/SwerveModuleConfig.java Outdated Show resolved Hide resolved
@WAaron-500
Copy link
Author

WAaron-500 commented May 20, 2022

Shreyas to do: Add Better Odometry bc my odometry sucs

Shorya and Lydia to do (Aaron Supervision): Format, read, understand, find better way to configure PID, also check Bonus assignment (making/editing the SwerveDrive.java command to create a second mode. Currently it's in FO or Field orientated mode (I think depends on if I did the odometry right, but after Shreyas puts in his odometry it should be FO). Find a way to make it DO or driver orientated).

Yash to do (Aaron Supervision): Documentation and porting over the current utils to the mech tech support kit. This is the kit that will be passed down every year, so this is important job. Let me know if you need help with that. Optimize the SwerveModuleConfig.java file... Very messy and could use some polishing.

Aaron to do:

Jakson if available (if not I got it):

Sean to do: Make Vision Lock on command

  • Cancoder
  • PID Tuner
  • Better Odometry
  • Formating
  • Documentation
  • Vision Lock On
  • Mech Tech Support Port

Comment on lines +37 to +40
//Encoder Config
this.steerEncoder = steer.getEncoder();
steerEncoder.setPositionConversionFactor(2048);
this.steerAbsEncoder = new CANCoder(steerEncoderID);
Copy link
Author

Choose a reason for hiding this comment

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

Somewhere here you need to sync the absolute and regular encoder

Comment on lines +41 to +42
steerAbsEncoder.configAbsoluteSensorRange(AbsoluteSensorRange.Unsigned_0_to_360);

Copy link
Author

Choose a reason for hiding this comment

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

This should be signed pm 180

Comment on lines +33 to +35
public static double wheelDegreesToTicks(double degrees, double gearRatio) {
return (degrees * 360.0 * gearRatio / 2048);
}
Copy link
Author

Choose a reason for hiding this comment

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

needs to be flipped (2048/360)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants