[copybara] Resync with mostrobotpy (#8662)

This commit is contained in:
PJ Reiniger
2026-03-09 00:38:21 -04:00
committed by GitHub
parent 71cd434699
commit c0f8159540
40 changed files with 181 additions and 79 deletions

View File

@@ -69,7 +69,9 @@ class Drivetrain:
"""
robot_velocities = wpimath.ChassisVelocities(xVelocity, yVelocity, rot)
if fieldRelative:
robot_velocities = robot_velocities.toRobotRelative(self.imu.getRotation2d())
robot_velocities = robot_velocities.toRobotRelative(
self.imu.getRotation2d()
)
swerveModuleStates = self.kinematics.toSwerveModuleVelocities(
wpimath.ChassisVelocities.discretize(robot_velocities, periodSeconds)