Skip to content

feat(autoware): Add PointField struct - #801

Merged
nokosaaan merged 1 commit into
tier4:mainfrom
romancardenas:autoware/point_field
Nov 18, 2026
Merged

nokosaaan merged 1 commit into
tier4:mainfrom
romancardenas:autoware/point_field

Conversation

@romancardenas

Copy link
Copy Markdown
Contributor

Description

This is part of #748

It addresses @nokosaaan 's comments in #783. The idea is trying to get an alternative implementation that avoids allocations in the heap. I will divide the contribution in several PRs, as it will ease the review process.

This PR only adds the PointField structure. Unlike in ROS2's autoware, the message fields are private, and fields are checked at construction time to avoid overflows.

The structure itself contains multiple convenience methods to access point field values on a point.

This PR also includes a TypedPointField<T> struct that provides access to typed data structures.

Both PointField and TypedPointField<T> provide iter and iter_mut methods that allow iterating over all the values of a field. The prior iterates over byte chunks, while the later iterates over typed data structures.

The PointField has convenience methods to get range indices for a given position of a value. Alternatively, the TypedPointField allows reading and writing a typed value with the try_read and try_write methods.

How was this PR tested?

  • scripts/ci.sh passes on my machine.
  • Unit tests of the new module pass on my machine

@nokosaaan
nokosaaan merged commit 1e8704e into tier4:main Nov 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants