Skip to content

Commit

Permalink
add RCL_RET_TIMEOUT to action service response. (ros2#1138) (ros2#1153)
Browse files Browse the repository at this point in the history
* add RCL_RET_TIMEOUT to action service response.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

* address review comment.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

---------

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
(cherry picked from commit 58dae83)

Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
  • Loading branch information
mergify[bot] and fujitatomoya authored May 3, 2024
1 parent 6d0fd90 commit 81bf82d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions rcl_action/include/rcl_action/action_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ rcl_action_take_goal_request(
* \return `RCL_RET_OK` if the response was sent successfully, or
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
* \return `RCL_RET_ACTION_SERVER_INVALID` if the action server is invalid, or
* \return `RCL_RET_TIMEOUT` if a goal response reader is not ready yet, or
* \return `RCL_RET_ERROR` if an unspecified error occurs.
*/
RCL_ACTION_PUBLIC
Expand Down Expand Up @@ -564,6 +565,7 @@ rcl_action_take_result_request(
* \return `RCL_RET_OK` if the response was sent successfully, or
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
* \return `RCL_RET_ACTION_SERVER_INVALID` if the action server is invalid, or
* \return `RCL_RET_TIMEOUT` if a result response reader is not ready yet, or
* \return `RCL_RET_ERROR` if an unspecified error occurs.
*/
RCL_ACTION_PUBLIC
Expand Down Expand Up @@ -753,6 +755,7 @@ rcl_action_process_cancel_request(
* \return `RCL_RET_OK` if the request was taken, or
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
* \return `RCL_RET_ACTION_SERVER_INVALID` if the action server is invalid, or
* \return `RCL_RET_TIMEOUT` if a cancel response reader is not ready yet, or
* \return `RCL_RET_ERROR` if an unspecified error occurs.
*/
RCL_ACTION_PUBLIC
Expand Down
6 changes: 5 additions & 1 deletion rcl_action/src/rcl_action/action_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,11 @@ rcl_action_server_get_default_options(void)
rcl_ret_t ret = rcl_send_response( \
&action_server->impl->Type ## _service, response_header, response); \
if (RCL_RET_OK != ret) { \
return RCL_RET_ERROR; /* error already set */ \
if (RCL_RET_TIMEOUT == ret) { \
return RCL_RET_TIMEOUT; /* error already set */ \
} else { \
return RCL_RET_ERROR; /* error already set */ \
} \
} \
return RCL_RET_OK; \

Expand Down

0 comments on commit 81bf82d

Please sign in to comment.