I was trying to include an object into a scene, and I found the compiler cannot find the mesh correctly when I was trying to load the scene that includes the object with its absolute path, however, when I tried to load the scene with its relative path or load the object file which include the scene, it worked pretty fine. I have also tried use the absolute meshdir path it still does not work.
from os import path
import mujoco
dir_absolute = path.dirname(__file__)
relative_scene_include_model = "scene_include_model.xml"
relative_model_include_scene = "model_include_scene.xml"
absolute_scene_include_model = path.join(dir_absolute, relative_scene_include_model)
absolute_model_include_scene = path.join(dir_absolute, relative_model_include_scene)
if __name__ == "__main__":
try:
model = mujoco.MjModel.from_xml_path(absolute_scene_include_model)
except Exception as e:
print("*" * 50)
print("scene include model absolute failed")
print("*" * 50)
print(e)
try:
model = mujoco.MjModel.from_xml_path(relative_scene_include_model)
except Exception as e:
print("*" * 50)
print("scene include model relative failed")
print("*" * 50)
print(e)
try:
model = mujoco.MjModel.from_xml_path(absolute_model_include_scene)
except Exception as e:
print("*" * 50)
print("model include scene absolute failed")
print("*" * 50)
print(e)
try:
model = mujoco.MjModel.from_xml_path(relative_model_include_scene)
except Exception as e:
print("*" * 50)
print("model include scene relative failed")
print("*" * 50)
print(e)
Issues Encountered:
**************************************************
scene include model absolute failed
**************************************************
XML Error: Error: resource not found via provider or OS filesystem: '/home/kaixing/assets/insole.msh'
Element 'flexcomp', line 0
Hi,
I was trying to include an object into a scene, and I found the compiler cannot find the mesh correctly when I was trying to load the scene that includes the object with its absolute path, however, when I tried to load the scene with its relative path or load the object file which include the scene, it worked pretty fine. I have also tried use the absolute meshdir path it still does not work.
Here is the test directory structure I have
Here are the xml files I used for test
model.xml
```XMLscene.xml
```XMLmodel_include_scene.xml
```XMLscene_include_model.xml
```XMLHere is the test code
Issues Encountered:
MuJoCo Version: 3.1.6 OS: Ubuntu 22.04.4 x86_64 Using mujoco python binding