google-deepmind / google-deepmind/mujoco

XML Error: Schema violation: unrecognized attribute: 'passive'

Open
#2,972 2 comments 2 reactions 0 assignees View on GitHub
bug Unity
Dominant language
C++
Stars
15.2k
Forks
1.8k
Avg merge
10d 16h
Merged PRs (30d)
25

Description

### Intro

Hi!

I am a graduate student at Indiana University. I'm part of [Building A Mind Lab](https://www.buildingamind.com) where we want to use MuJoCo in digital twin experiments within our origins of intelligence research program. We think MuJoCo will help us simulate biomechanical over actuated bodies with custom brain architectures within Unity via the Unity plugin. Thus far, everything has looked great, and I wanted to take a moment and thank you for all the great work.

### My setup

MuJoCo: 3.4.0
Unity Plugin: 3.4.0
Unity: 6.0000.2.8f1
OS: macOS Sequoia 15.7.1

### What's happening? What did you expect?

On loading any XML file with the latest (matched) MuJoCo and Unity Plugin versions, the XML error `XML Error: Schema violation: unrecognized attribute: 'passive'` is raised following which the simulation fails with `NullReferenceException: Failed to create Mujoco runtime`.

Although I tested with just two XML files ([Ostrich](https://github.com/vittorione94/ostrichrl/blob/master/ostrichrl/assets/models/ostrich/ostrich.xml) and [Ant](https://github.com/openai/gym/blob/master/gym/envs/mujoco/assets/ant.xml)) I imagine this would occur with any XML file since versions 3.3.6 and above replaces the `passive` flag with `spring` and `damper` flags within `options` but `MjcfImporter.cs` still [appends](https://github.com/google-deepmind/mujoco/blob/e55fff5dea6f1d5dd7963ca52eecc41d05ad0922/unity/Runtime/Importer/MjcfImporter.cs#L141) `passive` along with the other default global flags.

Just commenting out [L124](https://github.com/google-deepmind/mujoco/blob/e55fff5dea6f1d5dd7963ca52eecc41d05ad0922/unity/Runtime/Components/MjGlobalSettings.cs#L124) in `MjGlobalSettings.cs` solves the issue for me. But just in case, I also added the correct `Spring` and `Damper` flags to `MjGlobalSettings.cs` as and where needed. Everything seems to be running fine, but please let me know if more changes need to be made. I just wanted to report my patch incase useful.

Also, there is a minor mismatch in XML documentation, [here](https://mujoco.readthedocs.io/en/3.4.0/XMLreference.html#option-flag) it says `damping` but it should be `damper` instead I think.

### Steps for reproduction

1. Install the latest versions of mujoco and the Unity Plugin as per the documentation.
2. Import any valid XML file.
3. Run the simulation, and it should error out as described.

### Minimal model for reproduction

If you encountered the issue in a complex model, please simplify it as much as possible (while still reproducing the issue).

minimal XML

```XML















































































```

### Code required for reproduction

_No response_

### Confirmations

- [x] I searched the [latest documentation](https://mujoco.readthedocs.io/en/latest/overview.html) thoroughly before posting.
- [x] I searched previous [Issues](https://github.com/google-deepmind/mujoco/issues) and [Discussions](https://github.com/google-deepmind/mujoco/discussions), I am certain this has not been raised before.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.