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

Allow ActionClient to get_status() of Goal from Server side #1127

Open
dcconner opened this issue May 17, 2023 · 3 comments
Open

Allow ActionClient to get_status() of Goal from Server side #1127

dcconner opened this issue May 17, 2023 · 3 comments

Comments

@dcconner
Copy link

Feature request

Seeing #1072, comments on https://answers.ros.org/question/406766/ros2-actions-publish-status-messages-that-get-exponentially-more-expensive/, and issue on FlexBE/flexbe_behavior_engine#3

I'd like the ActionClient to be able to report the GoalStatus from the server side.

In ROS 1, we were able to monitor the goal status separately from the "feedback" topic.

Is there a reason this was dropped for ROS 2?

Should the server publish the status topic as a regular topic?

I'm happy to develop a proposal and PR, but I'd like to understand the larger history and any known issues.

@dcconner
Copy link
Author

@clalancette Wondering if you can give some feedback on this issues? I've gotten another ping on FlexBE/flexbe_behavior_engine#3 , but have not seen any updates to #1072 or action server.

I see there is a status_pub_qos_profile, but it does not appear to be used in server code.

@fujitatomoya
Copy link
Collaborator

I'd like the ActionClient to be able to report the GoalStatus from the server side.

@property
def status(self):
return self._status

this does not work???

I see there is a status_pub_qos_profile, but it does not appear to be used in server code.

rcl_action_server_init takes it and used?

&action_server_ops);

@dcconner
Copy link
Author

dcconner commented May 2, 2024

@fujitatomoya the status propery belongs to the GoalHandle. I've been using an async call that returns a future

`
future = client.send_goal_async(new_goal,
feedback_callback=lambda f: ProxyActionClient._feedback_callback(topic, f)
)
ProxyActionClient._result_status[topic] = GoalStatus.STATUS_ACCEPTED
future.add_done_callback(partial(ProxyActionClient._done_callback, topic=topic))

@classmethod
def _done_callback(cls, future, topic):
    ProxyActionClient._current_goal[topic] = future
    result = future.result().get_result_async()
    result.add_done_callback(partial(ProxyActionClient._result_callback, topic=topic))

@classmethod
def _result_callback(cls, future, topic):
    result = future.result().result
    result_status = future.result().status

`
Which lets me get the final status properly.

Can I query "STATUS_ACCEPTED", "EXECUTING", and "CANCELING" while waiting on the future using the Python client?

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

No branches or pull requests

2 participants