Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]
Messages
Services
Plugins
Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange
Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]
Messages
Services
Plugins
Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange
Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]
Messages
Services
Plugins
Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange
Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]
Messages
Services
Plugins
Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange
Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]
Messages
Services
Plugins
Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange
Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]
Messages
Services
Plugins
Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange
Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]
Messages
Services
Plugins
Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange
Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]
Messages
Services
Plugins
Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange
Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]
Messages
Services
Plugins
Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange
Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]
Messages
Services
Plugins
Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange
Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]
Messages
Services
Plugins
Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange
Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]
Messages
Services
Plugins
Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange
Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]
Messages
Services
Plugins
Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange
Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]
Messages
Services
Plugins
Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange
Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]
Messages
Services
Plugins
Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange
Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]
Messages
Services
Plugins
Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange
Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]
Messages
Services
Plugins
Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange
Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]
Messages
Services
Plugins
Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange
Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]
Messages
Services
Plugins
Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange
Package Summary
| Version | 1.9.0 |
| License | Apache License 2.0 |
| Build type | AMENT_CMAKE |
| Use | RECOMMENDED |
Repository Summary
| Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
| VCS Type | git |
| VCS Version | main |
| Last Updated | 2026-07-13 |
| Dev Status | DEVELOPED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Package Description
Maintainers
- Takahiro Ishikawa-Aso
- Koichi Imai
- Atsushi Yano
- Yutaro Kobayashi
- Takumi Jin
- Tetsuhiro Kawaguchi
Authors
autoware_agnocast_wrapper
The purpose of this package is to integrate Agnocast, a zero-copy middleware, into each topic in Autoware with minimal side effects. Agnocast is a library designed to work alongside ROS 2, enabling true zero-copy publish/subscribe communication for all ROS 2 message types, including unsized message types.
- Agnocast Repository: https://github.com/tier4/agnocast
- Discussion on Agnocast Integration into Autoware: https://github.com/orgs/autowarefoundation/discussions/5835
- Review Guide for Agnocast Wrapper PRs
This package provides macros that wrap functions for publish/subscribe operations and smart pointer types for handling ROS 2 messages. When Autoware is built using the default build command, Agnocast is not enabled. However, setting the environment variable ENABLE_AGNOCAST=1 enables Agnocast and results in a build that includes its integration. This design ensures backward compatibility for users who are unaware of Agnocast, minimizing disruption.
Two Integration Approaches
This package provides two approaches for integrating Agnocast. Both will coexist for the foreseeable future.
1. Node Wrapper (agnocast_wrapper::Node)
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.
agnocast_wrapper::Node does not publicly derive from rclcpp::Node. It exposes a curated subset
of the rclcpp::Node surface and forwards each member to the underlying implementation (rclcpp::Node
or agnocast::Node). This subset is identical in both builds (ENABLE_AGNOCAST=0 and =1), so a
node written against it compiles unchanged either way. If you need an API that is not listed below,
reach the underlying node via get_rclcpp_node() (always available) or extend the wrapper.
Supported API surface
The following members / free functions are provided. Unless noted, signatures mirror their
rclcpp::Node counterparts.
| Category | Members |
|---|---|
| Construction |
Node(name, options), Node(name, namespace, options), virtual destructor, SharedPtr
|
| Basic info |
get_name(), get_namespace(), get_fully_qualified_name(), get_logger()
|
| Time |
get_clock(), now()
|
| Node interfaces |
get_node_base_interface(), get_node_topics_interface(), get_node_parameters_interface() (partial — only these three) |
| Callback groups | create_callback_group() |
| Parameters |
declare_parameter() (typed + ParameterValue/ParameterType overloads), has_parameter(), undeclare_parameter(), get_parameter() / get_parameters() (typed + prefix overloads), set_parameter() / set_parameters() / set_parameters_atomically(), describe_parameter(s)(), get_parameter_types(), list_parameters(), add_on_set_parameters_callback(), remove_on_set_parameters_callback()
|
| Publisher |
create_publisher<MessageT>() (QoS and depth overloads) |
| Subscription |
create_subscription<MessageT>() (QoS and depth overloads) |
| Polling subscriber |
create_polling_subscriber<MessageT>() (QoS and depth overloads) |
| Client |
create_client<ServiceT>() — takes rclcpp::QoS (the wrapper normalizes the Humble vs. Jazzy QoS-argument difference) |
| Service |
create_service<ServiceT>() — message_ptr callback form and an rclcpp-style shared_ptr callback form |
| Timer |
create_wall_timer(); free create_timer(node, clock, period, cb, group) and free set_period(timer, period) (see Timer notes) |
| 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)
|
OnSetParametersCallbackTypeis aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).
Build modes: agnocast-disabled vs agnocast-enabled
Which of the two Node class definitions is compiled is a build-time choice, selected by the
USE_AGNOCAST_ENABLED preprocessor macro. The API surface above is identical in both, so this choice
only affects the backend and the underlying-node accessors below.
This is a separate axis from the runtime backend selection: in the agnocast-enabled build, each
node instance additionally picks rclcpp::Node vs agnocast::Node at construction from the
ENABLE_AGNOCAST environment variable read at runtime (use_agnocast()), fixed for the node’s
lifetime. The runtime value selects the backend; it does not change which Node definition was
compiled or which methods are declared — e.g. get_agnocast_node() is declared in every
agnocast-enabled build and instead throws at runtime when the node is not in Agnocast mode.
| Agnocast-disabled build ( USE_AGNOCAST_ENABLED undefined) |
Agnocast-enabled build ( USE_AGNOCAST_ENABLED defined) |
|
|---|---|---|
| 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. |
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. |
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. |
to_rclcpp_node(node) |
Always succeeds. | Forwards to get_rclcpp_node() (same throw condition). |
In both builds agnocast_wrapper::Node does not derive from rclcpp::Node, so hand it to an executor or
utility via get_node_base_interface() (e.g. executor.add_node(node->get_node_base_interface())).
#include <autoware/agnocast_wrapper/node.hpp>
class MyNode : public autoware::agnocast_wrapper::Node
{
public:
explicit MyNode(const rclcpp::NodeOptions & options)
: Node("my_node", options)
{
pub_ = create_publisher<std_msgs::msg::String>("output", 10);
sub_ = create_subscription<std_msgs::msg::String>(
"input", 10,
[this](AUTOWARE_MESSAGE_CONST_SHARED_PTR(std_msgs::msg::String) && msg) { /* ... */ });
timer_ = create_wall_timer(
std::chrono::milliseconds(100), [this]() { /* ... */ });
}
private:
AUTOWARE_PUBLISHER_PTR(std_msgs::msg::String) pub_;
AUTOWARE_SUBSCRIPTION_PTR(std_msgs::msg::String) sub_;
AUTOWARE_TIMER_PTR timer_;
};
Timer notes
create_timer() is provided as a free function (not a member) because rclcpp::Node::create_timer was added in Jazzy and does not exist on Humble. The free form is portable across both:
File truncated at 100 lines see the full file
Changelog for package autoware_agnocast_wrapper
1.9.0 (2026-06-24)
-
Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base
-
refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants (#1205)
* refactor(autoware_agnocast_wrapper): split service ptr macros into server/client variants
- Apply feedback review
* Remove const from is_shared_ptr_service_callback_v ---------
-
feat(autoware_agnocast_wrapper): add overload for service (#1203)
- add create_service overload
- add assert
* fix copilot review ---------
-
feat(autoware_agnocast_wrapper): add service and client support (#1074)
- Add service and client support to agnocast wrapper
- Mark service and client support as experimental in README
- Add missing macros
- Fix colcon flag typo in README
- fix
- style(pre-commit): autofix
- fix
- style(pre-commit): autofix
- Add a comment
- Adjust create_service/create_client calls depending on rclcpp version
- fix cpplint errors
- style(pre-commit): autofix
- Fix type deduction in create_client and create_service
- Add functional header
- Fix cpplint errors
- Remove experimental tag
- Add RCLCPP version check for client and service macros
* Propagate exception in client async callbacks ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koichi Imai <<koichi.imai.2@tier4.jp>> Co-authored-by: Koichi Imai <<45482193+Koichi98@users.noreply.github.com>>
-
feat(autoware_agnocast_wrapper): support more args for synchronizer (#1104) support 8 args
-
feat(autoware_agnocast_wrapper): adopt glog to agnocast main templete (#1180) feat(autoware_agnocast_wrapper): use glog (#88)
- feat: use glog
- fix: tag name
- feat: link glog
- fix
* fix: add ament auto library ---------
-
fix(autoware_agnocast_wrapper): get_name,namespace,get_fully_qualified_name (#1178) fix get_name,namespace,get_fully_qualified_name
-
feat(autoware_agnocast_wrapper): spawn agnocast_discovery_agent from launch wrapper (#1084) Spawn exactly one agnocast_discovery_agent per ros2 launch tree from agnocast_env.launch.{py,xml} when ENABLE_AGNOCAST=1, deduplicated tree-wide via the LaunchContext globals and pinned to namespace="/".
-
feat(autoware_agnocast_wrapper): add ON_NODE macros (#1170)
-
feat(autoware_agnocast_wrapper): update [agnocast_env.launch]{.title-ref} to enable override [use_agnocast]{.title-ref} (#1123)
- update agnocast_env.launch to override use_agnocast
- style(pre-commit): autofix
* more description in README ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
File truncated at 100 lines see the full file
Package Dependencies
System Dependencies
| Name |
|---|
| libgoogle-glog-dev |
Launch files
- launch/agnocast_env.launch.xml
-
- agnocast_heaphook_path [default: /opt/ros/$(env ROS_DISTRO humble)/lib/libagnocast_heaphook.so]
- use_multithread [default: false]
- use_agnocast [default: $(env ENABLE_AGNOCAST 0)]