jsk-ros-pkg / jsk_roseus

ROS EusLisp Client
http://wiki.ros.org/roseus/Tutorials
17 stars 56 forks source link

add nested example with make-state-machine function #661

Closed k-okada closed 3 years ago

k-okada commented 3 years ago

we need to write

        (setq sm-top
              (make-state-machine
               '((:bas :outcome3 :sub) ;; transitions
                 (:sub :outcome4 :outcome5))
               `((:bas 'func-bas)  ;; functon maps
                 (:sub ,sm-sub))   ;; set "nestaed state machine"
               '(:bas)      ;; initial
               '(:outcome5) ;; goal
               ))

otherwise, you will have

```
/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...
k-okada commented 3 years ago

@Kanazawanaoaki please look at https://github.com/k-okada/jsk_roseus/blob/8d88ed9017556dee9fef89f0c6df624ffb7f7263/roseus_smach/sample/state-machine-sample.l#L99-L120 , on how to write nested smach with make-state-machine