Skip to content

Commit

Permalink
add exec-smach-userdata-hook in sample
Browse files Browse the repository at this point in the history
  • Loading branch information
knorth55 committed Oct 20, 2022
1 parent bcef5fa commit 9a75aac
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions roseus_smach/sample/state-machine-ros-sample.l
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,13 @@
(defun exec-smach-simple () (setq count 0) (exec-state-machine (smach-simple)))
(defun exec-smach-nested () (setq count 0) (exec-state-machine (smach-nested)))
(defun exec-smach-userdata () (exec-state-machine (smach-userdata) '((count . 1))))

(warn ";;(exec-smach-simple)~%;;(exec-smach-nested)~%;;(exec-smach-userdata)~%")
(defun exec-smach-userdata-hook ()
(exec-state-machine
(smach-userdata) '((count . 1))
:before-hook-func
#'(lambda (userdata) (ros::ros-warn (format nil "userdata (before): ~A" userdata)))
:after-hook-func
#'(lambda (userdata) (ros::ros-warn (format nil "userdata (after): ~A" userdata)))
))

(warn ";;(exec-smach-simple)~%;;(exec-smach-nested)~%;;(exec-smach-userdata)~%;;(exec-smach-userdata-hook)~%")

0 comments on commit 9a75aac

Please sign in to comment.