Skip to content

Commit

Permalink
ALL_CAPS enum members per Python docs recommendation
Browse files Browse the repository at this point in the history
  • Loading branch information
auscompgeek committed Nov 30, 2024
1 parent 040bc65 commit 1423683
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
24 changes: 12 additions & 12 deletions components/chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,33 +240,33 @@ def __init__(self) -> None:
SwerveModule(
self.WHEEL_BASE / 2,
self.TRACK_WIDTH / 2,
TalonId.drive_1,
TalonId.steer_1,
CancoderId.swerve_1,
TalonId.DRIVE_1,
TalonId.STEER_1,
CancoderId.SWERVE_1,
),
# Back Left
SwerveModule(
-self.WHEEL_BASE / 2,
self.TRACK_WIDTH / 2,
TalonId.drive_2,
TalonId.steer_2,
CancoderId.swerve_2,
TalonId.DRIVE_2,
TalonId.STEER_2,
CancoderId.SWERVE_2,
),
# Back Right
SwerveModule(
-self.WHEEL_BASE / 2,
-self.TRACK_WIDTH / 2,
TalonId.drive_3,
TalonId.steer_3,
CancoderId.swerve_3,
TalonId.DRIVE_3,
TalonId.STEER_3,
CancoderId.SWERVE_3,
),
# Front Right
SwerveModule(
self.WHEEL_BASE / 2,
-self.TRACK_WIDTH / 2,
TalonId.drive_4,
TalonId.steer_4,
CancoderId.swerve_4,
TalonId.DRIVE_4,
TalonId.STEER_4,
CancoderId.SWERVE_4,
),
)

Expand Down
24 changes: 12 additions & 12 deletions ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@
class TalonId(enum.IntEnum):
"""CAN ID for CTRE Talon motor controllers (e.g. Talon FX, Talon SRX)."""

drive_1 = 1
steer_1 = 5
DRIVE_1 = 1
STEER_1 = 5

drive_2 = 2
steer_2 = 6
DRIVE_2 = 2
STEER_2 = 6

drive_3 = 3
steer_3 = 7
DRIVE_3 = 3
STEER_3 = 7

drive_4 = 4
steer_4 = 8
DRIVE_4 = 4
STEER_4 = 8


@enum.unique
class CancoderId(enum.IntEnum):
"""CAN ID for CTRE CANcoder."""

swerve_1 = 1
swerve_2 = 2
swerve_3 = 3
swerve_4 = 4
SWERVE_1 = 1
SWERVE_2 = 2
SWERVE_3 = 3
SWERVE_4 = 4


@enum.unique
Expand Down

0 comments on commit 1423683

Please sign in to comment.