-
Notifications
You must be signed in to change notification settings - Fork 673
[robotpy] Add wpimath/kinematics tests #8461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2027
Are you sure you want to change the base?
[robotpy] Add wpimath/kinematics tests #8461
Conversation
auscompgeek
left a comment
There was a problem hiding this 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.
|
|
||
| def test_initialize(odometry3d_test): | ||
| odometry = MecanumDriveOdometry3d( | ||
| kinematics=odometry3d_test.kinematics, |
There was a problem hiding this comment.
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 :)
| kinematics=odometry3d_test.kinematics, | |
| odometry3d_test.kinematics, |
|
|
||
| def test_optimize(): | ||
| angle_a = Rotation2d.fromDegrees(45) | ||
| ref_a = SwerveModuleState(speed=-2, angle=Rotation2d.fromDegrees(180)) |
There was a problem hiding this comment.
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
Used Gemini to convert the C++ tests in wpimath/.../kinematics to pytest. For ease of use required a better constructor for
MecanumDriveWheelPositionsI 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.