-
Notifications
You must be signed in to change notification settings - Fork 2
Swerve gil #302
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
base: dev
Are you sure you want to change the base?
Swerve gil #302
Conversation
TurtleMinecraft
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctrl alt l ctrl alt o every file after finishing
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveDrivetrain.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveDrivetrain.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveDrivetrain.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveDrivetrain.java
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveModule.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveModule.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveModule.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveModule.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/commands/DriveSwerve.java
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/commands/DriveSwerve.java
Outdated
Show resolved
Hide resolved
not sure if this is any better, perhaps I should name it timeStep?
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveDrivetrain.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveDrivetrain.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveDrivetrain.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveModule.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveModule.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveModule.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveModule.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveModule.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveModule.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveDrivetrain.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveDrivetrain.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveDrivetrain.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveDrivetrain.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveDrivetrain.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveDrivetrain.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveDrivetrain.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveDrivetrain.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveDrivetrain.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/commands/TurnToDegree.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveDrivetrain.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveDrivetrain.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/commands/DriveSwerve.java
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/commands/TurnModules.java
Outdated
Show resolved
Hide resolved
src/main/java/com/spikes2212/command/drivetrains/swerve/commands/TurnModules.java
Outdated
Show resolved
Hide resolved
| * @param maxPossibleVelocity the maximum possible velocity of the drive motors | ||
| */ | ||
| public SwerveDrivetrain(String namespaceName, SwerveModule frontLeftModule, SwerveModule frontRightModule, | ||
| SwerveModule backLeftModule, SwerveModule backRightModule, double halfDrivetrainTrackWidth, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
giving half of a value as a parameter is clunky imo. it's not horrible, but i think you should change it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have no need for the full parameters, besides this allows me to write the position formula in a much nicer way
| * @param halfDrivetrainTrackLength half the length of the drivetrain | ||
| * @param maxPossibleVelocity the maximum possible velocity of the drive motors | ||
| */ | ||
| public SwerveDrivetrain(SwerveModule frontLeftModule, SwerveModule frontRightModule, SwerveModule backLeftModule, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
src/main/java/com/spikes2212/command/drivetrains/swerve/SwerveDrivetrain.java
Outdated
Show resolved
Hide resolved
| /** | ||
| * Resets the field relativity to be the same as the robot relativity. | ||
| */ | ||
| public abstract void resetFieldRelative(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to help both generality and simplicity for the user, I suggest creating an abstract method called resetGyro(), making this method non-abstract and having it call resetGyro()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but the whole point of this library is that fit's anything. if i knew i had a gyro this whole library would have been so much easier to write, but since i made this library general and non specific my functions are non specific as well and allow the user to use whichever sensor and method they would like
added the most simple version of classes needed to program a swerve drivetrain into spikesLib. Most likely will later on create more complicated version with odometry, paths (using {PathPlanner), sysID etc. This list is desired but I will not promise anything yet.