how to monitorize ros2 actions from terminal?
Is there a way to "watchdog" an action and see when a request is made and also the request data?
Is there a way to "watchdog" an action and see when a response is provided by the server and also the request data?
In ROS1 that was possible just using "ros topic echo" on request, feedback and result topics.
Asked by Pablo Iñigo Blasco on 2020-11-20 14:48:48 UTC
Answers
All ros2 topics have a status topic for monitoring them. To have a look launch an action server, then list the topics with hidden topics shown:
$ ros2 run examples_rclcpp_minimal_action_server action_server_member_functions
...
$ ros2 topic list --include-hidden-topics
/fibonacci/_action/feedback
/fibonacci/_action/status
/parameter_events
/rosout
Echo the _action/status
topic while sending a goal
$ ros2 topic echo /fibonacci/_action/status
status_list:
- goal_info:
goal_id:
uuid:
- 82
- 166
- 223
- 231
- 14
- 16
- 94
- 134
- 45
- 224
- 247
- 104
- 135
- 179
- 196
- 14
stamp:
sec: 1606145080
nanosec: 966343610
status: 2
---
status_list:
- goal_info:
goal_id:
uuid:
- 82
- 166
- 223
- 231
- 14
- 16
- 94
- 134
- 45
- 224
- 247
- 104
- 135
- 179
- 196
- 14
stamp:
sec: 1606145080
nanosec: 966343610
status: 4
---
...
$ ros2 run examples_rclcpp_minimal_action_client action_client_member_functions
Notice the first message status 2 is EXECUTING, and the second is status 4 SUCCEEDED. This server chose to execute the goal right away, but other servers may accept the goal, hold on to it for a bit, then execute it later.
See the ROS 2 action design doc for more info.
Asked by sloretz on 2020-11-23 11:24:01 UTC
Comments
I think this is a partially good answer because it provides some useful information. I'll vote up. But the question is: can I get the request and the response? (that may be the most essential and useful information)
Asked by Pablo Iñigo Blasco on 2021-03-09 16:31:16 UTC
Hidden topics? Are you kidding me?
Question remains where the goal/request is @sloretz
Asked by David Lu on 2021-04-23 14:46:27 UTC
Is there a way to "watchdog" an action and see when a request is made
The status topic shows when the request and response happen.
and also the request data?
There's currently no way for something other than the action server to get the goal request. Maybe the rmw implementation you're using can get that via a monitoring tool or wireshark plugin. See http://design.ros2.org/articles/actions.html#middleware-implementation for more info that might help come up with a solution to that.
can I get the request and the response?
Multiple clients can get the action result for as long as the server caches it. The default cache time is 15 minutes: https://github.com/ros2/rcl/blob/1aa50bc14fc8a46acb7f19717c5e5d18ac7e479d/rcl_action/src/rcl_action/action_server.c#L270 .
Hidden topics? Are you kidding me?
I hear your frustration. You may also want to know there are hidden services http://design.ros2.org/articles/topic_and_service_names.html#hidden-topic-or-service-names
Asked by sloretz on 2021-04-26 12:35:20 UTC
I think accessing to the request/response data is still an essential feature that should be taken into account by the core development team.
(Assuming that this cannot be solved with the current middleware implementation) One possible new workaround-feature could be adding some "debug topics" to the ActionServer and ActionClient classes to check what was sent/received - even if these messages are not part of the interaction and increase the bandwidth usage.
Asked by Pablo Iñigo Blasco on 2021-04-27 05:14:53 UTC
In ROS 2 actions are now a combination of asynchronous service requests and have the optional status and feedback topics for monitoring progress. This is a better match for the semantics of the way actions are intended to work with a one to one ratio of request to execution. (In ROS 1 if two servers were running on the same namespace you'd have race conditions on execution especially interleaving feedback and multiple potential responses with race conditions.
Currently there is not a way to monitor the request and response outside of the server or client as the service requests are one-to-one.
However there is active work to add service introspection capabilities: https://github.com/ros-infrastructure/rep/pull/360 which should allow this sort of introspection in the future.
Asked by tfoote on 2023-03-29 10:43:09 UTC
Comments