Skip to content

Commit

Permalink
Appease robotic overlords
Browse files Browse the repository at this point in the history
  • Loading branch information
mlists committed Mar 11, 2024
1 parent 163397c commit b782ba7
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions components/chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def __init__(self) -> None:

self.on_red_alliance = False

self.modules = [
self.modules = (
# Front Left
SwerveModule(
self.WHEEL_BASE / 2,
Expand Down Expand Up @@ -268,7 +268,7 @@ def __init__(self) -> None:
TalonIds.steer_4,
CancoderIds.swerve_4,
),
]
)

self.kinematics = SwerveDrive4Kinematics(
self.modules[0].translation,
Expand All @@ -294,8 +294,17 @@ def __init__(self) -> None:
def get_velocity(self) -> ChassisSpeeds:
return self.kinematics.toChassisSpeeds(self.get_module_states())

def get_module_states(self) -> list[SwerveModuleState]:
return [module.get() for module in self.modules]
def get_module_states(
self,
) -> tuple[
SwerveModuleState, SwerveModuleState, SwerveModuleState, SwerveModuleState
]:
return (
self.modules[0].get(),
self.modules[1].get(),
self.modules[2].get(),
self.modules[3].get(),
)

def setup(self) -> None:
initial_pose = TeamPoses.RED_TEST_POSE if is_red() else TeamPoses.BLUE_TEST_POSE
Expand Down

0 comments on commit b782ba7

Please sign in to comment.