democat3457 / swerve-lib

Fork of SDS swerve code that provides bug fixes and maintenance.
21 stars 16 forks source link

Fix getter of CANCoder absolute angle #5

Closed Baritra1 closed 1 year ago

Baritra1 commented 1 year ago

I apologize if this is wrong (I am not very experienced with pull requests and such), but shouldn't this method be getting the encoder's absolute position based on the name?

democat3457 commented 1 year ago

You are correct in that the getAbsolutePosition() method can be used - however, it is considerably slower than getPosition(), and in conjunction with the BootToAbsolutePosition initialization strategy, using getPosition() is still accurate to the absolute position of the cancoder (and is thus faster and a more efficient way to get the encoder position).