Skip to content

Commit 55c81c3

Browse files
authored
Merge pull request #58 from mr-mikmik/master
adding option to provide assets when creating pk chain from mjcf
2 parents fed8889 + 4fba4ac commit 55c81c3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/pytorch_kinematics/mjcf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Union
1+
from typing import Union, Optional, Dict
22

33
import mujoco
44
from mujoco._structs import _MjModelBodyViews as MjModelBodyViews
@@ -57,7 +57,7 @@ def _build_chain_recurse(m, parent_frame, parent_body):
5757
parent_frame.children = parent_frame.children + [site_frame, ]
5858

5959

60-
def build_chain_from_mjcf(data, body: Union[None, str, int] = None):
60+
def build_chain_from_mjcf(data, body: Union[None, str, int] = None, assets:Optional[Dict[str,bytes]]=None):
6161
"""
6262
Build a Chain object from MJCF data.
6363
@@ -73,7 +73,7 @@ def build_chain_from_mjcf(data, body: Union[None, str, int] = None):
7373
chain.Chain
7474
Chain object created from MJCF.
7575
"""
76-
m = mujoco.MjModel.from_xml_string(data)
76+
m = mujoco.MjModel.from_xml_string(data, assets=assets)
7777
if body is None:
7878
root_body = m.body(0)
7979
else:

0 commit comments

Comments
 (0)