robotpy / robotpy-wpilib-utilities

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

will_reset_to resets before the execute method in a component when using StateMachines #162

Closed CrispyBacon1999 closed 4 years ago

CrispyBacon1999 commented 4 years ago

When using state machines, the will_reset_to variables reset themselves back to the default value before that value can be used in the execute method for the component can be called.

https://gist.github.com/CrispyBacon1999/c495be4015993f88e0410cd93826821b

In the example, the speed variable would have the proper value at the end of move(), but then would be 0 before it can be used in execute()

virtuald commented 4 years ago

Not a bug. Move the arm after the arm_sm in your robot class.