Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resturn nil if :get-result called without sending goal #746

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion roseus/euslisp/actionlib.l
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,12 @@
(if (eq (send self :get-state) actionlib_msgs::GoalStatus::*preempted*)
(ros::ros-warn "[~A] :wait-for-result finished with preempted status" name-space))
(eq (send self :get-state) actionlib_msgs::GoalStatus::*succeeded*)))
(:get-result () (send (send comm-state :latest-result) :result))
(:get-result ()
(if (send comm-state :latest-result)
(send (send comm-state :latest-result) :result)
(progn
(ros::ros-error "[~A] :get-result called without sending goal, returns null result" name-space)
nil))) ;; return nil instead of (instance action-result-class :init)
(:get-state ()
(let (state)
(setq state (send (send comm-state :latest-goal-status) :status))
Expand Down
2 changes: 2 additions & 0 deletions roseus/test/test-actionlib.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
<node name="fibonacci_client" pkg="roseus" type="roseus" args="$(find roseus)/test/fibonacci-client.l" />
<test test-name="test_actionlib_client" pkg="roseus" type="roseus" args="$(find roseus)/test/test-actionlib.l"
time-limit="600" retry="3"/>
<test test-name="test_actionlib_client_result_before_start" pkg="roseus" type="roseus" args="$(find roseus)/test/test-actionlib-get-result-before-start.l"
time-limit="60" retry="1"/>
</launch>

Loading