Finite State Machine
有限状态机FSMCommonA model where a system is always in exactly one of a fixed set of states, switching states according to fixed rules on each event.
A finite state machine is a computational model in which a system is, at any moment, in exactly one of a fixed set of states, and moves to a different state according to predetermined rules whenever it receives a particular input or event, with each state corresponding to a fixed set of behaviors. A classic example is a subway turnstile: inserting a coin switches it from 'locked' to 'unlocked,' and someone passing through switches it back to 'locked.' In robotics it's commonly used to manage operating modes and task flow — such as the sequence from power-on zero-torque, to standing, to walking, to damping, or the 'approach → grasp → lift → place' sequence in a pick-and-place routine — with the benefit of clear, easy-to-check logic. Its drawback is that it becomes hard to maintain once the number of states and transitions grows large, which is why complex tasks increasingly use behavior trees instead, since they're more modular and adapt more easily to new situations on the fly.
ExampleUnitree's G1 high-level motion interface manages modes directly by numbered states: 0 is zero-torque, 1 is damping, 2 is squatting, 3 is sitting, 4 is standing up, and 500 is start-moving; calling Damp() in the SDK simply switches the state machine to state 1.
- Also called
- FSM, State Machine
- Related
- Behavior Tree · Damping Mode · Task Planning · Hierarchical Control · BehaviorTree.CPP · Unitree SDK2
- Sources
- Wikipedia: Finite-state machine
unitree_sdk2 g1_loco_client.hpp(SetFsmId / Damp / ZeroTorque)
Behavior Trees in Robotics and AI: An Introduction (arXiv 1709.00084)