From 92a41d9e1f0e669258325f8b72e494b052c42cc8 Mon Sep 17 00:00:00 2001 From: Shingo Kitagawa Date: Tue, 6 Dec 2022 21:50:12 +0900 Subject: [PATCH] add flatten option for submachine search --- roseus_smach/src/state-machine.l | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/roseus_smach/src/state-machine.l b/roseus_smach/src/state-machine.l index 505fcb2ac..e935dfb39 100644 --- a/roseus_smach/src/state-machine.l +++ b/roseus_smach/src/state-machine.l @@ -20,6 +20,17 @@ (:init (&key (parallel nil)) (setq parallel-action-p parallel) self) + (:node (name &key (flatten nil)) + (if (and flatten (send self :sub-sm-node)) + (find name (send self :nodes :flatten t) + :key #'(lambda (x) (send x :name)) :test #'equal) + (send-super :node name))) + (:nodes (&key (flatten nil)) + (if (and flatten (send self :sub-sm-node)) + (append + (send-super :nodes) + (flatten (send-all (send-all (send self :sub-sm-node) :submachine) :nodes :flatten t))) + (send-super :nodes))) (:active-state (&rest args) (let ((node (car args)))