PyMJCF nested include tags relative to base model
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện sự khác biệt giữa mjcf.Physics.from_xml_path và mjcf.Physics.from_mjcf_model bằng ba scene trong scenes.zip. Theo dõi cách PyMJCF xử lý đường dẫn include và asset; hoàn tất khi các include lồng nhau và asset bên ngoài được phân giải tương đối với thư mục model cấp cao nhất, khớp với MuJoCo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
PyMJCF does not support nested include tags the same way as the MuJoCo compiler. No matter how deep the include tag is, MuJoCo expects all included models and their assets to be given as paths to the corresponding file relative to the input file parent directory. However, the current implementation of PyMJCF checks paths relative to the current file's parent directory, which MuJoCo does not support.
In the attached scenes.zip file are 3 scenes.
- my_scene1/scene.xml includes a file in an inner directory that includes another file in yet another inner directory. The internal include tag uses a path relative to the top-level model directory (my_scene1/). This is supported by MuJoCo but PyMJCF fails to parse the scene:
>>> mjcf.Physics.from_xml_path('my_scene1/scene.xml') # parse using mujoco directly
<dm_control.mjcf.physics.Physics object at 0x7fd0d191b0d0>
>>> mjcf.Physics.from_mjcf_model(mjcf.from_path('my_scene1/scene.xml')) # parse with PyMJCF then convert to physics
FileNotFoundError: [Errno 2] No such file or directory: 'my_scene1/inner/inner/inner-inner/include.xml'
- my_scene2/scene.xml is the same as my_scene1/scene.xml but the inner include path is given relative to the current model directory (my_scene2/inner/). PyMJCF supports this but it does not compile natively using MuJoCo.
>>> mjcf.Physics.from_xml_path('my_scene2/scene.xml') # parse using mujoco directly
ValueError: XML Error: Could not open file 'my_scene2/inner-inner/include.xml'
Element 'include', line 0
>>> mjcf.Physics.from_mjcf_model(mjcf.from_path('my_scene2/scene.xml')) # parse with PyMJCF then convert to physics
<dm_control.mjcf.physics.Physics object at 0x7fc61f1a6700>
- my_scene3/scene.xml specifies mesh and texture files in an included file to show that MuJoCo expects these files to be specified relative to the top-level model directory as well.
>>> mjcf.Physics.from_xml_path('my_scene3/scene.xml') # parse using mujoco directly
<dm_control.mjcf.physics.Physics object at 0x7fc61f1a6f10>
>>> mjcf.Physics.from_mjcf_model(mjcf.from_path('my_scene2/scene.xml')) # parse with PyMJCF then convert to physics
FileNotFoundError: Line 4: error while parsing element <mesh>: during initialization of attribute 'file' of element <mesh>: [Errno 2] No such file or directory: 'my_scene3/inner/meshes/banana.stl'
In conclusion, models with nested include tags or external assets in included files are parsed differently with MuJoCo than with PyMJCF.
- Ngôn ngữ chính
- Python
- Star
- 4.7k
- Fork
- 765
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của google-deepmind/dm_control
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
google-deepmind/dm_control#552 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
google-deepmind/dm_control#540 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
google-deepmind/dm_control#537 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
google-deepmind/dm_control#529 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
google-deepmind/dm_control#527 · 1 bình luận ·
Tất cả issue của google-deepmind/dm_control
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
anthropics/skills#1811 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
speaches-ai/speaches#678 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
datalayer/mcp-compose#42 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
conda-forge/spacy-feedstock#177 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
UKGovernmentBEIS/inspect_evals#2523 ·