Skip to content

Conversation

@pjreiniger
Copy link
Contributor

Used Gemini to convert the C++ tests in wpimath/.../kinematics to pytest. For ease of use required a better constructor for MecanumDriveWheelPositions

I did this conversion months ago (before robotpy landed and before the reorg), so new tests might be missing. At least its better than nothing 🤷

Broke the huge pr that does almost everything into parts so its easier to review.

@pjreiniger pjreiniger requested a review from a team as a code owner December 9, 2025 06:37
@github-actions github-actions bot added component: wpimath Math library 2027 2027 target labels Dec 9, 2025
Copy link
Member

@auscompgeek auscompgeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favour of more tests, but they should use the library similarly to how we expect teams to use it.

@Gold856 Gold856 added the robotpy Issues that affect RobotPy (Python) support label Dec 24, 2025

def test_initialize(odometry3d_test):
odometry = MecanumDriveOdometry3d(
kinematics=odometry3d_test.kinematics,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think it's obvious what this param is already :)

Suggested change
kinematics=odometry3d_test.kinematics,
odometry3d_test.kinematics,


def test_optimize():
angle_a = Rotation2d.fromDegrees(45)
ref_a = SwerveModuleState(speed=-2, angle=Rotation2d.fromDegrees(180))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: given the components of these vectors have different types, I think it's clear enough from the types alone what each param is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2027 2027 target component: wpimath Math library robotpy Issues that affect RobotPy (Python) support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants