From 7a9d7cfea2fc54b7dfac904deb1dd2342f65c056 Mon Sep 17 00:00:00 2001 From: Shingo Kitagawa Date: Thu, 1 Dec 2022 20:14:04 +0900 Subject: [PATCH 1/4] use float for waitForService --- roseus/roseus.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roseus/roseus.cpp b/roseus/roseus.cpp index 94fc9b17f..63e31df91 100644 --- a/roseus/roseus.cpp +++ b/roseus/roseus.cpp @@ -1082,15 +1082,16 @@ pointer ROSEUS_WAIT_FOR_SERVICE(register context *ctx,int n,pointer *argv) { isInstalledCheck; string service; + numunion nu; ckarg2(1,2); if (isstring(argv[0])) service = ros::names::resolve((char *)get_string(argv[0])); else error(E_NOSTRING); - int32_t timeout = -1; + float timeout = -1; if( n > 1 ) - timeout = (int32_t)ckintval(argv[1]); + timeout = ckfltval(argv[1]); bool bSuccess = service::waitForService(service, ros::Duration(timeout)); From 92a41d9e1f0e669258325f8b72e494b052c42cc8 Mon Sep 17 00:00:00 2001 From: Shingo Kitagawa Date: Tue, 6 Dec 2022 21:50:12 +0900 Subject: [PATCH 2/4] add flatten option for submachine search --- roseus_smach/src/state-machine.l | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/roseus_smach/src/state-machine.l b/roseus_smach/src/state-machine.l index 505fcb2ac..e935dfb39 100644 --- a/roseus_smach/src/state-machine.l +++ b/roseus_smach/src/state-machine.l @@ -20,6 +20,17 @@ (:init (&key (parallel nil)) (setq parallel-action-p parallel) self) + (:node (name &key (flatten nil)) + (if (and flatten (send self :sub-sm-node)) + (find name (send self :nodes :flatten t) + :key #'(lambda (x) (send x :name)) :test #'equal) + (send-super :node name))) + (:nodes (&key (flatten nil)) + (if (and flatten (send self :sub-sm-node)) + (append + (send-super :nodes) + (flatten (send-all (send-all (send self :sub-sm-node) :submachine) :nodes :flatten t))) + (send-super :nodes))) (:active-state (&rest args) (let ((node (car args))) From feb70ba977c206d23d9441ed71c0e4417ece38c1 Mon Sep 17 00:00:00 2001 From: Guilherme Affonso Date: Fri, 6 Jan 2023 17:18:07 +0900 Subject: [PATCH 3/4] Fix actionlib_msgs::lost -> actionlib_msgs::GoalStatus::*lost* --- roseus/euslisp/actionlib-commstate.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roseus/euslisp/actionlib-commstate.l b/roseus/euslisp/actionlib-commstate.l index 5eaf49518..b9eb63ba3 100644 --- a/roseus/euslisp/actionlib-commstate.l +++ b/roseus/euslisp/actionlib-commstate.l @@ -1,7 +1,7 @@ (if (not (find-package "ACTIONLIB_MSGS")) (ros::roseus-add-msgs "actionlib_msgs")) (defun goal-status-to-string (i) - (elt '(actionlib_msgs::GoalStatus::*pending* actionlib_msgs::GoalStatus::*active* actionlib_msgs::GoalStatus::*preempted* actionlib_msgs::GoalStatus::*succeeded* actionlib_msgs::GoalStatus::*aborted* actionlib_msgs::GoalStatus::*rejected* actionlib_msgs::GoalStatus::*preempting* actionlib_msgs::GoalStatus::*recalling* actionlib_msgs::GoalStatus::*recalled* actionlib_msgs::lost) i)) + (elt '(actionlib_msgs::GoalStatus::*pending* actionlib_msgs::GoalStatus::*active* actionlib_msgs::GoalStatus::*preempted* actionlib_msgs::GoalStatus::*succeeded* actionlib_msgs::GoalStatus::*aborted* actionlib_msgs::GoalStatus::*rejected* actionlib_msgs::GoalStatus::*preempting* actionlib_msgs::GoalStatus::*recalling* actionlib_msgs::GoalStatus::*recalled* actionlib_msgs::GoalStatus::*lost*) i)) ;; state machine transition (setq From e0c813c6afbaeec7bf2aaed713cf7927a643cb40 Mon Sep 17 00:00:00 2001 From: Kei Okada Date: Tue, 24 Jan 2023 19:17:30 +0900 Subject: [PATCH 4/4] test-add-two-ints.l: relax test condition for test-add-two-ints without persistent. we expect service call sometime fails without persistent --- roseus/test/test-add-two-ints.l | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roseus/test/test-add-two-ints.l b/roseus/test/test-add-two-ints.l index 222c65a62..59d5e4fea 100755 --- a/roseus/test/test-add-two-ints.l +++ b/roseus/test/test-add-two-ints.l @@ -52,9 +52,9 @@ (warning-message 3 (format nil "[~A] integration failure (~A+~A)=~A(~A)/=~A(~A)~%" service-call-error a b (+ a b) (class (+ a b)) (send res :sum) (class (send res :sum))))) - (assert (or (< service-call-error 3) (= (+ (send req :a) (send req :b)) (send res :sum))) - (format nil "integration failure (~A+~A)=~A(~A)/=~A(~A)" - a b (+ a b) (class (+ a b)) (send res :sum) (class (send res :sum)))) + (assert (or (< service-call-error 5) (= (+ (send req :a) (send req :b)) (send res :sum))) + (format nil "integration failure ~A times ... (~A+~A)=~A(~A)/=~A(~A)" + service-call-error a b (+ a b) (class (+ a b)) (send res :sum) (class (send res :sum)))) (sys::gc) )))