Commit Graph

27 Commits

Author SHA1 Message Date
Yuval Tassa efe213a7b3 Cosmetic improvements to src/xml/ source files.
PiperOrigin-RevId: 738010419
Change-Id: Idb90a42a374682450737684e67388329c184c777
2025-03-18 08:12:29 -07:00
Alessio Quaglino da04688071 Automatically compile mjSpec in to_xml().
Also, move mj_compile from MjModelWrapper to MjSpec.

PiperOrigin-RevId: 737640210
Change-Id: I93d2a31c33eb359452b0d966a29939183b4c5198
2025-03-17 09:21:10 -07:00
Alessio Quaglino e310c23267 Fix return value of mj_saveXML and mj_saveXMLString, fixes #2247
PiperOrigin-RevId: 700269761
Change-Id: Ifb7e9c66c70eac7d681cfcf106712d47291cf9e2
2024-11-26 02:32:50 -08:00
Alessio Quaglino d17d9e835c Do not delete attached specs after compilation.
Also, copy them when copying the spec.

PiperOrigin-RevId: 688998464
Change-Id: I7229fd8032eafede582194ccf73ab4160fe06768
2024-10-23 09:42:05 -07:00
Alessio Quaglino dcf2816543 Remove copy_back from Python bindings and mj_copyBack from the C API.
PiperOrigin-RevId: 687377331
Change-Id: I355493d92857418b08b5aa90ea38cebe5c475314
2024-10-18 11:55:04 -07:00
Kyle Bayes 5ac5cfb618 Support directories in VFS via mj_addBufferVFS.
PiperOrigin-RevId: 655286683
Change-Id: I846376a0571d8df28d979beb5981a0cbccd7a04f
2024-07-23 13:39:18 -07:00
Kyle Bayes 2746cb8559 Support FilePaths instead of raw strings in XML code.
PiperOrigin-RevId: 655177026
Change-Id: I55b055551384b01ba7a4baa5d75fbe3329b7d25d
2024-07-23 08:36:53 -07:00
Kyle Bayes 2cf352c2e6 Add VFS handling logic to mj_openResource.
PiperOrigin-RevId: 653124909
Change-Id: I4d031eb0bfb0070f8493753d2aeaac60ac283b85
2024-07-17 00:41:18 -07:00
Kyle Bayes c6fd002f87 Move engine/engine_resource.{c,h} to user/user_resource.{c,h}.
PiperOrigin-RevId: 649628768
Change-Id: Id90c983cf70c0f92c3b033ac1b1654c53696955d
2024-07-05 05:41:55 -07:00
Alessio Quaglino 7a06bcfdaf Make model editing API public, fixes #364
Still missing:

- Detailed documentation.
- Python bindings.

PiperOrigin-RevId: 641445626
Change-Id: I20e67b707cf1bebae7e0cc94d17f7b76a89171f0
2024-06-07 22:28:01 -07:00
Alessio Quaglino b35ae973e1 Add mj_parseXML and mj_saveXML to xml_api.
PiperOrigin-RevId: 640099466
Change-Id: I75f763523c5bc8f6f7c2f2de6806d82ba37ebd4e
2024-06-04 15:28:14 +01:00
Kyle Bayes 50aab2dd48 Move engine/engine_vfs.{c,h} to user/user_vfs.{c,h}.
PiperOrigin-RevId: 636219666
Change-Id: I820de511948e82256784edb0893f209a73b221e6
2024-05-22 10:44:53 -07:00
Kyle Bayes 2f19941fcf Move mj_loadModel to xml_api.cc.
PiperOrigin-RevId: 635748029
Change-Id: Ie4c7d34c9738e5497ec700089d4dba780ba7d5ed
2024-05-21 03:37:24 -07:00
Yuval Tassa 62bc837b4c Rename remaining model to spec in xml/
PiperOrigin-RevId: 630855094
Change-Id: Ib921fe43b9b5a5a64867ef4c8c1cca217c27a5aa
2024-05-05 12:03:49 -07:00
Yuval Tassa 4660a297d1 rename mjspec api structs and functions mjm -> mjs
PiperOrigin-RevId: 618017976
Change-Id: I5f790167e5ca670f8d5f92e8e1c920db8d236144
2024-03-21 18:04:50 -07:00
Alessio Quaglino 655e3d0914 Renamed Model to Spec in C API function names.
PiperOrigin-RevId: 613922860
Change-Id: Ic47a83aa33b57ef96bd742088442e6237282ee92
2024-03-08 07:05:44 -08:00
Alessio Quaglino ef3cb7ec2e Renamed mjmModel to mjSpec.
PiperOrigin-RevId: 613516063
Change-Id: I09e360d3eba2accba2e260ec4754b0879b12892f
2024-03-07 02:48:32 -08:00
Alessio Quaglino 1bd44e73bb Replace mjCModel with mjmModel in mjXBase.
PiperOrigin-RevId: 611762880
Change-Id: I22254689b6cbf10fe7b61f9742b6ffd6c2074477
2024-03-01 03:38:28 -08:00
Kyle Bayes 3b0a680fa7 Refactor GlobalModel class in the XML API.
PiperOrigin-RevId: 601761425
Change-Id: I9c24f670c1e9766867ec75aab56cec1c0b4f5703
2024-01-26 07:33:47 -08:00
Kyle Bayes f86e8b449f Refactor VFS logic out of ResourceProvider plugin code.
PiperOrigin-RevId: 561302536
Change-Id: I952f9e76e85a7e3a111e0338f307378a6ff58197
2023-08-30 04:47:24 -07:00
Kyle Bayes 24c1ec9aec Add support for printing to stdout in mj_saveLastXML.
PiperOrigin-RevId: 546849864
Change-Id: I799ea3fcd723cf036f82ef5c1ef8152c314072dc
2023-07-10 06:08:10 -07:00
Yuval Tassa 466c9aca82 Remove mj_activate and mj_deactivate.
PiperOrigin-RevId: 538799120
Change-Id: I4d6729131e20ab9ae15c94c221ba83ae5732e942
2023-06-08 08:55:39 -07:00
Kyle Bayes 67f0f5154f Add various improvements for resource providers.
PiperOrigin-RevId: 529706437
Change-Id: I20385e031446674584349c301982dbe13b812477
2023-05-05 07:03:49 -07:00
Kyle Bayes fe3dccfd1d Add a new plugin / extension mechanism called a resource provider along with retrofitting VFS on top of it.
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
2023-04-19 03:02:22 -07:00
Kevin Zakka ee6fed1230 Add minor enhancements to compile binary.
* If output file exists, ask user whether to overwrite
* Fix erroneous check for whether XML file was successfully saved

PiperOrigin-RevId: 468743682
Change-Id: I06058c498328d333792e4b40d65c3a99ca1842e4
2022-08-19 11:15:19 -07:00
DeepMind 8dda269c8a Avoid msan reports on globals destructors
Somehow tests load these libs twice, and construct/destruct globals twice.
Can be preproduced even without sanitizers with logging from GlobalModel::~GlobalModel.

themodel does not need to be visible. If it's static each instance will have own a copy.
_mjMap does not need to use string and avoid lifecycle issues at all.

PiperOrigin-RevId: 454678814
Change-Id: I8fca5e1f06cbc2b413beabcece1219445482c0ed
2022-06-13 12:59:09 -07:00
Saran Tunyasuvunakool 1913a02b40 Initial open sourcing of MuJoCo.
PiperOrigin-RevId: 450374687
Change-Id: Ie3225a46ce095fc28ae8e63c326a640261f562bb
2022-05-23 01:08:49 -07:00