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

Mix up between track width and wheelbase? #14

Open
Chris857 opened this issue Nov 2, 2022 · 0 comments
Open

Mix up between track width and wheelbase? #14

Chris857 opened this issue Nov 2, 2022 · 0 comments

Comments

@Chris857
Copy link

Chris857 commented Nov 2, 2022

In DrivetrainSubsystem.java, when constructing the SwerveDriveKinematics the code reads:

private final SwerveDriveKinematics m_kinematics = new SwerveDriveKinematics(
          // Front left
          new Translation2d(DRIVETRAIN_TRACKWIDTH_METERS / 2.0, DRIVETRAIN_WHEELBASE_METERS / 2.0),
          // Front right
          new Translation2d(DRIVETRAIN_TRACKWIDTH_METERS / 2.0, -DRIVETRAIN_WHEELBASE_METERS / 2.0),
          // Back left
          new Translation2d(-DRIVETRAIN_TRACKWIDTH_METERS / 2.0, DRIVETRAIN_WHEELBASE_METERS / 2.0),
          // Back right
          new Translation2d(-DRIVETRAIN_TRACKWIDTH_METERS / 2.0, -DRIVETRAIN_WHEELBASE_METERS / 2.0)
  );

Each of the Translation2d() takes x and y, where x is a front-back direction and y is a left-right direction. I think that means the first values should be the wheelbase (going fore-aft) and then trackwidth (left-right) i.e. opposite what it currently is.

The signs all seem correct.

P.S. The robot we're currently experimenting with is close enough to square that we might not notice any issue.

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

No branches or pull requests

1 participant