Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Exported XML loses meshdir and relative mesh paths

Đang mở
#523 1 bình luận 2 reaction 0 người được giao Xem trên GitHub

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
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu với lời gọi scene_model.to_xml_string() được mô tả trong issue và so sánh hành vi của nó với đường dẫn mjcf.export_with_assets(...) liên quan từ issue #454. Kiểm tra xem quá trình export có thể giữ lại meshdir và các đường dẫn mesh tương đối hay không, đồng thời điều tra riêng xem dm_control.viewer có chấp nhận scene đã được ghép hay không. Công việc được xem là hoàn tất khi có câu trả lời được ghi lại hoặc kiểm thử cho cả hai câu hỏi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I'm using PyMJCF to load a robot model from an XML file and build a MuJoCo scene. When I export the composed scene back to an XML string using scene_model.to_xml_string(), I've run into an issue with the file paths.

The Problem

The exported XML file is missing the directive. Meanwhile, all the mesh file paths, which were originally relative to that directory, are now missing their path prefixes.

For example, a mesh defined like file="my_robot/meshes/part1.stl" becomes file="part1.stl" in the exported file.

Code Snippet

Here is the line of code I'm using for the export:

final_xml_string = scene_model.to_xml_string()
What I've Found

I found a related issue (#454) that suggests using mjcf.export_with_assets(...) as a potential solution for managing assets.

My Questions
  1. Is there a direct method in PyMJCF to preserve the meshdir compiler attribute and the corresponding relative file paths when exporting a model to an XML string?

  2. Separately, my main goal is to visualize the composed scene. I know dm_control.viewer can be used for simulations. Does the viewer also support loading and visualizing a custom MJCF scene like the one I'm building?

Thanks for your help!

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

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của google-deepmind/dm_control

Tất cả issue của google-deepmind/dm_control

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.