You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An important use, of a subsystem as a Finite State Machine and its dependent commands as States of that FSM upon a trigger/button event to initiate a transition from one state to another, depends on the following sequence:
the end method of the current (interrupted) command (state) is run before the initialize method of the new (interrupting) command (state).
Using state exit and enter like this somewhat special case depends on the user correctly specifying a FSM as a subsystem and that subsystem being a requirement of all the commands that reflect states of that FSM and the commands can be interrupted by subsequent commands.
WPILib supports that sequence and adding detail to the documentation to describe that case works would help users.
Just to make sure I understand, the request here is to clarify that interrupted command end is called before interrupting command init?
Anything more than that?
Yes and all this happens in the same timestep to provide a bump-less transition to a new state:
event triggers new command with dependency on a subsystem
end() the running command for that subsystem
initialize() new command for that subsystem
In ChiefDelphi I made this comment about an example application of this feature is to make a smooth, safe motor speed transition (assuming the motor set() speed is also properly handled and that might not be obvious coding).
Regarding Document
An important use, of a subsystem as a Finite State Machine and its dependent commands as States of that FSM upon a trigger/button event to initiate a transition from one state to another, depends on the following sequence:
the
end
method of the current (interrupted) command (state) is run before theinitialize
method of the new (interrupting) command (state).Using state exit and enter like this somewhat special case depends on the user correctly specifying a FSM as a subsystem and that subsystem being a requirement of all the commands that reflect states of that FSM and the commands can be interrupted by subsequent commands.
WPILib supports that sequence and adding detail to the documentation to describe that case works would help users.
ChiefDelphi reference
The text was updated successfully, but these errors were encountered: