Skip to content

Inconsistent behavior with VFS and mjSpec #2484

Open
@vikashplus

Description

@vikashplus

Intro

Hi!

One of the early MuJoCo developer

My setup

Mac, python, mujoco==3.2.4

What's happening? What did you expect?

When using a virtual file system with mjSpec, there are inconsistencies in the behavior (especially when names with Caps are involved)

Case: when the asset/mesh/file is only the filename

name on disc name in XML loads w/ mjSpec? loads natively?
cube.stl Cube.stl True True
cube.stl cube.stl True True
Cube.stl Cube.stl True True
Cube.stl cube.stl False True

Case: when the asset/mesh/file is more complex

name on disc name in XML loads w/ mjSpec? loads natively?
cube.stl path/Cube.stl True True
cube.stl path/cube.stl True True
Cube.stl path/Cube.stl False True
Cube.stl path/cube.stl False True

In summary,

  1. capitalization is not respected natively. Everything works
  2. capitalization is partially respected in mjSpec
  3. capitalization behavior depends on how the name is specified

Steps for reproduction

  1. Unzip the folder
  2. Run python test.py
  3. Change filenames on disc and on XML as specified above.

NOTE:

  1. When trying out cases with VFS, ensure that the fallback of loading assets from the disc doesn't work otherwise the bug won't highlight.
  2. This is extremely important as this bug is about discrepancies between VFS and load from the disc.

Recommendation:
The docs around how caps, relative paths, partial paths, etc are handled in VFS are non-existent. Consider updating the docs.

Minimal model for reproduction

See attached

vfs_caps_bug.zip

Code required for reproduction

python test.py

Confirmations

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions