Use stat() instead of d_type to check if a file is a regular file
when scanning for plugin libraries. This allows symlinked plugins
to be loaded, which is common in ROS 2 workspaces built with
colcon build --symlink-install.
The stat() approach also handles filesystems that report DT_UNKNOWN
for d_type (e.g., NFS, XFS), making the code more robust.
Fixes#3072
All known implementations were effectively the same as the default fallback. It was just adding unneeded complexity. Removing this now will help with upcoming improvements to resource providers.
PiperOrigin-RevId: 855163273
Change-Id: I529fc18d0d03a8dc676c909ec9e4b1da1454d414
- plugin system similar to mjpResourceProvider, but instead of loading a resource it converts an existing mjResource into an mjSpec.
- The returned spec is then composed into the referencing spec.
- This enables different file types to generate arbitrary specs, and allows us to separate format parsing from compilation code.
Follow up CLs will move some of the logic in src/engine for PNG, USD, KTX, OBJ loading into decoders.
The mj_parse function MjSpec from a given file, it's a more generic version of mj_parseXML.
In it's implementation, mj_parse as opposed to mj_parseXML will look for any registered decoder and
not assume we are striclty dealing with MJCF.
PiperOrigin-RevId: 826149497
Change-Id: I0ece26904280cb94bd5ded6dd5a565c539d60254
* Fix small bug when registering resource providers.
* Add test cases for OS filesystem fallback with VFS.
* Rewrite LoadModelFromString using a resource provider (now can pass custom VFSs).
PiperOrigin-RevId: 526959705
Change-Id: Iee1773e5584535d868aab6b206d1bf362e600c8a
A resource provider provides a mechanism for MuJoCo to read from filesystems other than the OS filesystem or the Virtual File System (VFS).
PiperOrigin-RevId: 525394983
Change-Id: I077ff5a7e2e76806b48b6defb531280aadc8b169