Skip to content

Conversation

@goooooooooooooooooose
Copy link
Contributor

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.

Copy link
Member

@TurtleMinecraft TurtleMinecraft left a 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

* @param maxPossibleVelocity the maximum possible velocity of the drive motors
*/
public SwerveDrivetrain(String namespaceName, SwerveModule frontLeftModule, SwerveModule frontRightModule,
SwerveModule backLeftModule, SwerveModule backRightModule, double halfDrivetrainTrackWidth,

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

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 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,

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ditto

/**
* Resets the field relativity to be the same as the robot relativity.
*/
public abstract void resetFieldRelative();

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()

Copy link
Contributor Author

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

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.

5 participants