Skip to content

Commit

Permalink
Attempt to fix vendordep crashing.
Browse files Browse the repository at this point in the history
Signed-off-by: thenetworkgrinch <thenetworkgrinch@users.noreply.github.com>
  • Loading branch information
thenetworkgrinch committed Jun 14, 2024
1 parent 5bbd16c commit 4271af0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/main/java/swervelib/SwerveDrive.java
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,8 @@ public ChassisSpeeds getRobotVelocity()
public void resetOdometry(Pose2d pose)
{
odometryLock.lock();
swerveDrivePoseEstimator.resetPosition(getYaw(), getModulePositions(), pose);
SwerveModulePosition[] positions = getModulePositions();
swerveDrivePoseEstimator.resetPosition(getYaw(), positions, pose);
odometryLock.unlock();
kinematics.toSwerveModuleStates(ChassisSpeeds.fromFieldRelativeSpeeds(0, 0, 0, getYaw()));
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/swervelib/SwerveModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public class SwerveModule
/**
* Module number for kinematics, usually 0 to 3. front left -> front right -> back left -> back right.
*/
public int moduleNumber;
public final int moduleNumber;
/**
* Maximum speed of the drive motors in meters per second.
*/
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/swervelib/parser/SwerveDriveConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ public class SwerveDriveConfiguration
/**
* Swerve Module locations.
*/
public Translation2d[] moduleLocationsMeters;
public Translation2d[] moduleLocationsMeters;
/**
* Swerve IMU
*/
public SwerveIMU imu;
public SwerveIMU imu;
/**
* Number of modules on the robot.
*/
public int moduleCount;
public final int moduleCount;
/**
* Swerve Modules.
*/
public SwerveModule[] modules;
public SwerveModule[] modules;
/**
* Physical characteristics of the swerve drive from physicalproperties.json.
*/
public SwerveModulePhysicalCharacteristics physicalCharacteristics;
public SwerveModulePhysicalCharacteristics physicalCharacteristics;

/**
* Create swerve drive configuration.
Expand Down

0 comments on commit 4271af0

Please sign in to comment.