Last active
June 24, 2022 01:37
-
-
Save auginator/3bdc45ffae44afecb9666a3865c42d7a to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetchMachine = Machine({ | |
id: "robotStateTransitions", | |
initial: "auto", | |
context: { | |
lastControlledState: "AUTO", | |
}, | |
actions: { | |
robotModeAutonomous: assign({ | |
lastControlledState: (context ) => "auto" }), | |
robotModeManual: assign({ | |
lastControlledState: (context ) => "manual" | |
})}, | |
states: { | |
auto: { | |
entry: "robotModeAutonomous", | |
on: { | |
MANUAL: "manual", | |
RUN_STOP: "runstopped", | |
LOW_EFFORT: "loweffort", | |
}, | |
}, | |
manual: { | |
entry: "robotModeManual", | |
on: { | |
AUTO: "auto", | |
RUN_STOP: "runstopped", | |
LOW_EFFORT: "manual", | |
}, | |
}, | |
runstopped: { | |
on: { | |
AUTO: undefined, | |
MANUAL: undefined, | |
LOW_EFFORT: "loweffort", | |
DISENGAGE_RUNSTOP: "auto", | |
}, | |
}, | |
loweffort: { | |
on: { | |
RUN_STOP: "runstopped", | |
DISENGAGE_LOW_EFFORT: "auto", | |
}, | |
}, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment