How to Construct new SwerveDriveOdometry with MK4i Modules

As you may know the way to construct the Odometry object for swerve and other drive bases was modified following the recent changes to the new wpilib. The SwerveDriveOdometry object now takes in modulepositions as an additional argument. My question is how am I supposed to get my module positions from my modules?

The SDS SwerveModule class only has methods for getting the drive velocity and angle of the module but nothing like “module1.getPosition()”. Does anyone have any suggestions on what to do?

The SDS library for swerve isn’t maintained anymore. It shouldn’t be used. Try using something like 364’s BaseFalconSwerve if you have falcons or some other teams base neo swerve code. There is a thread somewhere here with links to a few good options for base codebases. SDS lib is not up to date anymore.

As far as continuing to use SDS lib goes, you could probably modify some classes and use the NEO or Falcon motors integrated encoder to get the distance for the module and the angle method can be used to get the angle. You can then put those two pieces of info together to get a SwerveModulePosition.

oh yikes i didnt even know that

So I have to change all the stuff ive been doing like the way i construct my modules and all that?

Do you know what thread this is? Also why would they discontinue SDS lib if so many people use their modules

SDS Lib just had a lot of issues. They stopped maintaining it since most of the alternatives are better. I’m not in a position right now to help anymore and give more details but i’m sure others can help.

Have they said this, or is it speculation on why there haven’t been updates?

They haven’t said anything. In fact, they published the initial release on Chief Delphi a year ago and haven’t touched it since.