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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
jazzy

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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_admission autoware_component_interface_specs autoware_component_interface_utils autoware_geography_utils autoware_global_parameter_loader autoware_interface_spec_lint 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_test_manager 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_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

Package Summary

Version 1.10.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-10-02
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). The member names and argument lists are identical in both builds (ENABLE_AGNOCAST=0 and =1), so a node written against it compiles unchanged either way — provided you spell the handle, options and message types with the AUTOWARE_* macros (see Type spellings). If you need an API that is not listed below, extend the wrapper, or reach the underlying node via get_rclcpp_node() (declared in both builds, but it throws when the node is in Agnocast mode — see the build-modes table).

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. Non-copyable and non-movable (copying would alias one backend behind two wrappers). Derives from std::enable_shared_from_this<Node>, so shared_from_this() is available when the node is owned by a shared_ptr
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) — see Publisher API
Subscription create_subscription<MessageT>() (QoS and depth overloads, plus a callback-less form read with take()) — see Subscription API
Generic (type-erased) publisher/subscription create_generic_publisher() / create_generic_subscription() (QoS and depth overloads) — runtime topic_type string instead of a compile-time MessageT, for a node that relays arbitrary topics; see Generic publisher/subscription
Client create_client<ServiceT>() (rclcpp::QoS); async_send_request() takes allocate_output_service_request()’s result, or a plain std::shared_ptr<S::Request> that the Agnocast backend copies
Service create_service<ServiceT>() (rclcpp::QoS) — 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)
Context free init(), shutdown() and ok() — mode-agnostic replacements for the rclcpp equivalents (see Context notes)

OnSetParametersCallbackType is aliased in this namespace and resolves to the correct rclcpp type for both Humble (rclcpp 16.x) and Jazzy (rclcpp 28+).

Polling subscribers are not a Node member. Use the free function polling::create_polling_subscriber<MessageT>(node, topic, qos) — see Polling Subscriber.

Reading another node’s parameters is not a Node member either. Use autoware::agnocast_wrapper::AsyncParametersClient, which takes a Method 2 node. Of the parameter service calls it exposes only get_parameters(), alongside wait_for_service() and service_is_ready(); the setter, descriptor and listing calls are not wrapped yet, and on_parameter_event() has no Agnocast counterpart. On the Agnocast backend the response arrives over an Agnocast subscription, so get_parameters() resolves its future only while an Agnocast executor spins the node.

create_client() and create_service() also accept an rmw_qos_profile_t. This is not part of the supported surface: it exists so that Humble-era call sites passing rmw_qos_profile_services_default keep compiling, and it will be removed. Pass an rclcpp::QoS.

Type spellings

The member names and argument lists above are the same in both builds, but the handle, options and message types they use are not the same C++ types. Always spell them with the AUTOWARE_* macros so the same source compiles in both builds:

What Spell it as ENABLE_AGNOCAST=0 ENABLE_AGNOCAST=1
create_publisher result AUTOWARE_PUBLISHER_PTR(M) rclcpp::Publisher<M>::SharedPtr agnocast_wrapper::Publisher<M>::SharedPtr
create_subscription result AUTOWARE_SUBSCRIPTION_PTR(M) rclcpp::Subscription<M>::SharedPtr agnocast_wrapper::Subscription<M>::SharedPtr
create_wall_timer result AUTOWARE_TIMER_PTR rclcpp::TimerBase::SharedPtr agnocast_wrapper::Timer::SharedPtr
create_publisher options arg AUTOWARE_PUBLISHER_OPTIONS rclcpp::PublisherOptions agnocast::PublisherOptions
create_subscription options AUTOWARE_SUBSCRIPTION_OPTIONS rclcpp::SubscriptionOptions agnocast::SubscriptionOptions
create_generic_publisher result AUTOWARE_GENERIC_PUBLISHER_PTR rclcpp::GenericPublisher::SharedPtr agnocast_wrapper::GenericPublisher::SharedPtr
create_generic_subscription result AUTOWARE_GENERIC_SUBSCRIPTION_PTR rclcpp::GenericSubscription::SharedPtr agnocast_wrapper::GenericSubscription::SharedPtr
Owning subscription callback arg AUTOWARE_MESSAGE_CONST_SHARED_PTR(M) std::shared_ptr<const M> message_ptr<const M, Shared>
async_send_request request arg AUTOWARE_CLIENT_REQUEST_PTR(S) std::shared_ptr<S::Request> message_ptr<S::Request, Shared>

A subscription callback may also take the plain MessageT::ConstSharedPtr; it needs no macro because it is spelled the same in both builds.

On the Agnocast path an owning handle must not outlive the subscription that delivered it. This covers AUTOWARE_MESSAGE_CONST_SHARED_PTR, a callback taking MessageT::ConstSharedPtr, the pointer returned by polling::take_data(), a message delivered to a message_filters synchronizer callback, and AUTOWARE_CLIENT_RESPONSE_PTR, which the client delivers through a response subscription of its own and which therefore must not outlive the client. Reading it afterwards can return recycled memory, and releasing it can abort the process. Members are destroyed in reverse declaration order, so declare the subscription before any member that caches a message:

AUTOWARE_SUBSCRIPTION_PTR(PointCloud2) sub_;   // declared first -> destroyed last
std::shared_ptr<const PointCloud2> latest_;    // destroyed first -> safe

AUTOWARE_CLIENT_PTR(SrvT) client_;             // same rule for a cached client response
std::shared_ptr<const SrvT::Response> cached_;

The DDS path lets the same pointer be held indefinitely, so a node validated only with ENABLE_AGNOCAST=0 will not show the problem.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package autoware_agnocast_wrapper

1.10.0 (2026-09-28)

  • Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base

  • feat(autoware_agnocast_wrapper): add the autoware_node launch action (#1457)

    • feat(autoware_agnocast_wrapper): add the autoware_node launch action
    • fix(autoware_agnocast_wrapper): follow use_agnocast and keep other nodes off Agnocast
    • fix(autoware_agnocast_wrapper): accept plain strings in AutowareNode
    • fix(autoware_agnocast_wrapper): name the node in the mode and heaphook errors
    • refactor(autoware_agnocast_wrapper): drop a duplicate lookup and parse check
    • docs(autoware_agnocast_wrapper): document the autoware_node_plugins resource

    * test(autoware_agnocast_wrapper): run the autoware_node test without the install space ---------

  • refactor(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper (#1451)

    • feat(autoware_agnocast_wrapper): drop the discovery agent spawn from the launch wrapper
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): note that Agnocast starts the discovery agent

    * docs(autoware_agnocast_wrapper): note how the discovery agent auto-start can fail The auto-start only warns and continues when the agent is unavailable, so name the two ways it can be absent as a starting point for the reader.

    * docs(autoware_agnocast_wrapper): drop the discovery agent troubleshooting note The paragraph described agnocastlib internals inaccurately: the commands fall back to the local ioctl view rather than coming back empty, the AGNOCAST_NO_DISCOVERY_AGENT path short-circuits before any logging, and the env var predicate accepts only 1/true/yes rather than any value. Rather than track internals that already differ between agnocastlib releases, drop the paragraph. The sentence above it already carries the point: the wrapper no longer launches the agent because Agnocast does. ---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tran Huu Nhat Huy <<29034232+TranHuuNhatHuy@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): support polling_policy::All (#1443)

    • feat(autoware_agnocast_wrapper): support polling_policy::All
    • test(autoware_agnocast_wrapper): poll for the All batch instead of sleeping
    • refactor(autoware_agnocast_wrapper): decide the depth rule at the call site
    • refactor(autoware_agnocast_wrapper): keep the polling helpers in the package detail namespace
    • refactor(autoware_agnocast_wrapper): spell the All vector like the other policies
    • refactor(autoware_agnocast_wrapper): point the depth rejection at polling_policy::All
    • docs(autoware_agnocast_wrapper): scope the cross-backend promise to the policies that keep it

    * docs(autoware_agnocast_wrapper): note what holding an All vector costs ---------Co-authored-by: atsushi yano <<55824710+atsushi421@users.noreply.github.com>>

  • feat(autoware_agnocast_wrapper): add generic pubsub wrapper (#1442)

    • feat: add generic pubsub wrapper
    • style(pre-commit): autofix
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr (#1419)
    • feat(autoware_agnocast_wrapper): add to_shared_ptr() for client responses
    • refactor(autoware_agnocast_wrapper): move to_shared_ptr() to the message_ptr layer
    • style(pre-commit): autofix
    • fix(autoware_agnocast_wrapper): reject publisher-side handles in to_shared_ptr()
    • refactor(autoware_agnocast_wrapper): return client responses as std::shared_ptr
    • style(pre-commit): autofix
    • docs(autoware_agnocast_wrapper): document the client response in the lifetime rules

    * docs(autoware_agnocast_wrapper): drop the stale client response row from the type table ---------Co-authored-by: pre-commit-ci[bot]

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