-
Notifications
You must be signed in to change notification settings - Fork 433
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
Disabled result caching: Result gets erased before result callback is registered #2101
Comments
@benthie thanks for creating issue. we have the same problem with ros2/ros2@1f5bd8e i think this is not expected behavior as designed. |
… registered ros2/rclcpp#2101 Signed-off-by: Tomoya Fujita <[email protected]>
@Barry-Xu-2018 can we also close this aligned with ros2/rcl#1103? |
Yes. I tried reproduced codes with the latest rolling code.
|
are you sure about this? I really do not think so... i think that client should print |
IMO this problem still stays after ros2/rcl#1103 |
Yes, my mistake. The expected status value is 4, not 0.
Yes. I will further check this. |
When the goal is completed, ServerGoalHandle::succeed() will be called. rclcpp/rclcpp_action/include/rclcpp_action/server_goal_handle.hpp Lines 207 to 215 in 45adf65
Then call rclcpp/rclcpp_action/include/rclcpp_action/server.hpp Lines 477 to 493 in 45adf65
notify_goal_terminal_state() Currently, after receiving goal acceptance message, action client sending the request for the goal result. Considering the time needed for message processing and transmission (especially for Python, which has a longer processing time), when the timeout is set to 0 in action server, it is very likely that the action client will not receive the result.
The current implementation follows the design description. The design does not specify that setting the timeout to 0 guarantees that the action client will receive a result at least once. If the goal is accepted, but the goal result cannot be obtained (like this issue), the user needs to consider whether the timeout value set for the action server is reasonable. So I tend to think this is not a bug. |
so there is no pending result when the goal succeeds. that means that result request comes back with
i do not think so. you are right that rclcpp/rclcpp_action/include/rclcpp_action/client.hpp Lines 469 to 471 in 2739327
that sends the result request on the goal response callback, technically this is the same situation with the i believe that currently user needs to set up the timeout to make sure there is enough time to request the results. if we want to support this issue, i think we need to sends the result request flag with goal request at the same time. i think current design and behavior works for user application, any thoughts? |
Bug report
Required Info:
Steps to reproduce issue
I used the Fibonacci ActionServer (C++) and ActionClient (Python) and extended them as follows to reproduce the bug.
In the server I passed in options that disable the result caching and reduced the
execute()
function to return quicker.In the client I added some more logging to both
goal_response_callback
andget_result_callback
.Expected behavior
According to the ROS2 ActionServer design article I'd expect the server to discard the results "after responding to any pending result requests".
The client should log "result_callback: status 4", which is
STATUS_SUCCEEDED
.Actual behavior
The server discards the result as soon as it detects it as expired (see server.cpp L500). In some cases the discarding happens before the client has registered the result callback and thus the result is lost and at the time the
result_callback
is executed the client logs "result_callback: status 0", which isSTATUS_UNKNOWN
.Additional information
I also put the
rclcpp_action
code in my overlay and added and changed some debug messages to log_level WARN so that I could see when the result gets discarded and whenSTATUS_UNKNOWN
is returned by the server. Here is the log in which one can see the failure.I think this problem only applies to the Python API, because in C++ the result callback is part of the
SendGoalOptions
? I understand that the server cannot predict that some PythonActionClient
is going to request the result soon. And I am not sure whether this an actual bug or rather a design decision and known issue the client has to deal with. As far as I understand, the Python API does not offer theActionClient
a way to register interest in the result at any earlier point in time. If there should be a way to do so, I am happy to try it out.We only saw the issue in our Python based tests were the server was executing a rather short execution callback.
The text was updated successfully, but these errors were encountered: