Update Node Name
SUMMARY
update_node_name renames an existing frame in the tree.
The Skill
python
tree.update_node_name("camera", "camera_updated")The Code
python
"""
Example of TransformTree.update_node_name.
"""
from loguru import logger
from telekinesis.tf import tftree
def main():
"""
Rename a frame in the tree.
"""
tree = tftree.TransformTree("world")
tree.add("world", "camera", [0, 0, 1, 0, 0, 0], rot_type="deg")
tree.update_node_name("camera", "camera_updated")
logger.info(f"Frames after rename: {list(tree.find_nodes(['world', 'camera_updated']).keys())}")
if __name__ == "__main__":
main()Parameter Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
old_name | str | required | The current name of the frame. |
new_name | str | required | The new name for the frame. |
Raises
| Exception | Condition |
|---|---|
TypeError | old_name is not a string. |
TypeError | new_name is not a string. |