The one field-selection mechanism: include and exclude globs over ROS2 field paths.
Every Binding that narrows a message uses it; it is a pure function of a message dataclass.
- A pattern is tested against a leaf and against each of its ancestors, so exclude=("pose",) removes every field under pose.
- Exclude wins. Include narrows first, exclude removes after.
- A pattern that matches nothing is fatal, as is a selection that leaves no field.
Patterns are fnmatch globs matched against the whole path, with / an ordinary character: * crosses levels, so */position/* reaches a position at any depth. A repeated message field (sequence<PoseStamped>) is a leaf: it can be selected by name, but nothing inside it can.
| Class | |
Which fields of a message type a Binding exposes. |
| Function | field |
Return every field path a message type reaches, in ROS2 declaration order. |
| Function | resolve |
Return the field paths that survive a selection, interior paths included. |
| Constant | SEPARATOR |
What joins a field path, and what a UA variable name is joined with. |
| Function | _ancestors |
Return a, a/b, a/b/c for a/b/c: the path and everything carrying it. |
| Function | _matched |
Return whether a pattern matches this path or any path it hangs below. |
| Function | _require |
Refuse a declaration carrying a pattern that matches no path of this message type. |
| Function | _require |
Refuse a rename of a path the Binding does not render. |
| Function | _walk |
Yield every path below a message type, paired with whether it is a leaf. |
Return every field path a message type reaches, in ROS2 declaration order.
Interior paths are included, so pose appears beside pose/position/x.
Return the field paths that survive a selection, interior paths included.
| Raises | |
FieldSelectionError | When a declared pattern matches no path of the type. |
FieldSelectionError | When nothing survives. |
FieldSelectionError | When rename names a path that is not rendered: unknown or removed. |
type[ Message], selection: FieldSelection, paths: Sequence[ str]):
¶
Refuse a declaration carrying a pattern that matches no path of this message type.
type[ Message], selection: FieldSelection, rendered: set[ str]):
¶
Refuse a rename of a path the Binding does not render.