Skip to content

Commit

Permalink
Add mimic tag
Browse files Browse the repository at this point in the history
  • Loading branch information
apockill committed Dec 8, 2024
1 parent 7bfdd1e commit d8d4af5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkgs/node_helpers/node_helpers/urdfs/loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
_CHILD_TAG = "child"
_NAME_KEY = "name"
_LINK_KEY = "link"
_MIMIC_TAG = "mimic"


def load_urdf(package: str, relative_urdf_path: Path | str) -> str:
Expand Down Expand Up @@ -134,5 +135,9 @@ def prepend_namespace(urdf_str: str, namespace: str) -> str:
"link",
NAMESPACE_FMT.format(namespace=namespace, name=node.get(_LINK_KEY)),
)

elif node.tag == _MIMIC_TAG:
node.set(
"joint",
NAMESPACE_FMT.format(namespace=namespace, name=node.get(_NAME_KEY)),
)
return ElementTree.tostring(urdf, encoding="unicode")

0 comments on commit d8d4af5

Please sign in to comment.