Skip to content

Commit

Permalink
create falcon motor variable
Browse files Browse the repository at this point in the history
  • Loading branch information
LeanMeanBeanMachine4774 committed Nov 19, 2024
1 parent d3c2afa commit 77093a2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ def __init__(
gearing: float,
moi: kilogram_square_meters,
):
self.plant = LinearSystemId.DCMotorSystem(DCMotor.falcon500(), moi, gearing)
self.falcon = DCMotor.falcon500(len(motors))
self.plant = LinearSystemId.DCMotorSystem(self.falcon, moi, gearing)
self.gearing = gearing
self.sim_states = [motor.sim_state for motor in motors]
for sim_state in self.sim_states:
sim_state.set_supply_voltage(12.0)
self.motor_sim = DCMotorSim(self.plant, DCMotor.falcon500(len(motors)))
self.motor_sim = DCMotorSim(self.plant, self.falcon)

def update(self, dt: float) -> None:
voltage = self.sim_states[0].motor_voltage
Expand Down

0 comments on commit 77093a2

Please sign in to comment.