Get All Frames
SUMMARY
get_all_frames returns every frame in the tree as a pose relative to a reference_node_name, in the requested rot_type.
UNITS
Each returned pose's position component is in meters. Rotation is in degrees ("deg"), radians ("rad"), or unitless ("quat").
The Skill
python
frames = tree.get_all_frames(reference_node_name="world", rot_type="rad")Example

A robot and camera frame, each returned as a pose relative to the world frame.
The Code
python
"""
Example of TransformTree.get_all_frames.
"""
from loguru import logger
from telekinesis.tf import tftree
def main():
"""
Get every frame's pose relative to a reference frame.
"""
tree = tftree.TransformTree("world")
tree.add("world", "robot", [1, 0, 0, 0, 0, 0], rot_type="deg")
tree.add("robot", "camera", [0, 0, 0.5, 0, 0, 0], rot_type="deg")
frames = tree.get_all_frames(reference_node_name="world", rot_type="rad")
logger.info(f"Frames relative to world: {frames}")
tree.visualize_rerun(axis_len=0.5)
if __name__ == "__main__":
main()Parameter Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
reference_node_name | str | None | The frame every returned pose is relative to. Required in practice: the type check runs before the None case, so omitting it raises TypeError rather than defaulting to the tree root. |
rot_type | str | "rad" | One of "deg", "rad", "quat", "mat". |
Returns
| Type | Description |
|---|---|
dict | Every frame's pose relative to reference_node_name, keyed by frame name. |
Raises
| Exception | Condition |
|---|---|
TypeError | reference_node_name is not a string, including when it is left as None. |
TypeError | rot_type is not one of "deg", "rad", "quat", "mat". |
ValueError | No frame named reference_node_name exists in the tree. |