You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: common/autoware_agnocast_wrapper/README.md
+52-9Lines changed: 52 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,15 +16,58 @@ This package provides two approaches for integrating Agnocast. Both will coexist
16
16
17
17
Use this when you want the **entire node** to transparently switch between `rclcpp::Node` and `agnocast::Node` at runtime. The node wrapper automatically selects the correct underlying implementation based on the `ENABLE_AGNOCAST` environment variable.
| Publisher |`create_publisher<MessageT>()` (`QoS` and depth overloads) |
39
+
| Subscription |`create_subscription<MessageT>()` (`QoS` and depth overloads) |
40
+
| Polling subscriber |`create_polling_subscriber<MessageT>()` (`QoS` and depth overloads) |
41
+
| Client |`create_client<ServiceT>()` — takes `rclcpp::QoS` (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
42
+
| Service |`create_service<ServiceT>()` — `message_ptr` callback form and an rclcpp-style `shared_ptr` callback form |
43
+
| Timer |`create_wall_timer()`; free `create_timer(node, clock, period, cb, group)` and free `set_period(timer, period)` (see [Timer notes](#timer-notes)) |
44
+
| Underlying node |`get_rclcpp_node()`; `get_agnocast_node()` (agnocast-enabled build only — not declared in an agnocast-disabled build, so calling it there is a compile error); free `to_rclcpp_node(node)`|
45
+
46
+
> `OnSetParametersCallbackType` is aliased in this namespace and resolves to the correct rclcpp type
47
+
> for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
48
+
49
+
#### Build modes: agnocast-disabled vs agnocast-enabled
50
+
51
+
Which of the two `Node`**class definitions** is compiled is a **build-time** choice, selected by the
52
+
`USE_AGNOCAST_ENABLED` preprocessor macro. The API surface above is identical in both, so this choice
53
+
only affects the backend and the underlying-node accessors below.
54
+
55
+
This is a separate axis from the **runtime backend selection**: in the agnocast-enabled build, each
56
+
node *instance* additionally picks `rclcpp::Node` vs `agnocast::Node` at construction from the
57
+
`ENABLE_AGNOCAST` environment variable read at runtime (`use_agnocast()`), fixed for the node's
58
+
lifetime. The runtime value selects the backend; it does *not* change which `Node` definition was
59
+
compiled or which methods are declared — e.g. `get_agnocast_node()` is declared in every
60
+
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Backend | Always an owned `rclcpp::Node`. |`rclcpp::Node` or `agnocast::Node`, chosen at construction from the runtime `ENABLE_AGNOCAST` value and fixed for the node's lifetime. |
65
+
|`get_rclcpp_node()`| Always returns the owned node. | Declared; returns the `rclcpp::Node`, but **throws**`std::runtime_error` if the node is in Agnocast mode. |
66
+
|`get_agnocast_node()`|**Not declared** — calling it is a compile error. | Declared regardless of the runtime backend; returns the `agnocast::Node`, but **throws** if the node is not in Agnocast mode. |
0 commit comments