[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

@@ -88,7 +88,9 @@ class Drivetrain:
self.rightLeader.setInverted(True)
wpilib.SmartDashboard.putData("Field", self.fieldSim)
def setVelocities(self, velocities: wpimath.DifferentialDriveWheelVelocities) -> None:
def setVelocities(
self, velocities: wpimath.DifferentialDriveWheelVelocities
) -> None:
"""Sets velocities to the drivetrain motors."""
leftFeedforward = self.feedforward.calculate(velocities.left)
rightFeedforward = self.feedforward.calculate(velocities.right)
@@ -109,7 +111,9 @@ class Drivetrain:
:param rot: the rotation
"""
self.setVelocities(
self.kinematics.toWheelVelocities(wpimath.ChassisVelocities(xVelocity, 0, rot))
self.kinematics.toWheelVelocities(
wpimath.ChassisVelocities(xVelocity, 0, rot)
)
)
def updateOdometry(self) -> None: