Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unjustifid Error Thrown "XML Error: Error: Node tags must be sequential" #2342

Open
2 tasks done
Nick20500 opened this issue Jan 9, 2025 · 3 comments
Open
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@Nick20500
Copy link

Intro

Hi!

I am a undergrad student at ETH Zurich, I use MuJoCo for my research on Multimaterial deformable objects.

My setup

I use MuJoCo 3.2.5 with python bindings.

What's happening? What did you expect?

When I try to load my "drop_1_axis-y_sim-0.xml" with mujoco.MjModel.from_xml_path(scene_path) , mujoco throws the error:
" Error: XML Error: Error: Node tags must be sequential
Element 'flexcomp', line 33".
After inspecting the mesh manually and computationally, the mesh doesn't have discontinouties as mujoco claims. All 546 Nodes of the "caorsened_bottle_neck.41.msh" file are numbered continous.

Therefore mujoco should not throw any error when loading this scene for simulation.
Here is the full error thrown:

Traceback (most recent call last):
  File "/mnt/c/Users/Nickt/OneDrive - ETH Zurich/Desktop/Private stuff/06_Schule/ETH/Bachelorarbeit/Repos/let-the-best-sim-win/src/pipeline/simulate.py", line 304, in simulate_scene_with_timestep
    mj_model = mujoco.MjModel.from_xml_path(scene_path)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: XML Error: Error: Node tags must be sequential
Element 'flexcomp', line 33


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "path/to/my/repo/src/pipeline/simulate.py", line 401, in simulate_scene
    sim_success = simulate_scene_with_timestep(scene_path, output_path,  timestep, sim_duration, fps, save_pixel_frames)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "path/to/my/repo/src/pipeline/simulate.py", line 307, in simulate_scene_with_timestep
    raise Exception(f"InitializationError: the mujoco model and data for {scene_path} couldn't be initialzed.\nError: {e}\n\n")
Exception: InitializationError: the mujoco model and data for bin/multi-mat_dataset/Bottle/1/drop/drop_1_axis-y_sim-0.xml couldn't be initialzed.
Error: XML Error: Error: Node tags must be sequential
Element 'flexcomp', line 33

Steps for reproduction

Here is all the data needed: example.zip

  1. Load the "drop_1_axis-y_sim-0.xml" scene into mujoco. Either programmatically through mj_model = mujoco.MjModel.from_xml_path(scene_path) or in the interactive viewer.
  2. See the error thrown

Minimal model for reproduction

No response

Code required for reproduction

No response

Confirmations

@Nick20500 Nick20500 added the bug Something isn't working label Jan 9, 2025
@quagla
Copy link
Contributor

quagla commented Jan 9, 2025

@mohammad200h Do you know what could be the issue?

@mohammad200h
Copy link
Collaborator

mohammad200h commented Jan 13, 2025

The issue was in the "coarsened_bottle_neck.41.msh"

$Nodes
1 546 2 831 <- max node should be equal to 546. There are 546 nodes
3 0 0 546

I used gmsh_cleaner to clean the file. Here is the cleaned file:

example_fixed.zip

Have a look at coarsened_bottle_neck.41_out_vol.msh

1 546 1 546
3 1 0 546

@yuvaltassa
Copy link
Collaborator

@mohammad200h, is there a more informative error we could be throwing here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants