wpilibsuite / allwpilib

Official Repository of WPILibJ and WPILibC
https://wpilib.org/
Other
1.05k stars 612 forks source link

Swerve examples should use absolute encoders for azimuth control #5098

Open Starlight220 opened 1 year ago

Starlight220 commented 1 year ago

Currently they use quadrature encoders. The examples should be changed to use DutyCycleEncoder/AnalogEncoder, and maybe even use Preferences to store azimuth offsets.

sciencewhiz commented 8 months ago

Came up here also: https://www.chiefdelphi.com/t/multiple-ports-channels-for-encoder-corresponding-wiring/446960/3?u=joe_ross

sciencewhiz commented 7 months ago

https://www.chiefdelphi.com/t/has-anyone-swervedrive-in-robotpy-using-neos-and-ctre-encoders/452715/2

spacey-sooty commented 2 months ago

Don't DutyCycleEncoder and AnalogEncoder provide no equivalent to GetRate? Should that be added?

ThadHouse commented 2 months ago

Don't DutyCycleEncoder and AnalogEncoder provide no equivalent to GetRate? Should that be added?

It’s not possible to add a get rate to dce and ae. The way the measure isn’t timed based so getting a rate is completely manual.

spacey-sooty commented 2 months ago

Don't DutyCycleEncoder and AnalogEncoder provide no equivalent to GetRate? Should that be added?

It’s not possible to add a get rate to dce and ae. The way the measure isn’t timed based so getting a rate is completely manual.

Should the examples then show getting the rate from it?