Open CraigBuilds opened 1 year ago
Just FYI, ros2 run examples_rclpy_minimal_action_server server
is not appropriate example to defer the goal execution, instead we could use ros2 run examples_rclpy_minimal_action_server server_defer
which implements handle_accepted_callback
.
even with server_defer
, we can observe the reported behavior with rolling branch.
### start server_defer
root@tomoyafujita:~/docker_ws/ros2_colcon# ros2 run examples_rclpy_minimal_action_server server_defer
[INFO] [1709017447.924342939] [minimal_action_server]: Received goal request
[INFO] [1709017447.925014705] [minimal_action_server]: Deferring execution...
[INFO] [1709017450.933514222] [minimal_action_server]: Executing goal...
[INFO] [1709017450.934203963] [minimal_action_server]: Returning result: array('i', [0, 1])
### send goal request
root@tomoyafujita:~/docker_ws/ros2_colcon# ros2 action send_goal /fibonacci example_interfaces/action/Fibonacci '{}'
...
### echo status topic
root@tomoyafujita:~/docker_ws/ros2_colcon# ros2 topic echo /fibonacci/_action/status --flow-style
status_list: [{goal_info: {goal_id: {uuid: [155, 120, 121, 141, 98, 179, 68, 250, 135, 43, 228, 201, 50, 85, 251, 181]}, stamp: {sec: 1709017557, nanosec: 860342776}}, status: 2}]
---
status_list: [{goal_info: {goal_id: {uuid: [155, 120, 121, 141, 98, 179, 68, 250, 135, 43, 228, 201, 50, 85, 251, 181]}, stamp: {sec: 1709017557, nanosec: 860342776}}, status: 4}]
---
i think that action client does not call publish_status()
before execution.
Bug report
Steps to reproduce issue
Expected behavior
topic_echo
should show status 1 (ACCEPTED) and then status 2 (EXECUTING)Actual behavior
It jumps straight to EXECUTING
Additional information
This isn't just a problem with topic echo or the example node, I also have the same problem with my HMI (which uses the ActionClient) and my custom ros2 node.
A workaround is (for humble):
Or (for foxy)
And then give this callback to the ActionServer