No version for distro humble showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

roseus_smach package from jsk_roseus repo

jsk_roseus roseus roseus_mongo roseus_smach roseus_tutorials

ROS Distro
lunar

Package Summary

Tags No category tags.
Version 1.7.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_roseus.git
VCS Type git
VCS Version master
Last Updated 2025-02-13
Dev Status DEVELOPED
CI status Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

roseus_smach * Euslisp state machine class. it will be moved. * Message publisher for visualizing current state by smach_viewer. * Simple pickle dump script for debugging state machine. * Execute state machine as a action server.

Additional Links

Maintainers

  • Kei Okada

Authors

  • Manabu Saito

roseus_smach

This package includes euslisp implementation of state machine and smach.

requirements

  • roseus
  • smach
  • smach_viewer
    • Optional for visualization.
    • You have to install this package manually:
      sudo apt install ros-$ROS_DISTRO-smach-viewer

sample

Sample codes are available on sample directory.

  • rosrun roseus_smach state-machine-ros-sample.l
    • simple state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-simple)
  
  • nested state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-nested)
  
  • state machine with userdata
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-userdata)
  
  • sample/parallel-state-machine-sample.l

    • state machine with parallel action execution
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach parallel-state-machine-sample.l
  (demo)
  

Writing Simple Smach(state-machine)

Example codes are here.

#!/usr/bin/env roseus
(load "package://roseus_smach/src/state-machine.l")

(setq count 0)
(defun func-foo (userdata-alist)
  (format t "Execute state FOO~%")
  (cond ((< count 3) (incf count) :outcome1)
	(t :outcome2)))
(defun func-bar (userdata-alist)
  (format t "Execute state BAR~%")
  :outcome2)

(defun smach-simple ()
  (let ((sm (instance state-machine :init)))
    (send sm :add-node (instance state :init :FOO 'func-foo))
    (send sm :add-node (instance state :init :BAR 'func-bar))
    ;; goal-states are generated in this method
    (send sm :goal-state (list :outcome4 :outcome5))

    ;; select a node as start-node
    (send sm :start-state :FOO)
    ;; from and to nodes are selected by name or symbol
    (send sm :add-transition :FOO :BAR :outcome1)
    (send sm :add-transition :FOO :outcome4 :outcome2)
    (send sm :add-transition :BAR :FOO :outcome2)
    sm ))

(send (smach-simple) :execute nil)

The Code Explained

(load "package://roseus_smach/src/state-machine.l")

This line imports state-machine class, state class, and transition class.

```lisp (defun func-foo (userdata-alist)

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package roseus_smach

1.7.5 (2021-12-13)

  • [roseus_smach] add :append-goal-state (#696)

  • add nested example with make-state-machine function (#661)

    • add readme on smach-simple-nested

    * use defmacro instead of defun for make-simple-state without this, 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 ))[ to avoid ]{.title-ref}/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...[ errors, this change enable us to write intuitive way ]{.title-ref}'((:bas 'func-bas) ;; functon maps (:sub sm-sub)) ;; set "nestaed state machine"[ you can test this behavior with ]{.title-ref}(defmacro test (l) `(dolist (e ,l) (print e) (print (eval (cadr e))))) (defmacro test (l) (dolist (e l) (print e) (print (eval (cadr e))))) (let (a) (setq a 10) (test '((:foo 1) (:bar a))))`

  • [roseus_smach] make roseus_smach execution faster (#684)

    • sleep 0.5 s for publisher
    • use ros::sleep for smach execution
  • [roseus_smach] add more ros-info in convert-smach (#683)

  • [roseus_smach] fix typo in state-machine-utils.l (#693)

  • [roseus_smach] add :start-state and :goal-state in convert-smach (#682)

  • [roseus_smach] add groupname in state-machine-inspector (#691)

    • use send sm :spin-once in state-machine-utils.l
    • add groupname and spin-once with groupname
  • Updates to README sample code and explanations (#659)

    • extend test time limit to 120 sec for test-samples.l
    • add example/test for smach-simple with make-state-machine function
    • write more info similar to rospy implementation
    • add more info(URL/python code) on sample
    • fix typo of nestate state machine example path
    • add make-sample-parallel-state-machine tests
    • add more test, check :active-tates, duration time
  • [roseus_smach] use roseus for parallel-state-machine-sample (#651)

  • [roseus_smach] add smach_viewer installation to README (#641)

  • [roseus_smach] add code explanation of simple-state-machine in README.md. (#627)

  • Contributors: Guilherme Affonso, Kei Okada, Naoki Hiraoka, Naoya Yamaguchi, Shingo Kitagawa, Yoichiro Kawamura

1.7.4 (2019-02-04)

1.7.3 (2019-02-01)

  • check why test-smach-action-client-state failing on installed test (#570 )
  • fix make-state-machine docstring (#589 )
  • re-enable test-smach-action-client-state, which is removed in https://github.com/jsk-ros-pkg/jsk_roseus/pull/567#issuecomment-406841511
  • Add issue link in make-state-machine docstring (#595 )
  • roseus_smach: change the order of callee args for userdata in pddl2smach (#587)
  • roseus_smach: pass userdata values unless :arg-keys is set (#586)
    • roseus_smach: fix error on exec state machine without ri
  • Contributors: Guilherme Affonso, Yuki Furuta, Shingo Kitagawa

1.7.2 (2018-11-10)

1.7.1 (2018-07-22)

File truncated at 100 lines see the full file

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Dependant Packages

No known dependants.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged roseus_smach at Robotics Stack Exchange

No version for distro jazzy showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

roseus_smach package from jsk_roseus repo

jsk_roseus roseus roseus_mongo roseus_smach roseus_tutorials

ROS Distro
lunar

Package Summary

Tags No category tags.
Version 1.7.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_roseus.git
VCS Type git
VCS Version master
Last Updated 2025-02-13
Dev Status DEVELOPED
CI status Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

roseus_smach * Euslisp state machine class. it will be moved. * Message publisher for visualizing current state by smach_viewer. * Simple pickle dump script for debugging state machine. * Execute state machine as a action server.

Additional Links

Maintainers

  • Kei Okada

Authors

  • Manabu Saito

roseus_smach

This package includes euslisp implementation of state machine and smach.

requirements

  • roseus
  • smach
  • smach_viewer
    • Optional for visualization.
    • You have to install this package manually:
      sudo apt install ros-$ROS_DISTRO-smach-viewer

sample

Sample codes are available on sample directory.

  • rosrun roseus_smach state-machine-ros-sample.l
    • simple state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-simple)
  
  • nested state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-nested)
  
  • state machine with userdata
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-userdata)
  
  • sample/parallel-state-machine-sample.l

    • state machine with parallel action execution
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach parallel-state-machine-sample.l
  (demo)
  

Writing Simple Smach(state-machine)

Example codes are here.

#!/usr/bin/env roseus
(load "package://roseus_smach/src/state-machine.l")

(setq count 0)
(defun func-foo (userdata-alist)
  (format t "Execute state FOO~%")
  (cond ((< count 3) (incf count) :outcome1)
	(t :outcome2)))
(defun func-bar (userdata-alist)
  (format t "Execute state BAR~%")
  :outcome2)

(defun smach-simple ()
  (let ((sm (instance state-machine :init)))
    (send sm :add-node (instance state :init :FOO 'func-foo))
    (send sm :add-node (instance state :init :BAR 'func-bar))
    ;; goal-states are generated in this method
    (send sm :goal-state (list :outcome4 :outcome5))

    ;; select a node as start-node
    (send sm :start-state :FOO)
    ;; from and to nodes are selected by name or symbol
    (send sm :add-transition :FOO :BAR :outcome1)
    (send sm :add-transition :FOO :outcome4 :outcome2)
    (send sm :add-transition :BAR :FOO :outcome2)
    sm ))

(send (smach-simple) :execute nil)

The Code Explained

(load "package://roseus_smach/src/state-machine.l")

This line imports state-machine class, state class, and transition class.

```lisp (defun func-foo (userdata-alist)

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package roseus_smach

1.7.5 (2021-12-13)

  • [roseus_smach] add :append-goal-state (#696)

  • add nested example with make-state-machine function (#661)

    • add readme on smach-simple-nested

    * use defmacro instead of defun for make-simple-state without this, 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 ))[ to avoid ]{.title-ref}/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...[ errors, this change enable us to write intuitive way ]{.title-ref}'((:bas 'func-bas) ;; functon maps (:sub sm-sub)) ;; set "nestaed state machine"[ you can test this behavior with ]{.title-ref}(defmacro test (l) `(dolist (e ,l) (print e) (print (eval (cadr e))))) (defmacro test (l) (dolist (e l) (print e) (print (eval (cadr e))))) (let (a) (setq a 10) (test '((:foo 1) (:bar a))))`

  • [roseus_smach] make roseus_smach execution faster (#684)

    • sleep 0.5 s for publisher
    • use ros::sleep for smach execution
  • [roseus_smach] add more ros-info in convert-smach (#683)

  • [roseus_smach] fix typo in state-machine-utils.l (#693)

  • [roseus_smach] add :start-state and :goal-state in convert-smach (#682)

  • [roseus_smach] add groupname in state-machine-inspector (#691)

    • use send sm :spin-once in state-machine-utils.l
    • add groupname and spin-once with groupname
  • Updates to README sample code and explanations (#659)

    • extend test time limit to 120 sec for test-samples.l
    • add example/test for smach-simple with make-state-machine function
    • write more info similar to rospy implementation
    • add more info(URL/python code) on sample
    • fix typo of nestate state machine example path
    • add make-sample-parallel-state-machine tests
    • add more test, check :active-tates, duration time
  • [roseus_smach] use roseus for parallel-state-machine-sample (#651)

  • [roseus_smach] add smach_viewer installation to README (#641)

  • [roseus_smach] add code explanation of simple-state-machine in README.md. (#627)

  • Contributors: Guilherme Affonso, Kei Okada, Naoki Hiraoka, Naoya Yamaguchi, Shingo Kitagawa, Yoichiro Kawamura

1.7.4 (2019-02-04)

1.7.3 (2019-02-01)

  • check why test-smach-action-client-state failing on installed test (#570 )
  • fix make-state-machine docstring (#589 )
  • re-enable test-smach-action-client-state, which is removed in https://github.com/jsk-ros-pkg/jsk_roseus/pull/567#issuecomment-406841511
  • Add issue link in make-state-machine docstring (#595 )
  • roseus_smach: change the order of callee args for userdata in pddl2smach (#587)
  • roseus_smach: pass userdata values unless :arg-keys is set (#586)
    • roseus_smach: fix error on exec state machine without ri
  • Contributors: Guilherme Affonso, Yuki Furuta, Shingo Kitagawa

1.7.2 (2018-11-10)

1.7.1 (2018-07-22)

File truncated at 100 lines see the full file

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Dependant Packages

No known dependants.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged roseus_smach at Robotics Stack Exchange

No version for distro kilted showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

roseus_smach package from jsk_roseus repo

jsk_roseus roseus roseus_mongo roseus_smach roseus_tutorials

ROS Distro
lunar

Package Summary

Tags No category tags.
Version 1.7.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_roseus.git
VCS Type git
VCS Version master
Last Updated 2025-02-13
Dev Status DEVELOPED
CI status Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

roseus_smach * Euslisp state machine class. it will be moved. * Message publisher for visualizing current state by smach_viewer. * Simple pickle dump script for debugging state machine. * Execute state machine as a action server.

Additional Links

Maintainers

  • Kei Okada

Authors

  • Manabu Saito

roseus_smach

This package includes euslisp implementation of state machine and smach.

requirements

  • roseus
  • smach
  • smach_viewer
    • Optional for visualization.
    • You have to install this package manually:
      sudo apt install ros-$ROS_DISTRO-smach-viewer

sample

Sample codes are available on sample directory.

  • rosrun roseus_smach state-machine-ros-sample.l
    • simple state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-simple)
  
  • nested state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-nested)
  
  • state machine with userdata
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-userdata)
  
  • sample/parallel-state-machine-sample.l

    • state machine with parallel action execution
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach parallel-state-machine-sample.l
  (demo)
  

Writing Simple Smach(state-machine)

Example codes are here.

#!/usr/bin/env roseus
(load "package://roseus_smach/src/state-machine.l")

(setq count 0)
(defun func-foo (userdata-alist)
  (format t "Execute state FOO~%")
  (cond ((< count 3) (incf count) :outcome1)
	(t :outcome2)))
(defun func-bar (userdata-alist)
  (format t "Execute state BAR~%")
  :outcome2)

(defun smach-simple ()
  (let ((sm (instance state-machine :init)))
    (send sm :add-node (instance state :init :FOO 'func-foo))
    (send sm :add-node (instance state :init :BAR 'func-bar))
    ;; goal-states are generated in this method
    (send sm :goal-state (list :outcome4 :outcome5))

    ;; select a node as start-node
    (send sm :start-state :FOO)
    ;; from and to nodes are selected by name or symbol
    (send sm :add-transition :FOO :BAR :outcome1)
    (send sm :add-transition :FOO :outcome4 :outcome2)
    (send sm :add-transition :BAR :FOO :outcome2)
    sm ))

(send (smach-simple) :execute nil)

The Code Explained

(load "package://roseus_smach/src/state-machine.l")

This line imports state-machine class, state class, and transition class.

```lisp (defun func-foo (userdata-alist)

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package roseus_smach

1.7.5 (2021-12-13)

  • [roseus_smach] add :append-goal-state (#696)

  • add nested example with make-state-machine function (#661)

    • add readme on smach-simple-nested

    * use defmacro instead of defun for make-simple-state without this, 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 ))[ to avoid ]{.title-ref}/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...[ errors, this change enable us to write intuitive way ]{.title-ref}'((:bas 'func-bas) ;; functon maps (:sub sm-sub)) ;; set "nestaed state machine"[ you can test this behavior with ]{.title-ref}(defmacro test (l) `(dolist (e ,l) (print e) (print (eval (cadr e))))) (defmacro test (l) (dolist (e l) (print e) (print (eval (cadr e))))) (let (a) (setq a 10) (test '((:foo 1) (:bar a))))`

  • [roseus_smach] make roseus_smach execution faster (#684)

    • sleep 0.5 s for publisher
    • use ros::sleep for smach execution
  • [roseus_smach] add more ros-info in convert-smach (#683)

  • [roseus_smach] fix typo in state-machine-utils.l (#693)

  • [roseus_smach] add :start-state and :goal-state in convert-smach (#682)

  • [roseus_smach] add groupname in state-machine-inspector (#691)

    • use send sm :spin-once in state-machine-utils.l
    • add groupname and spin-once with groupname
  • Updates to README sample code and explanations (#659)

    • extend test time limit to 120 sec for test-samples.l
    • add example/test for smach-simple with make-state-machine function
    • write more info similar to rospy implementation
    • add more info(URL/python code) on sample
    • fix typo of nestate state machine example path
    • add make-sample-parallel-state-machine tests
    • add more test, check :active-tates, duration time
  • [roseus_smach] use roseus for parallel-state-machine-sample (#651)

  • [roseus_smach] add smach_viewer installation to README (#641)

  • [roseus_smach] add code explanation of simple-state-machine in README.md. (#627)

  • Contributors: Guilherme Affonso, Kei Okada, Naoki Hiraoka, Naoya Yamaguchi, Shingo Kitagawa, Yoichiro Kawamura

1.7.4 (2019-02-04)

1.7.3 (2019-02-01)

  • check why test-smach-action-client-state failing on installed test (#570 )
  • fix make-state-machine docstring (#589 )
  • re-enable test-smach-action-client-state, which is removed in https://github.com/jsk-ros-pkg/jsk_roseus/pull/567#issuecomment-406841511
  • Add issue link in make-state-machine docstring (#595 )
  • roseus_smach: change the order of callee args for userdata in pddl2smach (#587)
  • roseus_smach: pass userdata values unless :arg-keys is set (#586)
    • roseus_smach: fix error on exec state machine without ri
  • Contributors: Guilherme Affonso, Yuki Furuta, Shingo Kitagawa

1.7.2 (2018-11-10)

1.7.1 (2018-07-22)

File truncated at 100 lines see the full file

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Dependant Packages

No known dependants.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged roseus_smach at Robotics Stack Exchange

No version for distro rolling showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

roseus_smach package from jsk_roseus repo

jsk_roseus roseus roseus_mongo roseus_smach roseus_tutorials

ROS Distro
lunar

Package Summary

Tags No category tags.
Version 1.7.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_roseus.git
VCS Type git
VCS Version master
Last Updated 2025-02-13
Dev Status DEVELOPED
CI status Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

roseus_smach * Euslisp state machine class. it will be moved. * Message publisher for visualizing current state by smach_viewer. * Simple pickle dump script for debugging state machine. * Execute state machine as a action server.

Additional Links

Maintainers

  • Kei Okada

Authors

  • Manabu Saito

roseus_smach

This package includes euslisp implementation of state machine and smach.

requirements

  • roseus
  • smach
  • smach_viewer
    • Optional for visualization.
    • You have to install this package manually:
      sudo apt install ros-$ROS_DISTRO-smach-viewer

sample

Sample codes are available on sample directory.

  • rosrun roseus_smach state-machine-ros-sample.l
    • simple state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-simple)
  
  • nested state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-nested)
  
  • state machine with userdata
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-userdata)
  
  • sample/parallel-state-machine-sample.l

    • state machine with parallel action execution
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach parallel-state-machine-sample.l
  (demo)
  

Writing Simple Smach(state-machine)

Example codes are here.

#!/usr/bin/env roseus
(load "package://roseus_smach/src/state-machine.l")

(setq count 0)
(defun func-foo (userdata-alist)
  (format t "Execute state FOO~%")
  (cond ((< count 3) (incf count) :outcome1)
	(t :outcome2)))
(defun func-bar (userdata-alist)
  (format t "Execute state BAR~%")
  :outcome2)

(defun smach-simple ()
  (let ((sm (instance state-machine :init)))
    (send sm :add-node (instance state :init :FOO 'func-foo))
    (send sm :add-node (instance state :init :BAR 'func-bar))
    ;; goal-states are generated in this method
    (send sm :goal-state (list :outcome4 :outcome5))

    ;; select a node as start-node
    (send sm :start-state :FOO)
    ;; from and to nodes are selected by name or symbol
    (send sm :add-transition :FOO :BAR :outcome1)
    (send sm :add-transition :FOO :outcome4 :outcome2)
    (send sm :add-transition :BAR :FOO :outcome2)
    sm ))

(send (smach-simple) :execute nil)

The Code Explained

(load "package://roseus_smach/src/state-machine.l")

This line imports state-machine class, state class, and transition class.

```lisp (defun func-foo (userdata-alist)

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package roseus_smach

1.7.5 (2021-12-13)

  • [roseus_smach] add :append-goal-state (#696)

  • add nested example with make-state-machine function (#661)

    • add readme on smach-simple-nested

    * use defmacro instead of defun for make-simple-state without this, 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 ))[ to avoid ]{.title-ref}/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...[ errors, this change enable us to write intuitive way ]{.title-ref}'((:bas 'func-bas) ;; functon maps (:sub sm-sub)) ;; set "nestaed state machine"[ you can test this behavior with ]{.title-ref}(defmacro test (l) `(dolist (e ,l) (print e) (print (eval (cadr e))))) (defmacro test (l) (dolist (e l) (print e) (print (eval (cadr e))))) (let (a) (setq a 10) (test '((:foo 1) (:bar a))))`

  • [roseus_smach] make roseus_smach execution faster (#684)

    • sleep 0.5 s for publisher
    • use ros::sleep for smach execution
  • [roseus_smach] add more ros-info in convert-smach (#683)

  • [roseus_smach] fix typo in state-machine-utils.l (#693)

  • [roseus_smach] add :start-state and :goal-state in convert-smach (#682)

  • [roseus_smach] add groupname in state-machine-inspector (#691)

    • use send sm :spin-once in state-machine-utils.l
    • add groupname and spin-once with groupname
  • Updates to README sample code and explanations (#659)

    • extend test time limit to 120 sec for test-samples.l
    • add example/test for smach-simple with make-state-machine function
    • write more info similar to rospy implementation
    • add more info(URL/python code) on sample
    • fix typo of nestate state machine example path
    • add make-sample-parallel-state-machine tests
    • add more test, check :active-tates, duration time
  • [roseus_smach] use roseus for parallel-state-machine-sample (#651)

  • [roseus_smach] add smach_viewer installation to README (#641)

  • [roseus_smach] add code explanation of simple-state-machine in README.md. (#627)

  • Contributors: Guilherme Affonso, Kei Okada, Naoki Hiraoka, Naoya Yamaguchi, Shingo Kitagawa, Yoichiro Kawamura

1.7.4 (2019-02-04)

1.7.3 (2019-02-01)

  • check why test-smach-action-client-state failing on installed test (#570 )
  • fix make-state-machine docstring (#589 )
  • re-enable test-smach-action-client-state, which is removed in https://github.com/jsk-ros-pkg/jsk_roseus/pull/567#issuecomment-406841511
  • Add issue link in make-state-machine docstring (#595 )
  • roseus_smach: change the order of callee args for userdata in pddl2smach (#587)
  • roseus_smach: pass userdata values unless :arg-keys is set (#586)
    • roseus_smach: fix error on exec state machine without ri
  • Contributors: Guilherme Affonso, Yuki Furuta, Shingo Kitagawa

1.7.2 (2018-11-10)

1.7.1 (2018-07-22)

File truncated at 100 lines see the full file

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Dependant Packages

No known dependants.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged roseus_smach at Robotics Stack Exchange

No version for distro ardent showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

roseus_smach package from jsk_roseus repo

jsk_roseus roseus roseus_mongo roseus_smach roseus_tutorials

ROS Distro
lunar

Package Summary

Tags No category tags.
Version 1.7.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_roseus.git
VCS Type git
VCS Version master
Last Updated 2025-02-13
Dev Status DEVELOPED
CI status Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

roseus_smach * Euslisp state machine class. it will be moved. * Message publisher for visualizing current state by smach_viewer. * Simple pickle dump script for debugging state machine. * Execute state machine as a action server.

Additional Links

Maintainers

  • Kei Okada

Authors

  • Manabu Saito

roseus_smach

This package includes euslisp implementation of state machine and smach.

requirements

  • roseus
  • smach
  • smach_viewer
    • Optional for visualization.
    • You have to install this package manually:
      sudo apt install ros-$ROS_DISTRO-smach-viewer

sample

Sample codes are available on sample directory.

  • rosrun roseus_smach state-machine-ros-sample.l
    • simple state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-simple)
  
  • nested state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-nested)
  
  • state machine with userdata
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-userdata)
  
  • sample/parallel-state-machine-sample.l

    • state machine with parallel action execution
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach parallel-state-machine-sample.l
  (demo)
  

Writing Simple Smach(state-machine)

Example codes are here.

#!/usr/bin/env roseus
(load "package://roseus_smach/src/state-machine.l")

(setq count 0)
(defun func-foo (userdata-alist)
  (format t "Execute state FOO~%")
  (cond ((< count 3) (incf count) :outcome1)
	(t :outcome2)))
(defun func-bar (userdata-alist)
  (format t "Execute state BAR~%")
  :outcome2)

(defun smach-simple ()
  (let ((sm (instance state-machine :init)))
    (send sm :add-node (instance state :init :FOO 'func-foo))
    (send sm :add-node (instance state :init :BAR 'func-bar))
    ;; goal-states are generated in this method
    (send sm :goal-state (list :outcome4 :outcome5))

    ;; select a node as start-node
    (send sm :start-state :FOO)
    ;; from and to nodes are selected by name or symbol
    (send sm :add-transition :FOO :BAR :outcome1)
    (send sm :add-transition :FOO :outcome4 :outcome2)
    (send sm :add-transition :BAR :FOO :outcome2)
    sm ))

(send (smach-simple) :execute nil)

The Code Explained

(load "package://roseus_smach/src/state-machine.l")

This line imports state-machine class, state class, and transition class.

```lisp (defun func-foo (userdata-alist)

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package roseus_smach

1.7.5 (2021-12-13)

  • [roseus_smach] add :append-goal-state (#696)

  • add nested example with make-state-machine function (#661)

    • add readme on smach-simple-nested

    * use defmacro instead of defun for make-simple-state without this, 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 ))[ to avoid ]{.title-ref}/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...[ errors, this change enable us to write intuitive way ]{.title-ref}'((:bas 'func-bas) ;; functon maps (:sub sm-sub)) ;; set "nestaed state machine"[ you can test this behavior with ]{.title-ref}(defmacro test (l) `(dolist (e ,l) (print e) (print (eval (cadr e))))) (defmacro test (l) (dolist (e l) (print e) (print (eval (cadr e))))) (let (a) (setq a 10) (test '((:foo 1) (:bar a))))`

  • [roseus_smach] make roseus_smach execution faster (#684)

    • sleep 0.5 s for publisher
    • use ros::sleep for smach execution
  • [roseus_smach] add more ros-info in convert-smach (#683)

  • [roseus_smach] fix typo in state-machine-utils.l (#693)

  • [roseus_smach] add :start-state and :goal-state in convert-smach (#682)

  • [roseus_smach] add groupname in state-machine-inspector (#691)

    • use send sm :spin-once in state-machine-utils.l
    • add groupname and spin-once with groupname
  • Updates to README sample code and explanations (#659)

    • extend test time limit to 120 sec for test-samples.l
    • add example/test for smach-simple with make-state-machine function
    • write more info similar to rospy implementation
    • add more info(URL/python code) on sample
    • fix typo of nestate state machine example path
    • add make-sample-parallel-state-machine tests
    • add more test, check :active-tates, duration time
  • [roseus_smach] use roseus for parallel-state-machine-sample (#651)

  • [roseus_smach] add smach_viewer installation to README (#641)

  • [roseus_smach] add code explanation of simple-state-machine in README.md. (#627)

  • Contributors: Guilherme Affonso, Kei Okada, Naoki Hiraoka, Naoya Yamaguchi, Shingo Kitagawa, Yoichiro Kawamura

1.7.4 (2019-02-04)

1.7.3 (2019-02-01)

  • check why test-smach-action-client-state failing on installed test (#570 )
  • fix make-state-machine docstring (#589 )
  • re-enable test-smach-action-client-state, which is removed in https://github.com/jsk-ros-pkg/jsk_roseus/pull/567#issuecomment-406841511
  • Add issue link in make-state-machine docstring (#595 )
  • roseus_smach: change the order of callee args for userdata in pddl2smach (#587)
  • roseus_smach: pass userdata values unless :arg-keys is set (#586)
    • roseus_smach: fix error on exec state machine without ri
  • Contributors: Guilherme Affonso, Yuki Furuta, Shingo Kitagawa

1.7.2 (2018-11-10)

1.7.1 (2018-07-22)

File truncated at 100 lines see the full file

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Dependant Packages

No known dependants.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged roseus_smach at Robotics Stack Exchange

No version for distro bouncy showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

roseus_smach package from jsk_roseus repo

jsk_roseus roseus roseus_mongo roseus_smach roseus_tutorials

ROS Distro
lunar

Package Summary

Tags No category tags.
Version 1.7.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_roseus.git
VCS Type git
VCS Version master
Last Updated 2025-02-13
Dev Status DEVELOPED
CI status Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

roseus_smach * Euslisp state machine class. it will be moved. * Message publisher for visualizing current state by smach_viewer. * Simple pickle dump script for debugging state machine. * Execute state machine as a action server.

Additional Links

Maintainers

  • Kei Okada

Authors

  • Manabu Saito

roseus_smach

This package includes euslisp implementation of state machine and smach.

requirements

  • roseus
  • smach
  • smach_viewer
    • Optional for visualization.
    • You have to install this package manually:
      sudo apt install ros-$ROS_DISTRO-smach-viewer

sample

Sample codes are available on sample directory.

  • rosrun roseus_smach state-machine-ros-sample.l
    • simple state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-simple)
  
  • nested state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-nested)
  
  • state machine with userdata
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-userdata)
  
  • sample/parallel-state-machine-sample.l

    • state machine with parallel action execution
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach parallel-state-machine-sample.l
  (demo)
  

Writing Simple Smach(state-machine)

Example codes are here.

#!/usr/bin/env roseus
(load "package://roseus_smach/src/state-machine.l")

(setq count 0)
(defun func-foo (userdata-alist)
  (format t "Execute state FOO~%")
  (cond ((< count 3) (incf count) :outcome1)
	(t :outcome2)))
(defun func-bar (userdata-alist)
  (format t "Execute state BAR~%")
  :outcome2)

(defun smach-simple ()
  (let ((sm (instance state-machine :init)))
    (send sm :add-node (instance state :init :FOO 'func-foo))
    (send sm :add-node (instance state :init :BAR 'func-bar))
    ;; goal-states are generated in this method
    (send sm :goal-state (list :outcome4 :outcome5))

    ;; select a node as start-node
    (send sm :start-state :FOO)
    ;; from and to nodes are selected by name or symbol
    (send sm :add-transition :FOO :BAR :outcome1)
    (send sm :add-transition :FOO :outcome4 :outcome2)
    (send sm :add-transition :BAR :FOO :outcome2)
    sm ))

(send (smach-simple) :execute nil)

The Code Explained

(load "package://roseus_smach/src/state-machine.l")

This line imports state-machine class, state class, and transition class.

```lisp (defun func-foo (userdata-alist)

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package roseus_smach

1.7.5 (2021-12-13)

  • [roseus_smach] add :append-goal-state (#696)

  • add nested example with make-state-machine function (#661)

    • add readme on smach-simple-nested

    * use defmacro instead of defun for make-simple-state without this, 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 ))[ to avoid ]{.title-ref}/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...[ errors, this change enable us to write intuitive way ]{.title-ref}'((:bas 'func-bas) ;; functon maps (:sub sm-sub)) ;; set "nestaed state machine"[ you can test this behavior with ]{.title-ref}(defmacro test (l) `(dolist (e ,l) (print e) (print (eval (cadr e))))) (defmacro test (l) (dolist (e l) (print e) (print (eval (cadr e))))) (let (a) (setq a 10) (test '((:foo 1) (:bar a))))`

  • [roseus_smach] make roseus_smach execution faster (#684)

    • sleep 0.5 s for publisher
    • use ros::sleep for smach execution
  • [roseus_smach] add more ros-info in convert-smach (#683)

  • [roseus_smach] fix typo in state-machine-utils.l (#693)

  • [roseus_smach] add :start-state and :goal-state in convert-smach (#682)

  • [roseus_smach] add groupname in state-machine-inspector (#691)

    • use send sm :spin-once in state-machine-utils.l
    • add groupname and spin-once with groupname
  • Updates to README sample code and explanations (#659)

    • extend test time limit to 120 sec for test-samples.l
    • add example/test for smach-simple with make-state-machine function
    • write more info similar to rospy implementation
    • add more info(URL/python code) on sample
    • fix typo of nestate state machine example path
    • add make-sample-parallel-state-machine tests
    • add more test, check :active-tates, duration time
  • [roseus_smach] use roseus for parallel-state-machine-sample (#651)

  • [roseus_smach] add smach_viewer installation to README (#641)

  • [roseus_smach] add code explanation of simple-state-machine in README.md. (#627)

  • Contributors: Guilherme Affonso, Kei Okada, Naoki Hiraoka, Naoya Yamaguchi, Shingo Kitagawa, Yoichiro Kawamura

1.7.4 (2019-02-04)

1.7.3 (2019-02-01)

  • check why test-smach-action-client-state failing on installed test (#570 )
  • fix make-state-machine docstring (#589 )
  • re-enable test-smach-action-client-state, which is removed in https://github.com/jsk-ros-pkg/jsk_roseus/pull/567#issuecomment-406841511
  • Add issue link in make-state-machine docstring (#595 )
  • roseus_smach: change the order of callee args for userdata in pddl2smach (#587)
  • roseus_smach: pass userdata values unless :arg-keys is set (#586)
    • roseus_smach: fix error on exec state machine without ri
  • Contributors: Guilherme Affonso, Yuki Furuta, Shingo Kitagawa

1.7.2 (2018-11-10)

1.7.1 (2018-07-22)

File truncated at 100 lines see the full file

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Dependant Packages

No known dependants.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged roseus_smach at Robotics Stack Exchange

No version for distro crystal showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

roseus_smach package from jsk_roseus repo

jsk_roseus roseus roseus_mongo roseus_smach roseus_tutorials

ROS Distro
lunar

Package Summary

Tags No category tags.
Version 1.7.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_roseus.git
VCS Type git
VCS Version master
Last Updated 2025-02-13
Dev Status DEVELOPED
CI status Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

roseus_smach * Euslisp state machine class. it will be moved. * Message publisher for visualizing current state by smach_viewer. * Simple pickle dump script for debugging state machine. * Execute state machine as a action server.

Additional Links

Maintainers

  • Kei Okada

Authors

  • Manabu Saito

roseus_smach

This package includes euslisp implementation of state machine and smach.

requirements

  • roseus
  • smach
  • smach_viewer
    • Optional for visualization.
    • You have to install this package manually:
      sudo apt install ros-$ROS_DISTRO-smach-viewer

sample

Sample codes are available on sample directory.

  • rosrun roseus_smach state-machine-ros-sample.l
    • simple state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-simple)
  
  • nested state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-nested)
  
  • state machine with userdata
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-userdata)
  
  • sample/parallel-state-machine-sample.l

    • state machine with parallel action execution
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach parallel-state-machine-sample.l
  (demo)
  

Writing Simple Smach(state-machine)

Example codes are here.

#!/usr/bin/env roseus
(load "package://roseus_smach/src/state-machine.l")

(setq count 0)
(defun func-foo (userdata-alist)
  (format t "Execute state FOO~%")
  (cond ((< count 3) (incf count) :outcome1)
	(t :outcome2)))
(defun func-bar (userdata-alist)
  (format t "Execute state BAR~%")
  :outcome2)

(defun smach-simple ()
  (let ((sm (instance state-machine :init)))
    (send sm :add-node (instance state :init :FOO 'func-foo))
    (send sm :add-node (instance state :init :BAR 'func-bar))
    ;; goal-states are generated in this method
    (send sm :goal-state (list :outcome4 :outcome5))

    ;; select a node as start-node
    (send sm :start-state :FOO)
    ;; from and to nodes are selected by name or symbol
    (send sm :add-transition :FOO :BAR :outcome1)
    (send sm :add-transition :FOO :outcome4 :outcome2)
    (send sm :add-transition :BAR :FOO :outcome2)
    sm ))

(send (smach-simple) :execute nil)

The Code Explained

(load "package://roseus_smach/src/state-machine.l")

This line imports state-machine class, state class, and transition class.

```lisp (defun func-foo (userdata-alist)

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package roseus_smach

1.7.5 (2021-12-13)

  • [roseus_smach] add :append-goal-state (#696)

  • add nested example with make-state-machine function (#661)

    • add readme on smach-simple-nested

    * use defmacro instead of defun for make-simple-state without this, 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 ))[ to avoid ]{.title-ref}/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...[ errors, this change enable us to write intuitive way ]{.title-ref}'((:bas 'func-bas) ;; functon maps (:sub sm-sub)) ;; set "nestaed state machine"[ you can test this behavior with ]{.title-ref}(defmacro test (l) `(dolist (e ,l) (print e) (print (eval (cadr e))))) (defmacro test (l) (dolist (e l) (print e) (print (eval (cadr e))))) (let (a) (setq a 10) (test '((:foo 1) (:bar a))))`

  • [roseus_smach] make roseus_smach execution faster (#684)

    • sleep 0.5 s for publisher
    • use ros::sleep for smach execution
  • [roseus_smach] add more ros-info in convert-smach (#683)

  • [roseus_smach] fix typo in state-machine-utils.l (#693)

  • [roseus_smach] add :start-state and :goal-state in convert-smach (#682)

  • [roseus_smach] add groupname in state-machine-inspector (#691)

    • use send sm :spin-once in state-machine-utils.l
    • add groupname and spin-once with groupname
  • Updates to README sample code and explanations (#659)

    • extend test time limit to 120 sec for test-samples.l
    • add example/test for smach-simple with make-state-machine function
    • write more info similar to rospy implementation
    • add more info(URL/python code) on sample
    • fix typo of nestate state machine example path
    • add make-sample-parallel-state-machine tests
    • add more test, check :active-tates, duration time
  • [roseus_smach] use roseus for parallel-state-machine-sample (#651)

  • [roseus_smach] add smach_viewer installation to README (#641)

  • [roseus_smach] add code explanation of simple-state-machine in README.md. (#627)

  • Contributors: Guilherme Affonso, Kei Okada, Naoki Hiraoka, Naoya Yamaguchi, Shingo Kitagawa, Yoichiro Kawamura

1.7.4 (2019-02-04)

1.7.3 (2019-02-01)

  • check why test-smach-action-client-state failing on installed test (#570 )
  • fix make-state-machine docstring (#589 )
  • re-enable test-smach-action-client-state, which is removed in https://github.com/jsk-ros-pkg/jsk_roseus/pull/567#issuecomment-406841511
  • Add issue link in make-state-machine docstring (#595 )
  • roseus_smach: change the order of callee args for userdata in pddl2smach (#587)
  • roseus_smach: pass userdata values unless :arg-keys is set (#586)
    • roseus_smach: fix error on exec state machine without ri
  • Contributors: Guilherme Affonso, Yuki Furuta, Shingo Kitagawa

1.7.2 (2018-11-10)

1.7.1 (2018-07-22)

File truncated at 100 lines see the full file

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Dependant Packages

No known dependants.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged roseus_smach at Robotics Stack Exchange

No version for distro eloquent showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

roseus_smach package from jsk_roseus repo

jsk_roseus roseus roseus_mongo roseus_smach roseus_tutorials

ROS Distro
lunar

Package Summary

Tags No category tags.
Version 1.7.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_roseus.git
VCS Type git
VCS Version master
Last Updated 2025-02-13
Dev Status DEVELOPED
CI status Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

roseus_smach * Euslisp state machine class. it will be moved. * Message publisher for visualizing current state by smach_viewer. * Simple pickle dump script for debugging state machine. * Execute state machine as a action server.

Additional Links

Maintainers

  • Kei Okada

Authors

  • Manabu Saito

roseus_smach

This package includes euslisp implementation of state machine and smach.

requirements

  • roseus
  • smach
  • smach_viewer
    • Optional for visualization.
    • You have to install this package manually:
      sudo apt install ros-$ROS_DISTRO-smach-viewer

sample

Sample codes are available on sample directory.

  • rosrun roseus_smach state-machine-ros-sample.l
    • simple state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-simple)
  
  • nested state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-nested)
  
  • state machine with userdata
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-userdata)
  
  • sample/parallel-state-machine-sample.l

    • state machine with parallel action execution
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach parallel-state-machine-sample.l
  (demo)
  

Writing Simple Smach(state-machine)

Example codes are here.

#!/usr/bin/env roseus
(load "package://roseus_smach/src/state-machine.l")

(setq count 0)
(defun func-foo (userdata-alist)
  (format t "Execute state FOO~%")
  (cond ((< count 3) (incf count) :outcome1)
	(t :outcome2)))
(defun func-bar (userdata-alist)
  (format t "Execute state BAR~%")
  :outcome2)

(defun smach-simple ()
  (let ((sm (instance state-machine :init)))
    (send sm :add-node (instance state :init :FOO 'func-foo))
    (send sm :add-node (instance state :init :BAR 'func-bar))
    ;; goal-states are generated in this method
    (send sm :goal-state (list :outcome4 :outcome5))

    ;; select a node as start-node
    (send sm :start-state :FOO)
    ;; from and to nodes are selected by name or symbol
    (send sm :add-transition :FOO :BAR :outcome1)
    (send sm :add-transition :FOO :outcome4 :outcome2)
    (send sm :add-transition :BAR :FOO :outcome2)
    sm ))

(send (smach-simple) :execute nil)

The Code Explained

(load "package://roseus_smach/src/state-machine.l")

This line imports state-machine class, state class, and transition class.

```lisp (defun func-foo (userdata-alist)

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package roseus_smach

1.7.5 (2021-12-13)

  • [roseus_smach] add :append-goal-state (#696)

  • add nested example with make-state-machine function (#661)

    • add readme on smach-simple-nested

    * use defmacro instead of defun for make-simple-state without this, 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 ))[ to avoid ]{.title-ref}/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...[ errors, this change enable us to write intuitive way ]{.title-ref}'((:bas 'func-bas) ;; functon maps (:sub sm-sub)) ;; set "nestaed state machine"[ you can test this behavior with ]{.title-ref}(defmacro test (l) `(dolist (e ,l) (print e) (print (eval (cadr e))))) (defmacro test (l) (dolist (e l) (print e) (print (eval (cadr e))))) (let (a) (setq a 10) (test '((:foo 1) (:bar a))))`

  • [roseus_smach] make roseus_smach execution faster (#684)

    • sleep 0.5 s for publisher
    • use ros::sleep for smach execution
  • [roseus_smach] add more ros-info in convert-smach (#683)

  • [roseus_smach] fix typo in state-machine-utils.l (#693)

  • [roseus_smach] add :start-state and :goal-state in convert-smach (#682)

  • [roseus_smach] add groupname in state-machine-inspector (#691)

    • use send sm :spin-once in state-machine-utils.l
    • add groupname and spin-once with groupname
  • Updates to README sample code and explanations (#659)

    • extend test time limit to 120 sec for test-samples.l
    • add example/test for smach-simple with make-state-machine function
    • write more info similar to rospy implementation
    • add more info(URL/python code) on sample
    • fix typo of nestate state machine example path
    • add make-sample-parallel-state-machine tests
    • add more test, check :active-tates, duration time
  • [roseus_smach] use roseus for parallel-state-machine-sample (#651)

  • [roseus_smach] add smach_viewer installation to README (#641)

  • [roseus_smach] add code explanation of simple-state-machine in README.md. (#627)

  • Contributors: Guilherme Affonso, Kei Okada, Naoki Hiraoka, Naoya Yamaguchi, Shingo Kitagawa, Yoichiro Kawamura

1.7.4 (2019-02-04)

1.7.3 (2019-02-01)

  • check why test-smach-action-client-state failing on installed test (#570 )
  • fix make-state-machine docstring (#589 )
  • re-enable test-smach-action-client-state, which is removed in https://github.com/jsk-ros-pkg/jsk_roseus/pull/567#issuecomment-406841511
  • Add issue link in make-state-machine docstring (#595 )
  • roseus_smach: change the order of callee args for userdata in pddl2smach (#587)
  • roseus_smach: pass userdata values unless :arg-keys is set (#586)
    • roseus_smach: fix error on exec state machine without ri
  • Contributors: Guilherme Affonso, Yuki Furuta, Shingo Kitagawa

1.7.2 (2018-11-10)

1.7.1 (2018-07-22)

File truncated at 100 lines see the full file

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Dependant Packages

No known dependants.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged roseus_smach at Robotics Stack Exchange

No version for distro dashing showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

roseus_smach package from jsk_roseus repo

jsk_roseus roseus roseus_mongo roseus_smach roseus_tutorials

ROS Distro
lunar

Package Summary

Tags No category tags.
Version 1.7.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_roseus.git
VCS Type git
VCS Version master
Last Updated 2025-02-13
Dev Status DEVELOPED
CI status Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

roseus_smach * Euslisp state machine class. it will be moved. * Message publisher for visualizing current state by smach_viewer. * Simple pickle dump script for debugging state machine. * Execute state machine as a action server.

Additional Links

Maintainers

  • Kei Okada

Authors

  • Manabu Saito

roseus_smach

This package includes euslisp implementation of state machine and smach.

requirements

  • roseus
  • smach
  • smach_viewer
    • Optional for visualization.
    • You have to install this package manually:
      sudo apt install ros-$ROS_DISTRO-smach-viewer

sample

Sample codes are available on sample directory.

  • rosrun roseus_smach state-machine-ros-sample.l
    • simple state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-simple)
  
  • nested state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-nested)
  
  • state machine with userdata
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-userdata)
  
  • sample/parallel-state-machine-sample.l

    • state machine with parallel action execution
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach parallel-state-machine-sample.l
  (demo)
  

Writing Simple Smach(state-machine)

Example codes are here.

#!/usr/bin/env roseus
(load "package://roseus_smach/src/state-machine.l")

(setq count 0)
(defun func-foo (userdata-alist)
  (format t "Execute state FOO~%")
  (cond ((< count 3) (incf count) :outcome1)
	(t :outcome2)))
(defun func-bar (userdata-alist)
  (format t "Execute state BAR~%")
  :outcome2)

(defun smach-simple ()
  (let ((sm (instance state-machine :init)))
    (send sm :add-node (instance state :init :FOO 'func-foo))
    (send sm :add-node (instance state :init :BAR 'func-bar))
    ;; goal-states are generated in this method
    (send sm :goal-state (list :outcome4 :outcome5))

    ;; select a node as start-node
    (send sm :start-state :FOO)
    ;; from and to nodes are selected by name or symbol
    (send sm :add-transition :FOO :BAR :outcome1)
    (send sm :add-transition :FOO :outcome4 :outcome2)
    (send sm :add-transition :BAR :FOO :outcome2)
    sm ))

(send (smach-simple) :execute nil)

The Code Explained

(load "package://roseus_smach/src/state-machine.l")

This line imports state-machine class, state class, and transition class.

```lisp (defun func-foo (userdata-alist)

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package roseus_smach

1.7.5 (2021-12-13)

  • [roseus_smach] add :append-goal-state (#696)

  • add nested example with make-state-machine function (#661)

    • add readme on smach-simple-nested

    * use defmacro instead of defun for make-simple-state without this, 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 ))[ to avoid ]{.title-ref}/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...[ errors, this change enable us to write intuitive way ]{.title-ref}'((:bas 'func-bas) ;; functon maps (:sub sm-sub)) ;; set "nestaed state machine"[ you can test this behavior with ]{.title-ref}(defmacro test (l) `(dolist (e ,l) (print e) (print (eval (cadr e))))) (defmacro test (l) (dolist (e l) (print e) (print (eval (cadr e))))) (let (a) (setq a 10) (test '((:foo 1) (:bar a))))`

  • [roseus_smach] make roseus_smach execution faster (#684)

    • sleep 0.5 s for publisher
    • use ros::sleep for smach execution
  • [roseus_smach] add more ros-info in convert-smach (#683)

  • [roseus_smach] fix typo in state-machine-utils.l (#693)

  • [roseus_smach] add :start-state and :goal-state in convert-smach (#682)

  • [roseus_smach] add groupname in state-machine-inspector (#691)

    • use send sm :spin-once in state-machine-utils.l
    • add groupname and spin-once with groupname
  • Updates to README sample code and explanations (#659)

    • extend test time limit to 120 sec for test-samples.l
    • add example/test for smach-simple with make-state-machine function
    • write more info similar to rospy implementation
    • add more info(URL/python code) on sample
    • fix typo of nestate state machine example path
    • add make-sample-parallel-state-machine tests
    • add more test, check :active-tates, duration time
  • [roseus_smach] use roseus for parallel-state-machine-sample (#651)

  • [roseus_smach] add smach_viewer installation to README (#641)

  • [roseus_smach] add code explanation of simple-state-machine in README.md. (#627)

  • Contributors: Guilherme Affonso, Kei Okada, Naoki Hiraoka, Naoya Yamaguchi, Shingo Kitagawa, Yoichiro Kawamura

1.7.4 (2019-02-04)

1.7.3 (2019-02-01)

  • check why test-smach-action-client-state failing on installed test (#570 )
  • fix make-state-machine docstring (#589 )
  • re-enable test-smach-action-client-state, which is removed in https://github.com/jsk-ros-pkg/jsk_roseus/pull/567#issuecomment-406841511
  • Add issue link in make-state-machine docstring (#595 )
  • roseus_smach: change the order of callee args for userdata in pddl2smach (#587)
  • roseus_smach: pass userdata values unless :arg-keys is set (#586)
    • roseus_smach: fix error on exec state machine without ri
  • Contributors: Guilherme Affonso, Yuki Furuta, Shingo Kitagawa

1.7.2 (2018-11-10)

1.7.1 (2018-07-22)

File truncated at 100 lines see the full file

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Dependant Packages

No known dependants.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged roseus_smach at Robotics Stack Exchange

No version for distro galactic showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

roseus_smach package from jsk_roseus repo

jsk_roseus roseus roseus_mongo roseus_smach roseus_tutorials

ROS Distro
lunar

Package Summary

Tags No category tags.
Version 1.7.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_roseus.git
VCS Type git
VCS Version master
Last Updated 2025-02-13
Dev Status DEVELOPED
CI status Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

roseus_smach * Euslisp state machine class. it will be moved. * Message publisher for visualizing current state by smach_viewer. * Simple pickle dump script for debugging state machine. * Execute state machine as a action server.

Additional Links

Maintainers

  • Kei Okada

Authors

  • Manabu Saito

roseus_smach

This package includes euslisp implementation of state machine and smach.

requirements

  • roseus
  • smach
  • smach_viewer
    • Optional for visualization.
    • You have to install this package manually:
      sudo apt install ros-$ROS_DISTRO-smach-viewer

sample

Sample codes are available on sample directory.

  • rosrun roseus_smach state-machine-ros-sample.l
    • simple state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-simple)
  
  • nested state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-nested)
  
  • state machine with userdata
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-userdata)
  
  • sample/parallel-state-machine-sample.l

    • state machine with parallel action execution
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach parallel-state-machine-sample.l
  (demo)
  

Writing Simple Smach(state-machine)

Example codes are here.

#!/usr/bin/env roseus
(load "package://roseus_smach/src/state-machine.l")

(setq count 0)
(defun func-foo (userdata-alist)
  (format t "Execute state FOO~%")
  (cond ((< count 3) (incf count) :outcome1)
	(t :outcome2)))
(defun func-bar (userdata-alist)
  (format t "Execute state BAR~%")
  :outcome2)

(defun smach-simple ()
  (let ((sm (instance state-machine :init)))
    (send sm :add-node (instance state :init :FOO 'func-foo))
    (send sm :add-node (instance state :init :BAR 'func-bar))
    ;; goal-states are generated in this method
    (send sm :goal-state (list :outcome4 :outcome5))

    ;; select a node as start-node
    (send sm :start-state :FOO)
    ;; from and to nodes are selected by name or symbol
    (send sm :add-transition :FOO :BAR :outcome1)
    (send sm :add-transition :FOO :outcome4 :outcome2)
    (send sm :add-transition :BAR :FOO :outcome2)
    sm ))

(send (smach-simple) :execute nil)

The Code Explained

(load "package://roseus_smach/src/state-machine.l")

This line imports state-machine class, state class, and transition class.

```lisp (defun func-foo (userdata-alist)

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package roseus_smach

1.7.5 (2021-12-13)

  • [roseus_smach] add :append-goal-state (#696)

  • add nested example with make-state-machine function (#661)

    • add readme on smach-simple-nested

    * use defmacro instead of defun for make-simple-state without this, 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 ))[ to avoid ]{.title-ref}/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...[ errors, this change enable us to write intuitive way ]{.title-ref}'((:bas 'func-bas) ;; functon maps (:sub sm-sub)) ;; set "nestaed state machine"[ you can test this behavior with ]{.title-ref}(defmacro test (l) `(dolist (e ,l) (print e) (print (eval (cadr e))))) (defmacro test (l) (dolist (e l) (print e) (print (eval (cadr e))))) (let (a) (setq a 10) (test '((:foo 1) (:bar a))))`

  • [roseus_smach] make roseus_smach execution faster (#684)

    • sleep 0.5 s for publisher
    • use ros::sleep for smach execution
  • [roseus_smach] add more ros-info in convert-smach (#683)

  • [roseus_smach] fix typo in state-machine-utils.l (#693)

  • [roseus_smach] add :start-state and :goal-state in convert-smach (#682)

  • [roseus_smach] add groupname in state-machine-inspector (#691)

    • use send sm :spin-once in state-machine-utils.l
    • add groupname and spin-once with groupname
  • Updates to README sample code and explanations (#659)

    • extend test time limit to 120 sec for test-samples.l
    • add example/test for smach-simple with make-state-machine function
    • write more info similar to rospy implementation
    • add more info(URL/python code) on sample
    • fix typo of nestate state machine example path
    • add make-sample-parallel-state-machine tests
    • add more test, check :active-tates, duration time
  • [roseus_smach] use roseus for parallel-state-machine-sample (#651)

  • [roseus_smach] add smach_viewer installation to README (#641)

  • [roseus_smach] add code explanation of simple-state-machine in README.md. (#627)

  • Contributors: Guilherme Affonso, Kei Okada, Naoki Hiraoka, Naoya Yamaguchi, Shingo Kitagawa, Yoichiro Kawamura

1.7.4 (2019-02-04)

1.7.3 (2019-02-01)

  • check why test-smach-action-client-state failing on installed test (#570 )
  • fix make-state-machine docstring (#589 )
  • re-enable test-smach-action-client-state, which is removed in https://github.com/jsk-ros-pkg/jsk_roseus/pull/567#issuecomment-406841511
  • Add issue link in make-state-machine docstring (#595 )
  • roseus_smach: change the order of callee args for userdata in pddl2smach (#587)
  • roseus_smach: pass userdata values unless :arg-keys is set (#586)
    • roseus_smach: fix error on exec state machine without ri
  • Contributors: Guilherme Affonso, Yuki Furuta, Shingo Kitagawa

1.7.2 (2018-11-10)

1.7.1 (2018-07-22)

File truncated at 100 lines see the full file

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Dependant Packages

No known dependants.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged roseus_smach at Robotics Stack Exchange

No version for distro foxy showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

roseus_smach package from jsk_roseus repo

jsk_roseus roseus roseus_mongo roseus_smach roseus_tutorials

ROS Distro
lunar

Package Summary

Tags No category tags.
Version 1.7.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_roseus.git
VCS Type git
VCS Version master
Last Updated 2025-02-13
Dev Status DEVELOPED
CI status Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

roseus_smach * Euslisp state machine class. it will be moved. * Message publisher for visualizing current state by smach_viewer. * Simple pickle dump script for debugging state machine. * Execute state machine as a action server.

Additional Links

Maintainers

  • Kei Okada

Authors

  • Manabu Saito

roseus_smach

This package includes euslisp implementation of state machine and smach.

requirements

  • roseus
  • smach
  • smach_viewer
    • Optional for visualization.
    • You have to install this package manually:
      sudo apt install ros-$ROS_DISTRO-smach-viewer

sample

Sample codes are available on sample directory.

  • rosrun roseus_smach state-machine-ros-sample.l
    • simple state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-simple)
  
  • nested state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-nested)
  
  • state machine with userdata
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-userdata)
  
  • sample/parallel-state-machine-sample.l

    • state machine with parallel action execution
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach parallel-state-machine-sample.l
  (demo)
  

Writing Simple Smach(state-machine)

Example codes are here.

#!/usr/bin/env roseus
(load "package://roseus_smach/src/state-machine.l")

(setq count 0)
(defun func-foo (userdata-alist)
  (format t "Execute state FOO~%")
  (cond ((< count 3) (incf count) :outcome1)
	(t :outcome2)))
(defun func-bar (userdata-alist)
  (format t "Execute state BAR~%")
  :outcome2)

(defun smach-simple ()
  (let ((sm (instance state-machine :init)))
    (send sm :add-node (instance state :init :FOO 'func-foo))
    (send sm :add-node (instance state :init :BAR 'func-bar))
    ;; goal-states are generated in this method
    (send sm :goal-state (list :outcome4 :outcome5))

    ;; select a node as start-node
    (send sm :start-state :FOO)
    ;; from and to nodes are selected by name or symbol
    (send sm :add-transition :FOO :BAR :outcome1)
    (send sm :add-transition :FOO :outcome4 :outcome2)
    (send sm :add-transition :BAR :FOO :outcome2)
    sm ))

(send (smach-simple) :execute nil)

The Code Explained

(load "package://roseus_smach/src/state-machine.l")

This line imports state-machine class, state class, and transition class.

```lisp (defun func-foo (userdata-alist)

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package roseus_smach

1.7.5 (2021-12-13)

  • [roseus_smach] add :append-goal-state (#696)

  • add nested example with make-state-machine function (#661)

    • add readme on smach-simple-nested

    * use defmacro instead of defun for make-simple-state without this, 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 ))[ to avoid ]{.title-ref}/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...[ errors, this change enable us to write intuitive way ]{.title-ref}'((:bas 'func-bas) ;; functon maps (:sub sm-sub)) ;; set "nestaed state machine"[ you can test this behavior with ]{.title-ref}(defmacro test (l) `(dolist (e ,l) (print e) (print (eval (cadr e))))) (defmacro test (l) (dolist (e l) (print e) (print (eval (cadr e))))) (let (a) (setq a 10) (test '((:foo 1) (:bar a))))`

  • [roseus_smach] make roseus_smach execution faster (#684)

    • sleep 0.5 s for publisher
    • use ros::sleep for smach execution
  • [roseus_smach] add more ros-info in convert-smach (#683)

  • [roseus_smach] fix typo in state-machine-utils.l (#693)

  • [roseus_smach] add :start-state and :goal-state in convert-smach (#682)

  • [roseus_smach] add groupname in state-machine-inspector (#691)

    • use send sm :spin-once in state-machine-utils.l
    • add groupname and spin-once with groupname
  • Updates to README sample code and explanations (#659)

    • extend test time limit to 120 sec for test-samples.l
    • add example/test for smach-simple with make-state-machine function
    • write more info similar to rospy implementation
    • add more info(URL/python code) on sample
    • fix typo of nestate state machine example path
    • add make-sample-parallel-state-machine tests
    • add more test, check :active-tates, duration time
  • [roseus_smach] use roseus for parallel-state-machine-sample (#651)

  • [roseus_smach] add smach_viewer installation to README (#641)

  • [roseus_smach] add code explanation of simple-state-machine in README.md. (#627)

  • Contributors: Guilherme Affonso, Kei Okada, Naoki Hiraoka, Naoya Yamaguchi, Shingo Kitagawa, Yoichiro Kawamura

1.7.4 (2019-02-04)

1.7.3 (2019-02-01)

  • check why test-smach-action-client-state failing on installed test (#570 )
  • fix make-state-machine docstring (#589 )
  • re-enable test-smach-action-client-state, which is removed in https://github.com/jsk-ros-pkg/jsk_roseus/pull/567#issuecomment-406841511
  • Add issue link in make-state-machine docstring (#595 )
  • roseus_smach: change the order of callee args for userdata in pddl2smach (#587)
  • roseus_smach: pass userdata values unless :arg-keys is set (#586)
    • roseus_smach: fix error on exec state machine without ri
  • Contributors: Guilherme Affonso, Yuki Furuta, Shingo Kitagawa

1.7.2 (2018-11-10)

1.7.1 (2018-07-22)

File truncated at 100 lines see the full file

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Dependant Packages

No known dependants.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged roseus_smach at Robotics Stack Exchange

No version for distro iron showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

roseus_smach package from jsk_roseus repo

jsk_roseus roseus roseus_mongo roseus_smach roseus_tutorials

ROS Distro
lunar

Package Summary

Tags No category tags.
Version 1.7.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_roseus.git
VCS Type git
VCS Version master
Last Updated 2025-02-13
Dev Status DEVELOPED
CI status Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

roseus_smach * Euslisp state machine class. it will be moved. * Message publisher for visualizing current state by smach_viewer. * Simple pickle dump script for debugging state machine. * Execute state machine as a action server.

Additional Links

Maintainers

  • Kei Okada

Authors

  • Manabu Saito

roseus_smach

This package includes euslisp implementation of state machine and smach.

requirements

  • roseus
  • smach
  • smach_viewer
    • Optional for visualization.
    • You have to install this package manually:
      sudo apt install ros-$ROS_DISTRO-smach-viewer

sample

Sample codes are available on sample directory.

  • rosrun roseus_smach state-machine-ros-sample.l
    • simple state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-simple)
  
  • nested state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-nested)
  
  • state machine with userdata
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-userdata)
  
  • sample/parallel-state-machine-sample.l

    • state machine with parallel action execution
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach parallel-state-machine-sample.l
  (demo)
  

Writing Simple Smach(state-machine)

Example codes are here.

#!/usr/bin/env roseus
(load "package://roseus_smach/src/state-machine.l")

(setq count 0)
(defun func-foo (userdata-alist)
  (format t "Execute state FOO~%")
  (cond ((< count 3) (incf count) :outcome1)
	(t :outcome2)))
(defun func-bar (userdata-alist)
  (format t "Execute state BAR~%")
  :outcome2)

(defun smach-simple ()
  (let ((sm (instance state-machine :init)))
    (send sm :add-node (instance state :init :FOO 'func-foo))
    (send sm :add-node (instance state :init :BAR 'func-bar))
    ;; goal-states are generated in this method
    (send sm :goal-state (list :outcome4 :outcome5))

    ;; select a node as start-node
    (send sm :start-state :FOO)
    ;; from and to nodes are selected by name or symbol
    (send sm :add-transition :FOO :BAR :outcome1)
    (send sm :add-transition :FOO :outcome4 :outcome2)
    (send sm :add-transition :BAR :FOO :outcome2)
    sm ))

(send (smach-simple) :execute nil)

The Code Explained

(load "package://roseus_smach/src/state-machine.l")

This line imports state-machine class, state class, and transition class.

```lisp (defun func-foo (userdata-alist)

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package roseus_smach

1.7.5 (2021-12-13)

  • [roseus_smach] add :append-goal-state (#696)

  • add nested example with make-state-machine function (#661)

    • add readme on smach-simple-nested

    * use defmacro instead of defun for make-simple-state without this, 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 ))[ to avoid ]{.title-ref}/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...[ errors, this change enable us to write intuitive way ]{.title-ref}'((:bas 'func-bas) ;; functon maps (:sub sm-sub)) ;; set "nestaed state machine"[ you can test this behavior with ]{.title-ref}(defmacro test (l) `(dolist (e ,l) (print e) (print (eval (cadr e))))) (defmacro test (l) (dolist (e l) (print e) (print (eval (cadr e))))) (let (a) (setq a 10) (test '((:foo 1) (:bar a))))`

  • [roseus_smach] make roseus_smach execution faster (#684)

    • sleep 0.5 s for publisher
    • use ros::sleep for smach execution
  • [roseus_smach] add more ros-info in convert-smach (#683)

  • [roseus_smach] fix typo in state-machine-utils.l (#693)

  • [roseus_smach] add :start-state and :goal-state in convert-smach (#682)

  • [roseus_smach] add groupname in state-machine-inspector (#691)

    • use send sm :spin-once in state-machine-utils.l
    • add groupname and spin-once with groupname
  • Updates to README sample code and explanations (#659)

    • extend test time limit to 120 sec for test-samples.l
    • add example/test for smach-simple with make-state-machine function
    • write more info similar to rospy implementation
    • add more info(URL/python code) on sample
    • fix typo of nestate state machine example path
    • add make-sample-parallel-state-machine tests
    • add more test, check :active-tates, duration time
  • [roseus_smach] use roseus for parallel-state-machine-sample (#651)

  • [roseus_smach] add smach_viewer installation to README (#641)

  • [roseus_smach] add code explanation of simple-state-machine in README.md. (#627)

  • Contributors: Guilherme Affonso, Kei Okada, Naoki Hiraoka, Naoya Yamaguchi, Shingo Kitagawa, Yoichiro Kawamura

1.7.4 (2019-02-04)

1.7.3 (2019-02-01)

  • check why test-smach-action-client-state failing on installed test (#570 )
  • fix make-state-machine docstring (#589 )
  • re-enable test-smach-action-client-state, which is removed in https://github.com/jsk-ros-pkg/jsk_roseus/pull/567#issuecomment-406841511
  • Add issue link in make-state-machine docstring (#595 )
  • roseus_smach: change the order of callee args for userdata in pddl2smach (#587)
  • roseus_smach: pass userdata values unless :arg-keys is set (#586)
    • roseus_smach: fix error on exec state machine without ri
  • Contributors: Guilherme Affonso, Yuki Furuta, Shingo Kitagawa

1.7.2 (2018-11-10)

1.7.1 (2018-07-22)

File truncated at 100 lines see the full file

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Dependant Packages

No known dependants.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged roseus_smach at Robotics Stack Exchange

Package symbol

roseus_smach package from jsk_roseus repo

jsk_roseus roseus roseus_mongo roseus_smach roseus_tutorials

ROS Distro
lunar

Package Summary

Tags No category tags.
Version 1.7.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_roseus.git
VCS Type git
VCS Version master
Last Updated 2025-02-13
Dev Status DEVELOPED
CI status Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

roseus_smach * Euslisp state machine class. it will be moved. * Message publisher for visualizing current state by smach_viewer. * Simple pickle dump script for debugging state machine. * Execute state machine as a action server.

Additional Links

Maintainers

  • Kei Okada

Authors

  • Manabu Saito

roseus_smach

This package includes euslisp implementation of state machine and smach.

requirements

  • roseus
  • smach
  • smach_viewer
    • Optional for visualization.
    • You have to install this package manually:
      sudo apt install ros-$ROS_DISTRO-smach-viewer

sample

Sample codes are available on sample directory.

  • rosrun roseus_smach state-machine-ros-sample.l
    • simple state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-simple)
  
  • nested state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-nested)
  
  • state machine with userdata
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-userdata)
  
  • sample/parallel-state-machine-sample.l

    • state machine with parallel action execution
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach parallel-state-machine-sample.l
  (demo)
  

Writing Simple Smach(state-machine)

Example codes are here.

#!/usr/bin/env roseus
(load "package://roseus_smach/src/state-machine.l")

(setq count 0)
(defun func-foo (userdata-alist)
  (format t "Execute state FOO~%")
  (cond ((< count 3) (incf count) :outcome1)
	(t :outcome2)))
(defun func-bar (userdata-alist)
  (format t "Execute state BAR~%")
  :outcome2)

(defun smach-simple ()
  (let ((sm (instance state-machine :init)))
    (send sm :add-node (instance state :init :FOO 'func-foo))
    (send sm :add-node (instance state :init :BAR 'func-bar))
    ;; goal-states are generated in this method
    (send sm :goal-state (list :outcome4 :outcome5))

    ;; select a node as start-node
    (send sm :start-state :FOO)
    ;; from and to nodes are selected by name or symbol
    (send sm :add-transition :FOO :BAR :outcome1)
    (send sm :add-transition :FOO :outcome4 :outcome2)
    (send sm :add-transition :BAR :FOO :outcome2)
    sm ))

(send (smach-simple) :execute nil)

The Code Explained

(load "package://roseus_smach/src/state-machine.l")

This line imports state-machine class, state class, and transition class.

```lisp (defun func-foo (userdata-alist)

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package roseus_smach

1.7.5 (2021-12-13)

  • [roseus_smach] add :append-goal-state (#696)

  • add nested example with make-state-machine function (#661)

    • add readme on smach-simple-nested

    * use defmacro instead of defun for make-simple-state without this, 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 ))[ to avoid ]{.title-ref}/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...[ errors, this change enable us to write intuitive way ]{.title-ref}'((:bas 'func-bas) ;; functon maps (:sub sm-sub)) ;; set "nestaed state machine"[ you can test this behavior with ]{.title-ref}(defmacro test (l) `(dolist (e ,l) (print e) (print (eval (cadr e))))) (defmacro test (l) (dolist (e l) (print e) (print (eval (cadr e))))) (let (a) (setq a 10) (test '((:foo 1) (:bar a))))`

  • [roseus_smach] make roseus_smach execution faster (#684)

    • sleep 0.5 s for publisher
    • use ros::sleep for smach execution
  • [roseus_smach] add more ros-info in convert-smach (#683)

  • [roseus_smach] fix typo in state-machine-utils.l (#693)

  • [roseus_smach] add :start-state and :goal-state in convert-smach (#682)

  • [roseus_smach] add groupname in state-machine-inspector (#691)

    • use send sm :spin-once in state-machine-utils.l
    • add groupname and spin-once with groupname
  • Updates to README sample code and explanations (#659)

    • extend test time limit to 120 sec for test-samples.l
    • add example/test for smach-simple with make-state-machine function
    • write more info similar to rospy implementation
    • add more info(URL/python code) on sample
    • fix typo of nestate state machine example path
    • add make-sample-parallel-state-machine tests
    • add more test, check :active-tates, duration time
  • [roseus_smach] use roseus for parallel-state-machine-sample (#651)

  • [roseus_smach] add smach_viewer installation to README (#641)

  • [roseus_smach] add code explanation of simple-state-machine in README.md. (#627)

  • Contributors: Guilherme Affonso, Kei Okada, Naoki Hiraoka, Naoya Yamaguchi, Shingo Kitagawa, Yoichiro Kawamura

1.7.4 (2019-02-04)

1.7.3 (2019-02-01)

  • check why test-smach-action-client-state failing on installed test (#570 )
  • fix make-state-machine docstring (#589 )
  • re-enable test-smach-action-client-state, which is removed in https://github.com/jsk-ros-pkg/jsk_roseus/pull/567#issuecomment-406841511
  • Add issue link in make-state-machine docstring (#595 )
  • roseus_smach: change the order of callee args for userdata in pddl2smach (#587)
  • roseus_smach: pass userdata values unless :arg-keys is set (#586)
    • roseus_smach: fix error on exec state machine without ri
  • Contributors: Guilherme Affonso, Yuki Furuta, Shingo Kitagawa

1.7.2 (2018-11-10)

1.7.1 (2018-07-22)

File truncated at 100 lines see the full file

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Dependant Packages

No known dependants.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged roseus_smach at Robotics Stack Exchange

Package symbol

roseus_smach package from jsk_roseus repo

jsk_roseus roseus roseus_mongo roseus_smach roseus_tutorials

ROS Distro
jade

Package Summary

Tags No category tags.
Version 1.7.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_roseus.git
VCS Type git
VCS Version master
Last Updated 2025-02-13
Dev Status DEVELOPED
CI status Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

roseus_smach * Euslisp state machine class. it will be moved. * Message publisher for visualizing current state by smach_viewer. * Simple pickle dump script for debugging state machine. * Execute state machine as a action server.

Additional Links

Maintainers

  • Kei Okada

Authors

  • Manabu Saito

roseus_smach

This package includes euslisp implementation of state machine and smach.

requirements

  • roseus
  • smach
  • smach_viewer
    • Optional for visualization.
    • You have to install this package manually:
      sudo apt install ros-$ROS_DISTRO-smach-viewer

sample

Sample codes are available on sample directory.

  • rosrun roseus_smach state-machine-ros-sample.l
    • simple state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-simple)
  
  • nested state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-nested)
  
  • state machine with userdata
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-userdata)
  
  • sample/parallel-state-machine-sample.l

    • state machine with parallel action execution
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach parallel-state-machine-sample.l
  (demo)
  

Writing Simple Smach(state-machine)

Example codes are here.

#!/usr/bin/env roseus
(load "package://roseus_smach/src/state-machine.l")

(setq count 0)
(defun func-foo (userdata-alist)
  (format t "Execute state FOO~%")
  (cond ((< count 3) (incf count) :outcome1)
	(t :outcome2)))
(defun func-bar (userdata-alist)
  (format t "Execute state BAR~%")
  :outcome2)

(defun smach-simple ()
  (let ((sm (instance state-machine :init)))
    (send sm :add-node (instance state :init :FOO 'func-foo))
    (send sm :add-node (instance state :init :BAR 'func-bar))
    ;; goal-states are generated in this method
    (send sm :goal-state (list :outcome4 :outcome5))

    ;; select a node as start-node
    (send sm :start-state :FOO)
    ;; from and to nodes are selected by name or symbol
    (send sm :add-transition :FOO :BAR :outcome1)
    (send sm :add-transition :FOO :outcome4 :outcome2)
    (send sm :add-transition :BAR :FOO :outcome2)
    sm ))

(send (smach-simple) :execute nil)

The Code Explained

(load "package://roseus_smach/src/state-machine.l")

This line imports state-machine class, state class, and transition class.

```lisp (defun func-foo (userdata-alist)

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package roseus_smach

1.7.5 (2021-12-13)

  • [roseus_smach] add :append-goal-state (#696)

  • add nested example with make-state-machine function (#661)

    • add readme on smach-simple-nested

    * use defmacro instead of defun for make-simple-state without this, 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 ))[ to avoid ]{.title-ref}/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...[ errors, this change enable us to write intuitive way ]{.title-ref}'((:bas 'func-bas) ;; functon maps (:sub sm-sub)) ;; set "nestaed state machine"[ you can test this behavior with ]{.title-ref}(defmacro test (l) `(dolist (e ,l) (print e) (print (eval (cadr e))))) (defmacro test (l) (dolist (e l) (print e) (print (eval (cadr e))))) (let (a) (setq a 10) (test '((:foo 1) (:bar a))))`

  • [roseus_smach] make roseus_smach execution faster (#684)

    • sleep 0.5 s for publisher
    • use ros::sleep for smach execution
  • [roseus_smach] add more ros-info in convert-smach (#683)

  • [roseus_smach] fix typo in state-machine-utils.l (#693)

  • [roseus_smach] add :start-state and :goal-state in convert-smach (#682)

  • [roseus_smach] add groupname in state-machine-inspector (#691)

    • use send sm :spin-once in state-machine-utils.l
    • add groupname and spin-once with groupname
  • Updates to README sample code and explanations (#659)

    • extend test time limit to 120 sec for test-samples.l
    • add example/test for smach-simple with make-state-machine function
    • write more info similar to rospy implementation
    • add more info(URL/python code) on sample
    • fix typo of nestate state machine example path
    • add make-sample-parallel-state-machine tests
    • add more test, check :active-tates, duration time
  • [roseus_smach] use roseus for parallel-state-machine-sample (#651)

  • [roseus_smach] add smach_viewer installation to README (#641)

  • [roseus_smach] add code explanation of simple-state-machine in README.md. (#627)

  • Contributors: Guilherme Affonso, Kei Okada, Naoki Hiraoka, Naoya Yamaguchi, Shingo Kitagawa, Yoichiro Kawamura

1.7.4 (2019-02-04)

1.7.3 (2019-02-01)

  • check why test-smach-action-client-state failing on installed test (#570 )
  • fix make-state-machine docstring (#589 )
  • re-enable test-smach-action-client-state, which is removed in https://github.com/jsk-ros-pkg/jsk_roseus/pull/567#issuecomment-406841511
  • Add issue link in make-state-machine docstring (#595 )
  • roseus_smach: change the order of callee args for userdata in pddl2smach (#587)
  • roseus_smach: pass userdata values unless :arg-keys is set (#586)
    • roseus_smach: fix error on exec state machine without ri
  • Contributors: Guilherme Affonso, Yuki Furuta, Shingo Kitagawa

1.7.2 (2018-11-10)

1.7.1 (2018-07-22)

File truncated at 100 lines see the full file

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged roseus_smach at Robotics Stack Exchange

Package symbol

roseus_smach package from jsk_roseus repo

jsk_roseus roseus roseus_mongo roseus_smach roseus_tutorials

ROS Distro
indigo

Package Summary

Tags No category tags.
Version 1.7.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_roseus.git
VCS Type git
VCS Version master
Last Updated 2025-02-13
Dev Status DEVELOPED
CI status Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

roseus_smach * Euslisp state machine class. it will be moved. * Message publisher for visualizing current state by smach_viewer. * Simple pickle dump script for debugging state machine. * Execute state machine as a action server.

Additional Links

Maintainers

  • Kei Okada

Authors

  • Manabu Saito

roseus_smach

This package includes euslisp implementation of state machine and smach.

requirements

  • roseus
  • smach
  • smach_viewer
    • Optional for visualization.
    • You have to install this package manually:
      sudo apt install ros-$ROS_DISTRO-smach-viewer

sample

Sample codes are available on sample directory.

  • rosrun roseus_smach state-machine-ros-sample.l
    • simple state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-simple)
  
  • nested state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-nested)
  
  • state machine with userdata
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-userdata)
  
  • sample/parallel-state-machine-sample.l

    • state machine with parallel action execution
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach parallel-state-machine-sample.l
  (demo)
  

Writing Simple Smach(state-machine)

Example codes are here.

#!/usr/bin/env roseus
(load "package://roseus_smach/src/state-machine.l")

(setq count 0)
(defun func-foo (userdata-alist)
  (format t "Execute state FOO~%")
  (cond ((< count 3) (incf count) :outcome1)
	(t :outcome2)))
(defun func-bar (userdata-alist)
  (format t "Execute state BAR~%")
  :outcome2)

(defun smach-simple ()
  (let ((sm (instance state-machine :init)))
    (send sm :add-node (instance state :init :FOO 'func-foo))
    (send sm :add-node (instance state :init :BAR 'func-bar))
    ;; goal-states are generated in this method
    (send sm :goal-state (list :outcome4 :outcome5))

    ;; select a node as start-node
    (send sm :start-state :FOO)
    ;; from and to nodes are selected by name or symbol
    (send sm :add-transition :FOO :BAR :outcome1)
    (send sm :add-transition :FOO :outcome4 :outcome2)
    (send sm :add-transition :BAR :FOO :outcome2)
    sm ))

(send (smach-simple) :execute nil)

The Code Explained

(load "package://roseus_smach/src/state-machine.l")

This line imports state-machine class, state class, and transition class.

```lisp (defun func-foo (userdata-alist)

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package roseus_smach

1.7.5 (2021-12-13)

  • [roseus_smach] add :append-goal-state (#696)

  • add nested example with make-state-machine function (#661)

    • add readme on smach-simple-nested

    * use defmacro instead of defun for make-simple-state without this, 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 ))[ to avoid ]{.title-ref}/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...[ errors, this change enable us to write intuitive way ]{.title-ref}'((:bas 'func-bas) ;; functon maps (:sub sm-sub)) ;; set "nestaed state machine"[ you can test this behavior with ]{.title-ref}(defmacro test (l) `(dolist (e ,l) (print e) (print (eval (cadr e))))) (defmacro test (l) (dolist (e l) (print e) (print (eval (cadr e))))) (let (a) (setq a 10) (test '((:foo 1) (:bar a))))`

  • [roseus_smach] make roseus_smach execution faster (#684)

    • sleep 0.5 s for publisher
    • use ros::sleep for smach execution
  • [roseus_smach] add more ros-info in convert-smach (#683)

  • [roseus_smach] fix typo in state-machine-utils.l (#693)

  • [roseus_smach] add :start-state and :goal-state in convert-smach (#682)

  • [roseus_smach] add groupname in state-machine-inspector (#691)

    • use send sm :spin-once in state-machine-utils.l
    • add groupname and spin-once with groupname
  • Updates to README sample code and explanations (#659)

    • extend test time limit to 120 sec for test-samples.l
    • add example/test for smach-simple with make-state-machine function
    • write more info similar to rospy implementation
    • add more info(URL/python code) on sample
    • fix typo of nestate state machine example path
    • add make-sample-parallel-state-machine tests
    • add more test, check :active-tates, duration time
  • [roseus_smach] use roseus for parallel-state-machine-sample (#651)

  • [roseus_smach] add smach_viewer installation to README (#641)

  • [roseus_smach] add code explanation of simple-state-machine in README.md. (#627)

  • Contributors: Guilherme Affonso, Kei Okada, Naoki Hiraoka, Naoya Yamaguchi, Shingo Kitagawa, Yoichiro Kawamura

1.7.4 (2019-02-04)

1.7.3 (2019-02-01)

  • check why test-smach-action-client-state failing on installed test (#570 )
  • fix make-state-machine docstring (#589 )
  • re-enable test-smach-action-client-state, which is removed in https://github.com/jsk-ros-pkg/jsk_roseus/pull/567#issuecomment-406841511
  • Add issue link in make-state-machine docstring (#595 )
  • roseus_smach: change the order of callee args for userdata in pddl2smach (#587)
  • roseus_smach: pass userdata values unless :arg-keys is set (#586)
    • roseus_smach: fix error on exec state machine without ri
  • Contributors: Guilherme Affonso, Yuki Furuta, Shingo Kitagawa

1.7.2 (2018-11-10)

1.7.1 (2018-07-22)

File truncated at 100 lines see the full file

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged roseus_smach at Robotics Stack Exchange

Package symbol

roseus_smach package from jsk_roseus repo

jsk_roseus roseus roseus_mongo roseus_smach roseus_tutorials

ROS Distro
hydro

Package Summary

Tags No category tags.
Version 1.7.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_roseus.git
VCS Type git
VCS Version master
Last Updated 2025-02-13
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

roseus_smach * Euslisp state machine class. it will be moved. * Message publisher for visualizing current state by smach_viewer. * Simple pickle dump script for debugging state machine. * Execute state machine as a action server.

Additional Links

Maintainers

  • Kei Okada

Authors

  • Manabu Saito

roseus_smach

This package includes euslisp implementation of state machine and smach.

requirements

  • roseus
  • smach
  • smach_viewer
    • Optional for visualization.
    • You have to install this package manually:
      sudo apt install ros-$ROS_DISTRO-smach-viewer

sample

Sample codes are available on sample directory.

  • rosrun roseus_smach state-machine-ros-sample.l
    • simple state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-simple)
  
  • nested state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-nested)
  
  • state machine with userdata
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-userdata)
  
  • sample/parallel-state-machine-sample.l

    • state machine with parallel action execution
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach parallel-state-machine-sample.l
  (demo)
  

Writing Simple Smach(state-machine)

Example codes are here.

#!/usr/bin/env roseus
(load "package://roseus_smach/src/state-machine.l")

(setq count 0)
(defun func-foo (userdata-alist)
  (format t "Execute state FOO~%")
  (cond ((< count 3) (incf count) :outcome1)
	(t :outcome2)))
(defun func-bar (userdata-alist)
  (format t "Execute state BAR~%")
  :outcome2)

(defun smach-simple ()
  (let ((sm (instance state-machine :init)))
    (send sm :add-node (instance state :init :FOO 'func-foo))
    (send sm :add-node (instance state :init :BAR 'func-bar))
    ;; goal-states are generated in this method
    (send sm :goal-state (list :outcome4 :outcome5))

    ;; select a node as start-node
    (send sm :start-state :FOO)
    ;; from and to nodes are selected by name or symbol
    (send sm :add-transition :FOO :BAR :outcome1)
    (send sm :add-transition :FOO :outcome4 :outcome2)
    (send sm :add-transition :BAR :FOO :outcome2)
    sm ))

(send (smach-simple) :execute nil)

The Code Explained

(load "package://roseus_smach/src/state-machine.l")

This line imports state-machine class, state class, and transition class.

```lisp (defun func-foo (userdata-alist)

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package roseus_smach

1.7.5 (2021-12-13)

  • [roseus_smach] add :append-goal-state (#696)

  • add nested example with make-state-machine function (#661)

    • add readme on smach-simple-nested

    * use defmacro instead of defun for make-simple-state without this, 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 ))[ to avoid ]{.title-ref}/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...[ errors, this change enable us to write intuitive way ]{.title-ref}'((:bas 'func-bas) ;; functon maps (:sub sm-sub)) ;; set "nestaed state machine"[ you can test this behavior with ]{.title-ref}(defmacro test (l) `(dolist (e ,l) (print e) (print (eval (cadr e))))) (defmacro test (l) (dolist (e l) (print e) (print (eval (cadr e))))) (let (a) (setq a 10) (test '((:foo 1) (:bar a))))`

  • [roseus_smach] make roseus_smach execution faster (#684)

    • sleep 0.5 s for publisher
    • use ros::sleep for smach execution
  • [roseus_smach] add more ros-info in convert-smach (#683)

  • [roseus_smach] fix typo in state-machine-utils.l (#693)

  • [roseus_smach] add :start-state and :goal-state in convert-smach (#682)

  • [roseus_smach] add groupname in state-machine-inspector (#691)

    • use send sm :spin-once in state-machine-utils.l
    • add groupname and spin-once with groupname
  • Updates to README sample code and explanations (#659)

    • extend test time limit to 120 sec for test-samples.l
    • add example/test for smach-simple with make-state-machine function
    • write more info similar to rospy implementation
    • add more info(URL/python code) on sample
    • fix typo of nestate state machine example path
    • add make-sample-parallel-state-machine tests
    • add more test, check :active-tates, duration time
  • [roseus_smach] use roseus for parallel-state-machine-sample (#651)

  • [roseus_smach] add smach_viewer installation to README (#641)

  • [roseus_smach] add code explanation of simple-state-machine in README.md. (#627)

  • Contributors: Guilherme Affonso, Kei Okada, Naoki Hiraoka, Naoya Yamaguchi, Shingo Kitagawa, Yoichiro Kawamura

1.7.4 (2019-02-04)

1.7.3 (2019-02-01)

  • check why test-smach-action-client-state failing on installed test (#570 )
  • fix make-state-machine docstring (#589 )
  • re-enable test-smach-action-client-state, which is removed in https://github.com/jsk-ros-pkg/jsk_roseus/pull/567#issuecomment-406841511
  • Add issue link in make-state-machine docstring (#595 )
  • roseus_smach: change the order of callee args for userdata in pddl2smach (#587)
  • roseus_smach: pass userdata values unless :arg-keys is set (#586)
    • roseus_smach: fix error on exec state machine without ri
  • Contributors: Guilherme Affonso, Yuki Furuta, Shingo Kitagawa

1.7.2 (2018-11-10)

1.7.1 (2018-07-22)

File truncated at 100 lines see the full file

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged roseus_smach at Robotics Stack Exchange

Package symbol

roseus_smach package from jsk_roseus repo

jsk_roseus roseus roseus_mongo roseus_smach roseus_tutorials

ROS Distro
kinetic

Package Summary

Tags No category tags.
Version 1.7.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_roseus.git
VCS Type git
VCS Version master
Last Updated 2025-02-13
Dev Status DEVELOPED
CI status Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

roseus_smach * Euslisp state machine class. it will be moved. * Message publisher for visualizing current state by smach_viewer. * Simple pickle dump script for debugging state machine. * Execute state machine as a action server.

Additional Links

Maintainers

  • Kei Okada

Authors

  • Manabu Saito

roseus_smach

This package includes euslisp implementation of state machine and smach.

requirements

  • roseus
  • smach
  • smach_viewer
    • Optional for visualization.
    • You have to install this package manually:
      sudo apt install ros-$ROS_DISTRO-smach-viewer

sample

Sample codes are available on sample directory.

  • rosrun roseus_smach state-machine-ros-sample.l
    • simple state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-simple)
  
  • nested state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-nested)
  
  • state machine with userdata
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-userdata)
  
  • sample/parallel-state-machine-sample.l

    • state machine with parallel action execution
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach parallel-state-machine-sample.l
  (demo)
  

Writing Simple Smach(state-machine)

Example codes are here.

#!/usr/bin/env roseus
(load "package://roseus_smach/src/state-machine.l")

(setq count 0)
(defun func-foo (userdata-alist)
  (format t "Execute state FOO~%")
  (cond ((< count 3) (incf count) :outcome1)
	(t :outcome2)))
(defun func-bar (userdata-alist)
  (format t "Execute state BAR~%")
  :outcome2)

(defun smach-simple ()
  (let ((sm (instance state-machine :init)))
    (send sm :add-node (instance state :init :FOO 'func-foo))
    (send sm :add-node (instance state :init :BAR 'func-bar))
    ;; goal-states are generated in this method
    (send sm :goal-state (list :outcome4 :outcome5))

    ;; select a node as start-node
    (send sm :start-state :FOO)
    ;; from and to nodes are selected by name or symbol
    (send sm :add-transition :FOO :BAR :outcome1)
    (send sm :add-transition :FOO :outcome4 :outcome2)
    (send sm :add-transition :BAR :FOO :outcome2)
    sm ))

(send (smach-simple) :execute nil)

The Code Explained

(load "package://roseus_smach/src/state-machine.l")

This line imports state-machine class, state class, and transition class.

```lisp (defun func-foo (userdata-alist)

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package roseus_smach

1.7.5 (2021-12-13)

  • [roseus_smach] add :append-goal-state (#696)

  • add nested example with make-state-machine function (#661)

    • add readme on smach-simple-nested

    * use defmacro instead of defun for make-simple-state without this, 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 ))[ to avoid ]{.title-ref}/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...[ errors, this change enable us to write intuitive way ]{.title-ref}'((:bas 'func-bas) ;; functon maps (:sub sm-sub)) ;; set "nestaed state machine"[ you can test this behavior with ]{.title-ref}(defmacro test (l) `(dolist (e ,l) (print e) (print (eval (cadr e))))) (defmacro test (l) (dolist (e l) (print e) (print (eval (cadr e))))) (let (a) (setq a 10) (test '((:foo 1) (:bar a))))`

  • [roseus_smach] make roseus_smach execution faster (#684)

    • sleep 0.5 s for publisher
    • use ros::sleep for smach execution
  • [roseus_smach] add more ros-info in convert-smach (#683)

  • [roseus_smach] fix typo in state-machine-utils.l (#693)

  • [roseus_smach] add :start-state and :goal-state in convert-smach (#682)

  • [roseus_smach] add groupname in state-machine-inspector (#691)

    • use send sm :spin-once in state-machine-utils.l
    • add groupname and spin-once with groupname
  • Updates to README sample code and explanations (#659)

    • extend test time limit to 120 sec for test-samples.l
    • add example/test for smach-simple with make-state-machine function
    • write more info similar to rospy implementation
    • add more info(URL/python code) on sample
    • fix typo of nestate state machine example path
    • add make-sample-parallel-state-machine tests
    • add more test, check :active-tates, duration time
  • [roseus_smach] use roseus for parallel-state-machine-sample (#651)

  • [roseus_smach] add smach_viewer installation to README (#641)

  • [roseus_smach] add code explanation of simple-state-machine in README.md. (#627)

  • Contributors: Guilherme Affonso, Kei Okada, Naoki Hiraoka, Naoya Yamaguchi, Shingo Kitagawa, Yoichiro Kawamura

1.7.4 (2019-02-04)

1.7.3 (2019-02-01)

  • check why test-smach-action-client-state failing on installed test (#570 )
  • fix make-state-machine docstring (#589 )
  • re-enable test-smach-action-client-state, which is removed in https://github.com/jsk-ros-pkg/jsk_roseus/pull/567#issuecomment-406841511
  • Add issue link in make-state-machine docstring (#595 )
  • roseus_smach: change the order of callee args for userdata in pddl2smach (#587)
  • roseus_smach: pass userdata values unless :arg-keys is set (#586)
    • roseus_smach: fix error on exec state machine without ri
  • Contributors: Guilherme Affonso, Yuki Furuta, Shingo Kitagawa

1.7.2 (2018-11-10)

1.7.1 (2018-07-22)

File truncated at 100 lines see the full file

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged roseus_smach at Robotics Stack Exchange

Package symbol

roseus_smach package from jsk_roseus repo

jsk_roseus roseus roseus_mongo roseus_smach roseus_tutorials

ROS Distro
melodic

Package Summary

Tags No category tags.
Version 1.7.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_roseus.git
VCS Type git
VCS Version master
Last Updated 2025-02-13
Dev Status DEVELOPED
CI status
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

roseus_smach * Euslisp state machine class. it will be moved. * Message publisher for visualizing current state by smach_viewer. * Simple pickle dump script for debugging state machine. * Execute state machine as a action server.

Additional Links

Maintainers

  • Kei Okada

Authors

  • Manabu Saito

roseus_smach

This package includes euslisp implementation of state machine and smach.

requirements

  • roseus
  • smach
  • smach_viewer
    • Optional for visualization.
    • You have to install this package manually:
      sudo apt install ros-$ROS_DISTRO-smach-viewer

sample

Sample codes are available on sample directory.

  • rosrun roseus_smach state-machine-ros-sample.l
    • simple state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-simple)
  
  • nested state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-nested)
  
  • state machine with userdata
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-userdata)
  
  • sample/parallel-state-machine-sample.l

    • state machine with parallel action execution
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach parallel-state-machine-sample.l
  (demo)
  

Writing Simple Smach(state-machine)

Example codes are here.

#!/usr/bin/env roseus
(load "package://roseus_smach/src/state-machine.l")

(setq count 0)
(defun func-foo (userdata-alist)
  (format t "Execute state FOO~%")
  (cond ((< count 3) (incf count) :outcome1)
	(t :outcome2)))
(defun func-bar (userdata-alist)
  (format t "Execute state BAR~%")
  :outcome2)

(defun smach-simple ()
  (let ((sm (instance state-machine :init)))
    (send sm :add-node (instance state :init :FOO 'func-foo))
    (send sm :add-node (instance state :init :BAR 'func-bar))
    ;; goal-states are generated in this method
    (send sm :goal-state (list :outcome4 :outcome5))

    ;; select a node as start-node
    (send sm :start-state :FOO)
    ;; from and to nodes are selected by name or symbol
    (send sm :add-transition :FOO :BAR :outcome1)
    (send sm :add-transition :FOO :outcome4 :outcome2)
    (send sm :add-transition :BAR :FOO :outcome2)
    sm ))

(send (smach-simple) :execute nil)

The Code Explained

(load "package://roseus_smach/src/state-machine.l")

This line imports state-machine class, state class, and transition class.

```lisp (defun func-foo (userdata-alist)

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package roseus_smach

1.7.5 (2021-12-13)

  • [roseus_smach] add :append-goal-state (#696)

  • add nested example with make-state-machine function (#661)

    • add readme on smach-simple-nested

    * use defmacro instead of defun for make-simple-state without this, 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 ))[ to avoid ]{.title-ref}/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...[ errors, this change enable us to write intuitive way ]{.title-ref}'((:bas 'func-bas) ;; functon maps (:sub sm-sub)) ;; set "nestaed state machine"[ you can test this behavior with ]{.title-ref}(defmacro test (l) `(dolist (e ,l) (print e) (print (eval (cadr e))))) (defmacro test (l) (dolist (e l) (print e) (print (eval (cadr e))))) (let (a) (setq a 10) (test '((:foo 1) (:bar a))))`

  • [roseus_smach] make roseus_smach execution faster (#684)

    • sleep 0.5 s for publisher
    • use ros::sleep for smach execution
  • [roseus_smach] add more ros-info in convert-smach (#683)

  • [roseus_smach] fix typo in state-machine-utils.l (#693)

  • [roseus_smach] add :start-state and :goal-state in convert-smach (#682)

  • [roseus_smach] add groupname in state-machine-inspector (#691)

    • use send sm :spin-once in state-machine-utils.l
    • add groupname and spin-once with groupname
  • Updates to README sample code and explanations (#659)

    • extend test time limit to 120 sec for test-samples.l
    • add example/test for smach-simple with make-state-machine function
    • write more info similar to rospy implementation
    • add more info(URL/python code) on sample
    • fix typo of nestate state machine example path
    • add make-sample-parallel-state-machine tests
    • add more test, check :active-tates, duration time
  • [roseus_smach] use roseus for parallel-state-machine-sample (#651)

  • [roseus_smach] add smach_viewer installation to README (#641)

  • [roseus_smach] add code explanation of simple-state-machine in README.md. (#627)

  • Contributors: Guilherme Affonso, Kei Okada, Naoki Hiraoka, Naoya Yamaguchi, Shingo Kitagawa, Yoichiro Kawamura

1.7.4 (2019-02-04)

1.7.3 (2019-02-01)

  • check why test-smach-action-client-state failing on installed test (#570 )
  • fix make-state-machine docstring (#589 )
  • re-enable test-smach-action-client-state, which is removed in https://github.com/jsk-ros-pkg/jsk_roseus/pull/567#issuecomment-406841511
  • Add issue link in make-state-machine docstring (#595 )
  • roseus_smach: change the order of callee args for userdata in pddl2smach (#587)
  • roseus_smach: pass userdata values unless :arg-keys is set (#586)
    • roseus_smach: fix error on exec state machine without ri
  • Contributors: Guilherme Affonso, Yuki Furuta, Shingo Kitagawa

1.7.2 (2018-11-10)

1.7.1 (2018-07-22)

File truncated at 100 lines see the full file

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged roseus_smach at Robotics Stack Exchange

Package symbol

roseus_smach package from jsk_roseus repo

jsk_roseus roseus roseus_mongo roseus_smach roseus_tutorials

ROS Distro
noetic

Package Summary

Tags No category tags.
Version 1.7.5
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/jsk-ros-pkg/jsk_roseus.git
VCS Type git
VCS Version master
Last Updated 2025-02-13
Dev Status DEVELOPED
CI status Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

roseus_smach * Euslisp state machine class. it will be moved. * Message publisher for visualizing current state by smach_viewer. * Simple pickle dump script for debugging state machine. * Execute state machine as a action server.

Additional Links

Maintainers

  • Kei Okada

Authors

  • Manabu Saito

roseus_smach

This package includes euslisp implementation of state machine and smach.

requirements

  • roseus
  • smach
  • smach_viewer
    • Optional for visualization.
    • You have to install this package manually:
      sudo apt install ros-$ROS_DISTRO-smach-viewer

sample

Sample codes are available on sample directory.

  • rosrun roseus_smach state-machine-ros-sample.l
    • simple state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-simple)
  
  • nested state machine
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-nested)
  
  • state machine with userdata
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach state-machine-ros-sample.l
  (exec-smach-userdata)
  
  • sample/parallel-state-machine-sample.l

    • state machine with parallel action execution
  rosrun smach_viewer smach_viewer.py
  
  rosrun roseus_smach parallel-state-machine-sample.l
  (demo)
  

Writing Simple Smach(state-machine)

Example codes are here.

#!/usr/bin/env roseus
(load "package://roseus_smach/src/state-machine.l")

(setq count 0)
(defun func-foo (userdata-alist)
  (format t "Execute state FOO~%")
  (cond ((< count 3) (incf count) :outcome1)
	(t :outcome2)))
(defun func-bar (userdata-alist)
  (format t "Execute state BAR~%")
  :outcome2)

(defun smach-simple ()
  (let ((sm (instance state-machine :init)))
    (send sm :add-node (instance state :init :FOO 'func-foo))
    (send sm :add-node (instance state :init :BAR 'func-bar))
    ;; goal-states are generated in this method
    (send sm :goal-state (list :outcome4 :outcome5))

    ;; select a node as start-node
    (send sm :start-state :FOO)
    ;; from and to nodes are selected by name or symbol
    (send sm :add-transition :FOO :BAR :outcome1)
    (send sm :add-transition :FOO :outcome4 :outcome2)
    (send sm :add-transition :BAR :FOO :outcome2)
    sm ))

(send (smach-simple) :execute nil)

The Code Explained

(load "package://roseus_smach/src/state-machine.l")

This line imports state-machine class, state class, and transition class.

```lisp (defun func-foo (userdata-alist)

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package roseus_smach

1.7.5 (2021-12-13)

  • [roseus_smach] add :append-goal-state (#696)

  • add nested example with make-state-machine function (#661)

    • add readme on smach-simple-nested

    * use defmacro instead of defun for make-simple-state without this, 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 ))[ to avoid ]{.title-ref}/opt/ros/melodic/share/euslisp/jskeus/eus/Linux64/bin/irteusgl unittest-error: unbound variable sm-sub in (eval (get-alist node func-map)), exitting...[ errors, this change enable us to write intuitive way ]{.title-ref}'((:bas 'func-bas) ;; functon maps (:sub sm-sub)) ;; set "nestaed state machine"[ you can test this behavior with ]{.title-ref}(defmacro test (l) `(dolist (e ,l) (print e) (print (eval (cadr e))))) (defmacro test (l) (dolist (e l) (print e) (print (eval (cadr e))))) (let (a) (setq a 10) (test '((:foo 1) (:bar a))))`

  • [roseus_smach] make roseus_smach execution faster (#684)

    • sleep 0.5 s for publisher
    • use ros::sleep for smach execution
  • [roseus_smach] add more ros-info in convert-smach (#683)

  • [roseus_smach] fix typo in state-machine-utils.l (#693)

  • [roseus_smach] add :start-state and :goal-state in convert-smach (#682)

  • [roseus_smach] add groupname in state-machine-inspector (#691)

    • use send sm :spin-once in state-machine-utils.l
    • add groupname and spin-once with groupname
  • Updates to README sample code and explanations (#659)

    • extend test time limit to 120 sec for test-samples.l
    • add example/test for smach-simple with make-state-machine function
    • write more info similar to rospy implementation
    • add more info(URL/python code) on sample
    • fix typo of nestate state machine example path
    • add make-sample-parallel-state-machine tests
    • add more test, check :active-tates, duration time
  • [roseus_smach] use roseus for parallel-state-machine-sample (#651)

  • [roseus_smach] add smach_viewer installation to README (#641)

  • [roseus_smach] add code explanation of simple-state-machine in README.md. (#627)

  • Contributors: Guilherme Affonso, Kei Okada, Naoki Hiraoka, Naoya Yamaguchi, Shingo Kitagawa, Yoichiro Kawamura

1.7.4 (2019-02-04)

1.7.3 (2019-02-01)

  • check why test-smach-action-client-state failing on installed test (#570 )
  • fix make-state-machine docstring (#589 )
  • re-enable test-smach-action-client-state, which is removed in https://github.com/jsk-ros-pkg/jsk_roseus/pull/567#issuecomment-406841511
  • Add issue link in make-state-machine docstring (#595 )
  • roseus_smach: change the order of callee args for userdata in pddl2smach (#587)
  • roseus_smach: pass userdata values unless :arg-keys is set (#586)
    • roseus_smach: fix error on exec state machine without ri
  • Contributors: Guilherme Affonso, Yuki Furuta, Shingo Kitagawa

1.7.2 (2018-11-10)

1.7.1 (2018-07-22)

File truncated at 100 lines see the full file

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged roseus_smach at Robotics Stack Exchange