When updating the Swerve documentation on frc-docs, it was noted that the swerve APIs for RobotPy are currently rather inconsistent. Sometimes we take a list/tuple of things:
class SwerveDrive2KinematicsBase
def toChassisSpeeds(self, wheelSpeeds: tuple[SwerveModuleState, SwerveModuleState]) -> ChassisSpeeds:
And sometimes we take an expanded set of arguments:
class SwerveDrive4Odometry(SwerveDrive4OdometryBase):
def update(self, arg0: wpimath.geometry._geometry.Rotation2d, arg1: SwerveModulePosition, arg2: SwerveModulePosition, arg3: SwerveModulePosition, arg4: SwerveModulePosition) -> wpimath.geometry._geometry.Pose2d:
I looked at it, and it seems the only real way to make it truly consistent is to change all of the APIs to use a tuple/list when taking N parameters. This will break some team’s existing code.
Technically we could do both overloads, but I think that might be confusing.
What do you think? Make it consistent using tuples or keep it as is?