robotpy / robotpy-wpilib-utilities

Useful utility functions/objects for RobotPy
BSD 3-Clause "New" or "Revised" License
11 stars 19 forks source link

magicbot: Reset will_reset_to after robotPeriodic #202

Closed auscompgeek closed 1 year ago

auscompgeek commented 1 year ago

This changes the behaviour of will_reset_to to be reset after all user methods are called. The intent is to avoid @feedback methods observing the reset value before the end of the control loop iteration.

Currently the only way to achieve this is to reset the variables in robotPeriodic.

auscompgeek commented 1 year ago

Turns out will_reset_to is documented to take effect "at the very end of each control loop". Guess I'll merge this now to fix this bug :)