Skip to content

Commit

Permalink
Merge pull request #701 from knorth55/bottom-active-state
Browse files Browse the repository at this point in the history
[roseus_smach] add bottom-active-state
  • Loading branch information
k-okada committed Jul 27, 2022
2 parents bd1e2b1 + 39fc97b commit 0ac603d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions roseus_smach/src/state-machine.l
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@
#'(lambda(n)(send (send n :submachine) :active-state node))
(send self :sub-sm-node)))))
))
(:bottom-active-state (&optional top-active-state)
(if (null top-active-state)
(setq top-active-state active-state))
(if (and top-active-state (listp top-active-state))
(flatten
(mapcar #'(lambda (x) (send self :bottom-active-state x))
top-active-state))
(if (and top-active-state (send top-active-state :submachine))
(let ((sub-active-state
(send (send top-active-state :submachine) :bottom-active-state)))
(if sub-active-state
sub-active-state top-active-state))
top-active-state)))
(:next-arc-list
(&optional state)
(send state :arc-list))
Expand Down

0 comments on commit 0ac603d

Please sign in to comment.