2024Beta
2024Beta copied to clipboard
CTRE Device Simulation Support
RobotPy simulation has a Physics Engine class that is responsible for doing the periodic updates and updating the simulator. In our Java code, inside the subsystem that holds the motor controllers, we'd create a TalonFXSimCollection object, and then inside simulationPeriodic() update the sensor inputs.
So, with CTREs lower level simulation in the past, I did all that in the subsystem. In RobotPy, it's done in the physics engine. Is there a best practice or a sane way to do this in Python?
Essentially, having examples with how to do simulation updates for TalonFXSIM collections inside of a subsystem (in a separate class), while passing information back and forth between the physics engine object, and the subsystem would be awesome.