Print Hierarchy
SUMMARY
print_hierarchy logs the tree's frames indented by depth, with each frame's parent name, to help debug how a tree is structured.
The Skill
python
tree.print_hierarchy()Example

A robot and camera frame nested under the world root, matching the logged hierarchy.
The Code
python
"""
Example of TransformTree.print_hierarchy.
"""
from loguru import logger
from telekinesis.tf import tftree
def main():
"""
Log the tree's parent/child structure.
"""
tree = tftree.TransformTree("world", verbose="DEBUG")
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")
tree.print_hierarchy()
tree.visualize_rerun(axis_len=0.5)
if __name__ == "__main__":
main()Parameter Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
node | TransformNode | None | None | The node to start from. If None, starts from the tree's root. |
level | int | 0 | Current indentation depth, used internally by the recursive calls. |
Raises
| Exception | Condition |
|---|---|
TypeError | node is provided and is not a TransformNode. |