Skip to content

Commit

Permalink
Run black 24.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
auscompgeek committed Jan 26, 2024
1 parent 24fea60 commit b0e5f19
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 7 additions & 5 deletions MecanumBot/drivetrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,13 @@ def drive(
"""Method to drive the robot using joystick info."""
mecanumDriveWheelSpeeds = self.kinematics.toWheelSpeeds(
ChassisSpeeds.discretize(
ChassisSpeeds.fromFieldRelativeSpeeds(
xSpeed, ySpeed, rot, self.gyro.getRotation2d()
)
if fieldRelative
else ChassisSpeeds(xSpeed, ySpeed, rot),
(
ChassisSpeeds.fromFieldRelativeSpeeds(
xSpeed, ySpeed, rot, self.gyro.getRotation2d()
)
if fieldRelative
else ChassisSpeeds(xSpeed, ySpeed, rot)
),
periodSeconds,
)
)
Expand Down
12 changes: 7 additions & 5 deletions SwerveBot/drivetrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@ def drive(
"""
swerveModuleStates = self.kinematics.toSwerveModuleStates(
wpimath.kinematics.ChassisSpeeds.discretize(
wpimath.kinematics.ChassisSpeeds.fromFieldRelativeSpeeds(
xSpeed, ySpeed, rot, self.gyro.getRotation2d()
)
if fieldRelative
else wpimath.kinematics.ChassisSpeeds(xSpeed, ySpeed, rot),
(
wpimath.kinematics.ChassisSpeeds.fromFieldRelativeSpeeds(
xSpeed, ySpeed, rot, self.gyro.getRotation2d()
)
if fieldRelative
else wpimath.kinematics.ChassisSpeeds(xSpeed, ySpeed, rot)
),
periodSeconds,
)
)
Expand Down

0 comments on commit b0e5f19

Please sign in to comment.