Skip to content

Commit

Permalink
pass userdata as arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
knorth55 committed Oct 20, 2022
1 parent 9bfbb39 commit bcef5fa
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions roseus_smach/src/state-machine-utils.l
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ Args:
Returns:
the last active state
"
(let ((insp (instance state-machine-inspector :init sm :root-name root-name :srv-name srv-name))
(userdata mydata))
(let ((insp (instance state-machine-inspector :init sm :root-name root-name :srv-name srv-name)))
(unix::usleep (round (* 0.5 1e6)))
(send sm :reset-state)
(send insp :publish-structure) ;; publish once and latch
Expand All @@ -44,9 +43,9 @@ Returns:
(ros::ros-warn "aborting...")
(return))
(t (error "value of key :iterate must be t or function"))))))
(if before-hook-func (funcall before-hook-func))
(if before-hook-func (funcall before-hook-func mydata))
(send sm :execute mydata :step -1)
(if after-hook-func (funcall after-hook-func))
(if after-hook-func (funcall after-hook-func mydata))
(ros::sleep))
(send sm :active-state))))

Expand Down

0 comments on commit bcef5fa

Please sign in to comment.