4 ms·
I quite like the concise state machine definitions used in Rodney Brooks' "A Robust Layered Control System for a Mobile Robot"[0]. The first element is the stat
by v9v 2y ago
I quite like the concise state machine definitions used in Rodney Brooks' "A Robust Layered Control System for a Mobile Robot"[0]. The first element is the state name, and whatever is returned is the next state.
(defmodule avoid
:inputs (force heading)
:outputs (command)
:instance-vars (resultforce)
:states ((nil (event-dispatch (and force heading) plan))
(plan (setf resultforce (select-direction force heading))
go)
(go (conditional-dispatch (significant-force-p resultforce 1.0)
start
nil))
(start (output command (follow-force resultforce))
nil)))
[0] https://www.semanticscholar.org/paper/A-robust-layered-control-system-for-a-mobile-robot-Brooks/fb39b30187babe9bee4afb30b034b5f93b74859a https://www.semanticscholar.org/paper/A-robust-layered-contr...