Which frame belongs to which object, which folder it lands in, and what its Base points at.
The partition rules as pure functions of a frame tree (child frame to parent frame) and a set of declared head frames. There is no server, no asyncua node and no ROS2 here, so the rules can be tested without any of them.
Every other frame belongs to the nearest ancestor-or-self that is a declared head. A frame that is
the TF parent of another object's head is an attach point; every other frame is an internal frame. A
Location's Base is the node holding its TF parent, and a frame removed from the middle of a
chain re-bases its children onto the nearest surviving ancestor. For the outward direction,
rotation inverts angles, one_direction_per_frame checks the inward/outward
rule across a Machine, and tree_roots finds the roots of the rendered tree.
| Class | |
One frame that two declarations on a Machine both claim, and how each claims it. |
| Function | angles |
Return a ROS2 quaternion as the A, B and C angles RSL wants, in degrees. |
| Function | attach |
Return the frames that are attach points because another object's head hangs off them. |
| Function | base |
Return the frame whose node one Location's Base points at, or None for the world. |
| Function | base |
Return the node one Location's Base points at, resolved through the frame-to-node index. |
| Function | excluded |
Return whether one frame is removed by a declaration's exclusions. |
| Function | folder |
Return which folder of its object's SpatialObject one frame lands in. |
| Function | nearest |
Return the closest frame at or above frame that is admitted, or None. |
| Function | one |
Return the first frame two declarations on one Machine both claim, or None. |
| Function | owner |
Return the head frame of the object one frame belongs to, or None if no object does. |
| Function | owners |
Return every frame that some declared object owns, mapped to that object's head frame. |
| Function | parents |
Return the frame tree as the partition reads it: each child frame mapped to its parent. |
| Function | rotation |
Return the A, B and C angles RSL holds as the quaternion ROS2 wants. |
| Function | tree |
Return every frame that is somebody's parent and nobody's child, in sorted order. |
| Constant | ALTERNATIVE |
The folder for a pose composed against some base other than the frame's own TF parent. |
| Constant | ATTACH |
The folder for a position another object can be attached at. Inferred, never declared. |
| Constant | INTERNAL |
The folder for every other frame of an object. |
| Constant | _DEGREES |
Radians to degrees. The RSL Orientation is in degrees. |
| Type Variable | _ |
Whatever a node is to the caller. This module never looks at one. |
Return a ROS2 quaternion as the A, B and C angles RSL wants, in degrees.
The convention is the nodeset's: fixed-axis roll-pitch-yaw (ISO 9787:2013), the same as tf2's getRPY. The unit is degrees because opensmi's Orientation carries °. A pitch at either pole is clamped, because floating-point drift can push the asin argument slightly past one.
| Parameters | |
rotation:tuple[ | The quaternion as ROS2 orders it: x, y, z, w. |
| Returns | |
tuple[ | Undocumented |
Return the frames that are attach points because another object's head hangs off them.
A head whose parent is itself a head attaches to that object's PositionFrame, so nothing is filed for it.
str, *, parents: Mapping[ str, str], kept: Collection[ str]) -> str | None:
¶
Return the frame whose node one Location's Base points at, or None for the world.
The search starts strictly above frame. None means the walk left the tree without meeting a frame that has a node, which is the root of the TF tree, i.e. the list's World Frame. A frame excluded from the middle of a chain is not in kept, so its children walk past it.
str, *, parents: Mapping[ str, str], index: Mapping[ str, _Node], world: _Node) -> _Node:
¶
Return the node one Location's Base points at, resolved through the frame-to-node index.
Walks up until a frame has a node and answers that node, or the World Frame when the walk leaves the index. Generic in what a node is: the caller's index holds NodeIds.
| Parameters | |
frame:str | The frame whose Base is wanted. |
parents:Mapping[ | Child frame to parent frame. |
index:Mapping[ | Every frame that has a node, and the node it has. |
world:_Node | What to answer when the walk leaves the index. |
| Returns | |
_Node | Undocumented |
Return whether one frame is removed by a declaration's exclusions.
The patterns are fnmatch globs over the whole frame id (see
opensmi.ros2.runtime.selection): *_wheel_link removes four frames on a
differential-drive base, and a bare frame id removes one.
Return which folder of its object's SpatialObject one frame lands in.
None for the object's own head frame, which is the PositionFrame and in no folder.
str, *, parents: Mapping[ str, str], admitted: Collection[ str], include_self: bool = True) -> str | None:
¶
Return the closest frame at or above frame that is admitted, or None.
Both the partition and the re-basing walk up until something qualifies. A cycle (which tf2 forbids and a misbehaving publisher can still produce) ends the walk and answers None, so a poll never hangs.
| Parameters | |
frame:str | Where to start. |
parents:Mapping[ | Child frame to parent frame. |
admitted:Collection[ | The frames that qualify. |
includebool | Whether frame itself may be the answer. |
| Returns | |
str | None | Undocumented |
Mapping[ str, str], published: Mapping[ str, Collection[ str]]) -> FrameClash | None:
¶
Return the first frame two declarations on one Machine both claim, or None.
This is the cross-object half of the rule that a frame is inward or outward and never both. One
declaration contradicting itself is caught by ~opensmi.ros2.server.bindings.TFBinding.
Two cases are caught here: a frame one object publishes and another declares as its head (the
two would fight over one Location's pose), and a frame two objects publish (tf2 would keep
whichever transform arrived last). The result is deterministic: the caller's order over the
objects, then alphabetical over the frames.
| Parameters | |
heads:Mapping[ | Binding name to the head frame that Binding declares. |
published:Mapping[ | Binding name to the frames that Binding publishes outward. |
| Returns | |
FrameClash | None | Undocumented |
Return the head frame of the object one frame belongs to, or None if no object does.
A head frame owns itself, which makes it the object's PositionFrame. Frames above every declared head (a map, say) belong to no object and are rendered by nobody.
Return every frame that some declared object owns, mapped to that object's head frame.
TF has one parent per frame, so no frame can be under two heads.
Return the frame tree as the partition reads it: each child frame mapped to its parent.
This is the one place the module reads a ~opensmi.ros2.runtime.tf.FrameLink. Everything
else takes a plain mapping of names, which tests can write by hand.
Return the A, B and C angles RSL holds as the quaternion ROS2 wants.
The exact inverse of angles, used when a pose a client writes goes out on /tf. Three
angles always name one rotation, so no clamping is needed.
| Parameters | |
degrees:tuple[ | A, B and C in degrees: roll about X, pitch about Y, yaw about Z. |
| Returns | |
tuple[ | The quaternion as ROS2 orders it: x, y, z, w. |
Return every frame that is somebody's parent and nobody's child, in sorted order.
Like ~opensmi.ros2.runtime.tf.roots_of but over the rendered tree, not the facet's raw
record: what a Machine broadcasts comes back through its own subscription, so the raw record
would report its own outward declarations as a second coordinate system. A well-formed tree has
one root, which OPC 10000-210 calls the World Frame.
The folder for a pose composed against some base other than the frame's own TF parent.
| Value |
|
The folder for a position another object can be attached at. Inferred, never declared.
| Value |
|
The folder for every other frame of an object.
Where nearly every TF frame lands. 6.1.1 says an internal frame may not be used as an attach point,
so filing a wheel link under ATTACH_POINTS would assert something false.
| Value |
|