Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange

Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
jazzy

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange

No version for distro kilted showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange

No version for distro lyrical showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange

No version for distro rolling showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange

No version for distro ardent showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange

No version for distro bouncy showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange

No version for distro crystal showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange

No version for distro eloquent showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange

No version for distro dashing showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange

No version for distro galactic showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange

No version for distro foxy showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange

No version for distro iron showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange

No version for distro lunar showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange

No version for distro jade showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange

No version for distro indigo showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange

No version for distro hydro showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange

No version for distro kinetic showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange

No version for distro melodic showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange

No version for distro noetic showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_agnocast_wrapper package from autoware_core repo

autoware_adapi_adaptors autoware_adapi_specs autoware_core_api autoware_default_adapi autoware_core autoware_agnocast_wrapper autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_marker_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qos_utils autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_command_gate autoware_core_control autoware_simple_pure_pursuit autoware_awsim_sensor_kit_description autoware_sample_sensor_kit_description autoware_sample_vehicle_description autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

Wrapper macros for Agnocast (true zero-copy communication library)

Maintainers

  • Takahiro Ishikawa-Aso
  • Koichi Imai
  • Atsushi Yano
  • Yutaro Kobayashi
  • Takumi Jin
  • Tetsuhiro Kawaguchi

Authors

No additional 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.

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)

OnSetParametersCallbackType is 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

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

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

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_agnocast_wrapper at Robotics Stack Exchange