rcl_action  master
C API providing common functionality for ROS actions.
action_server.h
1 // Copyright 2018 Open Source Robotics Foundation, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef RCL_ACTION__ACTION_SERVER_H_
16 #define RCL_ACTION__ACTION_SERVER_H_
17 
18 #ifdef __cplusplus
19 extern "C"
20 {
21 #endif
22 
23 #include "rcl_action/goal_handle.h"
24 #include "rcl_action/types.h"
25 #include "rcl_action/visibility_control.h"
26 #include "rcl/macros.h"
27 #include "rcl/node.h"
28 #include "rcl/time.h"
29 
30 #include "rosidl_runtime_c/action_type_support_struct.h"
31 
33 struct rcl_action_server_impl_t;
34 
36 typedef struct rcl_action_server_t
37 {
39  struct rcl_action_server_impl_t * impl;
41 
44 {
57 
58  rcl_allocator_t allocator;
62 
64 
68 RCL_ACTION_PUBLIC
69 RCL_WARN_UNUSED
71 rcl_action_get_zero_initialized_server(void);
72 
74 
174 RCL_ACTION_PUBLIC
175 RCL_WARN_UNUSED
176 rcl_ret_t
177 rcl_action_server_init(
178  rcl_action_server_t * action_server,
179  rcl_node_t * node,
180  rcl_clock_t * clock,
181  const rosidl_action_type_support_t * type_support,
182  const char * action_name,
183  const rcl_action_server_options_t * options);
184 
186 
212 RCL_ACTION_PUBLIC
213 RCL_WARN_UNUSED
214 rcl_ret_t
215 rcl_action_server_fini(rcl_action_server_t * action_server, rcl_node_t * node);
216 
218 
229 RCL_ACTION_PUBLIC
230 RCL_WARN_UNUSED
232 rcl_action_server_get_default_options(void);
233 
235 
276 RCL_ACTION_PUBLIC
277 RCL_WARN_UNUSED
278 rcl_ret_t
279 rcl_action_take_goal_request(
280  const rcl_action_server_t * action_server,
281  rmw_request_id_t * request_header,
282  void * ros_goal_request);
283 
285 
324 RCL_ACTION_PUBLIC
325 RCL_WARN_UNUSED
326 rcl_ret_t
327 rcl_action_send_goal_response(
328  const rcl_action_server_t * action_server,
329  rmw_request_id_t * response_header,
330  void * ros_goal_response);
331 
333 
388 RCL_ACTION_PUBLIC
389 RCL_WARN_UNUSED
391 rcl_action_accept_new_goal(
392  rcl_action_server_t * action_server,
393  const rcl_action_goal_info_t * goal_info);
394 
396 
436 RCL_ACTION_PUBLIC
437 RCL_WARN_UNUSED
438 rcl_ret_t
439 rcl_action_publish_feedback(
440  const rcl_action_server_t * action_server,
441  void * ros_feedback);
442 
444 
463 RCL_ACTION_PUBLIC
464 RCL_WARN_UNUSED
465 rcl_ret_t
466 rcl_action_get_goal_status_array(
467  const rcl_action_server_t * action_server,
468  rcl_action_goal_status_array_t * status_message);
469 
471 
493 RCL_ACTION_PUBLIC
494 RCL_WARN_UNUSED
495 rcl_ret_t
496 rcl_action_publish_status(
497  const rcl_action_server_t * action_server,
498  const void * status_message);
499 
501 
532 RCL_ACTION_PUBLIC
533 RCL_WARN_UNUSED
534 rcl_ret_t
535 rcl_action_take_result_request(
536  const rcl_action_server_t * action_server,
537  rmw_request_id_t * request_header,
538  void * ros_result_request);
539 
541 
568 RCL_ACTION_PUBLIC
569 RCL_WARN_UNUSED
570 rcl_ret_t
571 rcl_action_send_result_response(
572  const rcl_action_server_t * action_server,
573  rmw_request_id_t * response_header,
574  void * ros_result_response);
575 
577 
620 RCL_ACTION_PUBLIC
621 RCL_WARN_UNUSED
622 rcl_ret_t
623 rcl_action_expire_goals(
624  const rcl_action_server_t * action_server,
625  rcl_action_goal_info_t * expired_goals,
626  size_t expired_goals_capacity,
627  size_t * num_expired);
628 
630 
645 RCL_ACTION_PUBLIC
646 RCL_WARN_UNUSED
647 rcl_ret_t
648 rcl_action_notify_goal_done(
649  const rcl_action_server_t * action_server);
650 
652 
686 RCL_ACTION_PUBLIC
687 RCL_WARN_UNUSED
688 rcl_ret_t
689 rcl_action_take_cancel_request(
690  const rcl_action_server_t * action_server,
691  rmw_request_id_t * request_header,
692  void * ros_cancel_request);
693 
695 
729 RCL_ACTION_PUBLIC
730 RCL_WARN_UNUSED
731 rcl_ret_t
732 rcl_action_process_cancel_request(
733  const rcl_action_server_t * action_server,
734  const rcl_action_cancel_request_t * cancel_request,
735  rcl_action_cancel_response_t * cancel_response);
736 
738 
757 RCL_ACTION_PUBLIC
758 RCL_WARN_UNUSED
759 rcl_ret_t
760 rcl_action_send_cancel_response(
761  const rcl_action_server_t * action_server,
762  rmw_request_id_t * response_header,
763  void * ros_cancel_response);
764 
766 
788 RCL_ACTION_PUBLIC
789 RCL_WARN_UNUSED
790 const char *
791 rcl_action_server_get_action_name(const rcl_action_server_t * action_server);
792 
794 
816 RCL_ACTION_PUBLIC
817 RCL_WARN_UNUSED
819 rcl_action_server_get_options(const rcl_action_server_t * action_server);
820 
822 
852 RCL_ACTION_PUBLIC
853 RCL_WARN_UNUSED
854 rcl_ret_t
855 rcl_action_server_get_goal_handles(
856  const rcl_action_server_t * action_server,
857  rcl_action_goal_handle_t *** goal_handles,
858  size_t * num_goals);
859 
861 
878 RCL_ACTION_PUBLIC
879 RCL_WARN_UNUSED
880 bool
881 rcl_action_server_goal_exists(
882  const rcl_action_server_t * action_server,
883  const rcl_action_goal_info_t * goal_info);
884 
886 
904 RCL_ACTION_PUBLIC
905 RCL_WARN_UNUSED
906 bool
907 rcl_action_server_is_valid(const rcl_action_server_t * action_server);
908 
910 
928 RCL_ACTION_PUBLIC
929 RCL_WARN_UNUSED
930 bool
931 rcl_action_server_is_valid_except_context(const rcl_action_server_t * action_server);
932 
933 #ifdef __cplusplus
934 }
935 #endif
936 
937 #endif // RCL_ACTION__ACTION_SERVER_H_
rcl_node_t
rcl_action_server_t
Structure which encapsulates a ROS Action Server.
Definition: action_server.h:36
rcl_action_server_options_t::allocator
rcl_allocator_t allocator
Custom allocator for the action server, used for incidental allocations.
Definition: action_server.h:58
rcl_action_cancel_response_t
Struct with the action cancel response.
Definition: types.h:78
rcl_action_server_options_t::goal_service_qos
rmw_qos_profile_t goal_service_qos
Definition: action_server.h:47
rcl_action_goal_status_array_t
Struct with the action goal status array.
Definition: types.h:69
rcl_action_server_options_t::status_topic_qos
rmw_qos_profile_t status_topic_qos
Status topic quality of service.
Definition: action_server.h:55
rmw_request_id_t
rcl_clock_t
rcl_action_server_options_t::result_timeout
rcl_duration_t result_timeout
Goal handles that have results longer than this time are deallocated.
Definition: action_server.h:60
rcl_action_server_options_t::feedback_topic_qos
rmw_qos_profile_t feedback_topic_qos
Feedback topic quality of service.
Definition: action_server.h:53
rcl_action_server_t::impl
struct rcl_action_server_impl_t * impl
Pointer to the action server implementation.
Definition: action_server.h:39
rmw_qos_profile_t
rcl_action_server_options_t::result_service_qos
rmw_qos_profile_t result_service_qos
Result service quality of service.
Definition: action_server.h:51
rcl_action_goal_handle_t
Goal handle for an action.
Definition: goal_handle.h:33
rcl_action_server_options_t::cancel_service_qos
rmw_qos_profile_t cancel_service_qos
Cancel service quality of service.
Definition: action_server.h:49
rcl_action_server_options_t
Options available for a rcl_action_server_t.
Definition: action_server.h:43
rcl_duration_t