nros C API
Lightweight ROS 2 client for embedded real-time systems
Loading...
Searching...
No Matches
action.h
Go to the documentation of this file.
1
10#ifndef NROS_ACTION_H
11#define NROS_ACTION_H
12
13/* Type and function definitions live in <rclc/detail/nros_generated.h>.
14 * This per-module header is kept as a thin shim so existing code that
15 * does `#include <rclc/action.h>` continues to compile. */
16#include "rclc/types.h"
17
51 const struct rcl_node_t* node,
52 const struct rclc_action_type_t* type_info,
53 const char* action_name) {
54 return rcl_action_client_init(action_client, node, type_info, action_name, NULL);
55}
56
57/*
58 * NOT provided: `rclc_action_server_init_default`. phase-417 W5.d looked and
59 * refused, and the reason is a PARAMETER rather than an order:
60 *
61 * rclc: rcl_ret_t rclc_action_server_init_default(
62 * rclc_action_server_t *action_server, rcl_node_t *node,
63 * rclc_support_t *support,
64 * const rosidl_action_type_support_t *type_support,
65 * const char *action_name)
66 *
67 * rclc's body (`rclc/src/rclc/action_server.c` @ `10eadcc`) reads `support`
68 * for exactly one thing — it passes `&support->clock` to `rcl_action_server_init`.
69 * Ours has nothing to pass it to: `rclc_action_server_init_with_callbacks` "stores metadata
70 * (name, type, callbacks)" and defers RMW entity creation to
71 * `rclc_executor_attach_action_server()`, so it takes neither a clock nor a
72 * support handle. A faithful-looking five-argument forwarder would therefore
73 * carry an argument it IGNORES — the inert-parameter defect RFC-0089 exists to
74 * end, and the same refusal `rclc_node_resolve_name` makes for rcl's
75 * `allocator` and `is_service`.
76 *
77 * The second half is the callbacks. rclc registers goal and cancel handlers at
78 * `rclc_executor_add_action_server`; ours are bound at init
79 * (`rclc_action_server_init_with_callbacks(server, node, action_name, type_info, goal_cb,
80 * cancel_cb, accepted_cb, ...)`). Forwarding to the callback-free
81 * `rclc_polling_action_server_init` instead would not even compile since
82 * phase-487 W4 (it takes a `rclc_polling_action_server_t`), and before that it
83 * compiled and then dispatched
84 * nothing, which is the "plausible name over an opposite data contract" class.
85 *
86 * Closing this needs the `rclc_executor_add_action_server` binding site, not a
87 * wrapper. Ledger row `c:action_server_init_default` records it, still declined.
88 */
89
90#endif /* NROS_ACTION_H */
static rcl_ret_t rclc_action_client_init_default(struct rcl_action_client_t *action_client, const struct rcl_node_t *node, const struct rclc_action_type_t *type_info, const char *action_name)
rclc's default preset constructor for an action client.
Definition action.h:50
rcl_ret_t rcl_action_client_init(struct rcl_action_client_t *client, const struct rcl_node_t *node, const struct rclc_action_type_t *type_info, const char *action_name, const struct rcl_action_client_options_t *options)
int rcl_ret_t
Definition nros_generated.h:903
Definition nros_generated.h:1131
Definition nros_generated.h:1454
Definition nros_generated.h:1560
Shared types and constants for the nros C API.