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

roseus: add :last-status-msg method for simple-action-client #578

Merged
merged 2 commits into from Dec 30, 2018

Conversation

furushchev
Copy link
Member

@furushchev furushchev commented Sep 7, 2018

Adds :last-status-msg method to simple-action-client class.
One use case is to check if the action server is processing any goals from any clients.
In rospy, the message can be used in a similar way.

ac = actionlib.SimpleActionClient(...)
status = ac.action_client.last_status_msg

@furushchev
Copy link
Member Author

-------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>

<testsuite errors="0" failures="1" name="unittest.suite.TestSuite" tests="1" time="5.194">

  <testcase classname="__main__.HzTest" name="test_hz" time="5.1938">

    <failure type="AssertionError">average rate (10.618Hz) exceeded maximum (10.500Hz)

  File "/usr/lib/python2.7/unittest/case.py", line 331, in run

    testMethod()

  File "/opt/ros/indigo/share/rostest/nodes/hztest/hztest", line 117, in test_hz

    self._test_hz(hz, hzerror, topic, test_duration, wait_time)

  File "/opt/ros/indigo/share/rostest/nodes/hztest/hztest", line 190, in _test_hz

    (rate, self.max_rate))

  File "/usr/lib/python2.7/unittest/case.py", line 424, in assertTrue

    raise self.failureException(msg)

    </failure>

  </testcase>

  <system-out><![CDATA[Hz: 10.0

Hz Error: 0.5

Topic: chatter1

Test Duration: 5.0

Waiting for messages

Starting rate measurement

Done waiting, validating results

]]></system-out>

  <system-err><![CDATA[]]></system-err>

</testsuite>

unrelated error occured. Restarted.

@k-okada
Copy link
Member

k-okada commented Sep 8, 2018

is this different from (send comm-state :latest-goal-status)? And how roscpp users work with this?
https://docs.ros.org/indigo/api/actionlib/html/classactionlib_1_1SimpleActionClient.html

@furushchev
Copy link
Member Author

furushchev commented Sep 8, 2018

(send comm-state :latest-goal-status) returns only the status (type of actionlib_msgs/GoalStatus) which is related to the client selected from all the status list.
Furthermore, it returns a dummy message unless at least one goal is sent from the client.
(send client :last-status-msg) returns all status (type of actionlib_msgs/GoalStatusArray).

Since I want to check the action server is used by other clients or not, (send comm-state :latest-goal-status) does not have information about other clients.

As far as I briefly search In roscpp, SimpleActionClient has no such api, but I think we can get the same status message (actionlib_msgs/GoalStatusArray) by just subscribing status twice.
(If I understand correctly, we cannot register more than two functions for the same topic in roseus for now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants