Skip to content

Track upstream rcl_buffer::Buffer<T> adoption and phase out custom shadowing types #1187

@sykwer

Description

@sykwer

Background

An upstream proposal is in progress to modify rosidl_generator_cpp so that uint8[] fields in message definitions are generated as rcl_buffer::Buffer<uint8_t> instead of std::vector<uint8_t>. Concretely, this means types like sensor_msgs::msg::Image or sensor_msgs::msg::PointCloud2::data would carry a rcl_buffer::Buffer<uint8_t> in the upstream ROS 2 type system.

Buffer<T> is designed with a polymorphic backend, allowing it to hold pointers to data residing on either CPU or GPU memory under a single unified type.

Impact on Agnocast

This change is a strong tailwind for Agnocast's GPU memory support:

  • Custom shadowing types become unnecessary.
    Currently, handling GPU-backed PointCloud2 or Image data requires maintaining custom wrapper classes that shadow the upstream message types (e.g., duplicating the data field with a GPU-aware allocator). Once rcl_buffer::Buffer<T> lands upstream, the vanilla message types can be used as-is.

  • GPU memory lifetime management remains Agnocast's responsibility.
    This upstream change is not the same as Agnocast's GPU memory support. The lifetime of GPU memory across processes — tracked via ipc_shared_ptr — is still uniquely Agnocast's concern and remains a core differentiator of our zero-copy IPC design.

Action Items

  • Monitor the upstream rosidl_generator_cpp proposal and track its progress toward merge
  • Track Fast DDS backend support, as the current prototype targets rmw_zenoh_cpp only
  • Maintain existing custom shadowing types during the transition period until the upstream change stabilizes and is released
  • Plan migration: replace shadowing types with native upstream message types once rcl_buffer::Buffer<T> is available
  • Evaluate whether ipc_shared_ptr lifetime semantics need any adjustment when wrapping Buffer<T>-backed messages

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions