-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #673 from Affonso-Gui/fix_actionilb_preempt_status
Fix case function misuse in simple-action-server :set-preempted
- Loading branch information
Showing
3 changed files
with
48 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env roseus | ||
;;; | ||
;;; | ||
|
||
(require :unittest "lib/llib/unittest.l") | ||
(ros::load-ros-package "actionlib") | ||
;;; | ||
;;; | ||
(init-unit-test) | ||
|
||
(defun cancel-cb (server goal) | ||
(send server :set-preempted)) | ||
|
||
(deftest test-server-cancel () | ||
(let* ((server (instance ros::simple-action-server :init | ||
"/cancel_test" actionlib::TestAction | ||
:execute-cb #'cancel-cb)) | ||
(client (instance ros::simple-action-client :init | ||
"/cancel_test" actionlib::TestAction)) | ||
(goal (instance actionlib::TestActionGoal :init))) | ||
|
||
(send client :wait-for-server) | ||
(send client :send-goal goal) | ||
;; wait until the message is received | ||
(while (not (send server :is-active)) | ||
(ros::sleep) | ||
(send server :spin-once)) | ||
(send server :worker) | ||
(send client :spin-once) | ||
(ros::ros-info "action server returned with status: ~S" (send client :get-state)) | ||
(assert (equal actionlib_msgs::GoalStatus::*PREEMPTED* | ||
(send client :get-state))))))) | ||
|
||
(ros::roseus "server_cancel") | ||
(run-all-tests) | ||
|
||
(exit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<launch> | ||
<test test-name="simple_server_cancel" pkg="roseus" type="roseus" args="$(find roseus)/test/test-simple-server-cancel.l" /> | ||
</launch> |