TechnoTitans / TitanWare2024

Crescendo 2024
Other
3 stars 1 forks source link

Simulation state update should happen faster than 50Hz #19

Closed HarryXChen3 closed 8 months ago

HarryXChen3 commented 9 months ago

Currently, sim state updates (such as updates done to TalonFXSimStates) are triggered in the main robot loop at the nominal loop period (20ms, or 50Hz). CTRE recommends that the sim state be updated as fast as possible (e.g. 5ms period) while in simulation to simulate on-robot CAN bus behavior - this is shown here.

We currently primarily update the sim states in classes such as CTREPhoenix6TalonFXSim, and there isn't an immediately obvious way to invoke these updates faster than the main robot cycle - thus, this issue now exists for us to figure it out 😄.