Skip to content

Commit

Permalink
Merge pull request #735 from knorth55/state-machine-flatten
Browse files Browse the repository at this point in the history
[roseus_smach] add flatten option for submachine search
  • Loading branch information
k-okada committed Jan 24, 2023
2 parents 3cff147 + 92a41d9 commit 3ae9dd6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions roseus_smach/src/state-machine.l
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit 3ae9dd6

Please sign in to comment.