Skip to content

Commit

Permalink
Merge pull request #695 from knorth55/smach-structure-pub
Browse files Browse the repository at this point in the history
  • Loading branch information
k-okada committed Jan 25, 2023
2 parents e17f10f + 5b9950d commit 3ce3325
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions roseus_smach/src/state-machine-ros.l
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
(ros::advertise
(concatenate string srv-name "/smach/container_structure")
smach_msgs::SmachContainerStructure 100 t) ;; latch type
;; we need to sleep a bit for waiting publisher's initialization
;; https://github.com/jsk-ros-pkg/jsk_roseus/pull/695
(unix::usleep (round (* 0.5 1e6)))
(if groupname
(ros::subscribe (concatenate string srv-name "/smach/container_init")
smach_msgs::SmachContainerInitialStatusCmd
Expand Down Expand Up @@ -88,6 +91,11 @@
(&optional (machine sm) (path (format nil "/~A" root-name)))
(let ((msg (instance smach_msgs::SmachContainerStructure :init))
transitions from-nodes to-nodes exec-nodes)
;; we need to sleep a bit to avoid too quick publication in the same topic name
;; :publish-structure calls :publish-structure itself inside,
;; which causes to quick publication in the same topic name
;; https://github.com/jsk-ros-pkg/jsk_roseus/pull/695
(unix::usleep (round (* 0.1 1e6)))
(send msg :header :seq (incf structure-counter))
(send msg :header :stamp (ros::time-now))
(send msg :path path)
Expand Down

0 comments on commit 3ce3325

Please sign in to comment.