robotpy / robotpy-commands-v2

Python implementation of the WPILib Command Framework (2020+)
Other
2 stars 14 forks source link

Adds basic SwerveControllerCommand #45

Closed TheTripleV closed 4 months ago

TheTripleV commented 4 months ago

Simple version of #38 .

Doesn't depend on overtake and beartype.

Only has 1 definition.

The existing java one is a matrix of

  1. 3 separate pid controllers vs 1 holonomic controller
  2. Is desired rotation specified?

This leads to 4 total overloads.

  1. The sugar java provides is just pid1, pid2, pid3 -> HolonomicDriveController(pid1, pid2, pid3). I added that to the docstring instead. That's a tiny amount of sugar.
  2. I made desired rotation optional.

Tests: Like java, I only tested 4 swerve modules. No one uses 2/3/6 anyway.