Commit Graph

88 Commits

Author SHA1 Message Date
Yuval Tassa caf215e342 Add metallic and roughness scalar attributes to materials.
Rename `light_radius` -> `light_bulbradius`, make the default value 0.02.

PiperOrigin-RevId: 627032170
Change-Id: I1e01e2eca028c0aefc2e7dc384e8b34abac184aa
2024-04-22 07:39:06 -07:00
Yuval Tassa 4b7b40d329 Add test for saving and loading binary models.
PiperOrigin-RevId: 626019520
Change-Id: I1e349921b3408bee288c52d9e52b29006ff3fda4
2024-04-18 06:55:07 -07:00
Alessio Quaglino 4b6c07cd7d Prevent bodies from overwriting the frame names in xml_native_writer.
PiperOrigin-RevId: 625632369
Change-Id: If3bd048ac40e116fcb97beb3dca3d99826fe4ad0
2024-04-17 04:07:50 -07:00
Yuval Tassa 0cd28d2423 Add light radius attribute.
Also fix bug: light defaults were not being saved.

PiperOrigin-RevId: 625142278
Change-Id: I8ec3a5a06e9f314e98b7c34346db3c24b34d7e0b
2024-04-15 17:55:15 -07:00
Google DeepMind 4f0293c6cb Added support for msh2.2
Now we can load flex with format 2.2 binary and ASCII.
There are two different parsing strategies. One for gmsh app and the other is for ftetwild.

Used the shark model from Scanned Objects by Google Research:
https://app.gazebosim.org/GoogleResearch/fuel/models/Weisshai_Great_White_Shark

PiperOrigin-RevId: 619229499
Change-Id: I6eb876afcbc8a00631914b093c45bde10c0caaf6
2024-03-26 10:12:13 -07:00
Alessio Quaglino bda03af49a Add childclass support to frames.
PiperOrigin-RevId: 615487831
Change-Id: I0e4d2efd52211701b4286a0b0de84424470a3a47
2024-03-13 11:31:22 -07:00
Alexis Fraudita a2a770453e Copybara import of the project:
--
1fcff13dfdc70519c4d33e17ade4be6afb2960a2 by Alexis <cuatroalejandro@gmail.com>:

add multipleBodies test for mj_loadXML

--
34270fa57946e68a82fa55313b64a5a56e5aa080 by Alexis <cuatroalejandro@gmail.com>:

add some space

--
3594020eb9be57cb6a2eef0baeca97cee8f25aab by Alexis <cuatroalejandro@gmail.com>:

remove TODO comment in xml_api_test

COPYBARA_INTEGRATE_REVIEW=https://github.com/google-deepmind/mujoco/pull/1487 from alefram:alexis-test 3594020eb9be57cb6a2eef0baeca97cee8f25aab
PiperOrigin-RevId: 615033458
Change-Id: I05fe5659b07b3226b82d2562e31bcd73f150b089
2024-03-12 07:31:11 -07:00
Kyle Bayes 31384bdfeb Speed up String2Vector.
PiperOrigin-RevId: 612767185
Change-Id: I4a4de5e03bbd6653be7ccb3e730ad64a335e17b0
2024-03-05 02:50:26 -08:00
Alessio Quaglino 9efa4ebe0b Move CompareModel to fixture.
PiperOrigin-RevId: 612759913
Change-Id: Ia5741a858003211c58c47a20d447dcbc041c8b5d
2024-03-05 02:24:32 -08:00
Yuval Tassa 8679c9fc59 Fix null pointer deref for unknown class names.
PiperOrigin-RevId: 610391077
Change-Id: I5abd62ff46e31e788f06fe111adb3c25287d4fdc
2024-02-26 06:38:52 -08:00
Kyle Bayes 24eb4c9f09 Improve include meta-element to load included resourced from the directory relative to the included XML file, fully backwards compatible.
PiperOrigin-RevId: 608312069
Change-Id: I80eadb32d7d78fb35bd24975f2e514021c2aa009
2024-02-19 05:40:31 -08:00
Yuval Tassa 05150546e3 Add inheritrange attribute to position and intvelocity actuators.
PiperOrigin-RevId: 607650147
Change-Id: Ibc1846f89179786d4f93435c3924687b4c5d1432
2024-02-16 04:42:44 -08:00
Yuval Tassa f9f7827a64 Trim trailing default values in saved xmls.
For attributes which accept variable-length inputs. Currently used for `gainprm, biasprm, friction, solref, solimp` Example:

- Saved before: `biasprm="0 -3 -4 0 0 0 0 0 0 0"`.
- Saved after: `biasprm="0 -3 -4"`.

PiperOrigin-RevId: 607609550
Change-Id: I0501348280663867693175236872e2aabc703601
2024-02-16 01:36:06 -08:00
Alessio Quaglino 414a67640a Add mjmDef to C API.
PiperOrigin-RevId: 607310534
Change-Id: I530f32c8fd4340dc1006585259a5e05cb4aa62b8
2024-02-15 06:17:58 -08:00
Kyle Bayes eabd4c06f9 Move schema definition validation from runtime to a test.
PiperOrigin-RevId: 606280564
Change-Id: I9fec9eb3538f63f84e1982f21e1a93f16342d540
2024-02-12 09:49:48 -08:00
Kyle Bayes ff39d0b812 Keep include elements while parsing XML. No change in behavior.
PiperOrigin-RevId: 606203141
Change-Id: Ica06f7c121a90597cd29f74692230365edd4302f
2024-02-12 03:54:44 -08:00
Yuval Tassa 3601026b1d Refactor handling of auto-limits.
PiperOrigin-RevId: 605972151
Change-Id: If468af2081182787178d805124f2d2c90ee29951
2024-02-10 22:01:13 -08:00
Matthew Bennice b9c50ad79c Move fullinertia from mjCAlternative to mjCBody with correction to handle URDF with 0 inertias.
PiperOrigin-RevId: 604812870
Change-Id: I018254d1362a654a4f99bf5e621d5abc7129a0c6
2024-02-06 17:21:31 -08:00
Matthew Bennice 84f20ffb66 Automated g4 rollback of changelist 604607692.
*** Reason for rollback ***

breakage resulting in "inertia must have positive eigenvalues" when parsing URDF's

*** Original change description ***

Move fullinertia from mjCAlternative to mjCBody.

***

PiperOrigin-RevId: 604677400
Change-Id: Iab8263b5b0aee310bd75404e314f3b707ce3300e
2024-02-06 09:47:04 -08:00
Alessio Quaglino 737342bdfe Move fullinertia from mjCAlternative to mjCBody.
PiperOrigin-RevId: 604607692
Change-Id: Ic2fcc08b9073d01ab190e7acacc3d827dbdfbca4
2024-02-06 04:43:12 -08:00
Alessio Quaglino df76b55fe0 Add line error check to user_objects and xml_native_reader tests.
PiperOrigin-RevId: 603714614
Change-Id: Ic031f33a9a6eb45b3e61cb666e0d4890bfe08275
2024-02-02 09:57:49 -08:00
Yuval Tassa e143b3dbc0 Allow height-field elevation data to be specified in XML.
PiperOrigin-RevId: 602374498
Change-Id: I2d3364d68876a35799b24aca1051e2f5aebdda75
2024-01-29 06:59:28 -08:00
Yuval Tassa 5b2c98f8f1 When saving XMLs, don't round floats that are bigger than INT_MAX. Fixes #1278
PiperOrigin-RevId: 590692020
Change-Id: Icd11d20f47bc4163eb4378f4cb031b8fd9d13612
2023-12-13 13:13:15 -08:00
Yuval Tassa b22919543d Fix bugs related to saving of <statistics> values.
Before this change:
- User-modified values of `mjModel.stat.{meanmass, meaninertia}` would not be saved to XML.
- Non-user-modified values of `mjModel.stat.{meansize, extent, center}` would always get saved to XML.

After this change values are saved to XML only if provided by the user, either in the XML or by changing values in `mjModel` before saving.

PiperOrigin-RevId: 589473351
Change-Id: I4dcf4892ef61c35edf424226e731232d861bad8d
2023-12-09 16:06:39 -08:00
Yuval Tassa 762371c3e4 Add kv damping attribute to position and intvelocity actuator shortcuts.
PiperOrigin-RevId: 588377097
Change-Id: I8ded2ff982e52ed8673019979e29b706ef65c743
2023-12-06 04:28:30 -08:00
Alessio Quaglino eb9568a48b Add frame element to MJCF.
PiperOrigin-RevId: 585598244
Change-Id: I4c06be3dd586dab5a4458f05faaf1e7f2b615458
2023-11-27 03:32:18 -08:00
Yuval Tassa 893c404230 Runtime disabling of actuators according to group.
Added `option-actuatorgroupdisable` attribute and associated `mjOption.disableactuator` integer bitfield, used to disable sets of actuators at runtime according to their group.

- The first 6 actuator groups are toggleable in the `simulate` viewer.
- Minor refactor and cleanup of actuator documentation.

https://youtu.be/H9qG9Zf2W44

Fixes #1092.

PiperOrigin-RevId: 578335600
Change-Id: I4cf663b90ea768e4380acfa2fe3b8c15c7cbb568
2023-10-31 16:24:38 -07:00
Nimrod Gileadi 393cfec1e8 Don't use PluginTest as the fixture name in xml_native_writer_test
PiperOrigin-RevId: 574129298
Change-Id: I8c3e10bf271d54cb414b8d2af3724d8c81b6fc80
2023-10-17 06:32:37 -07:00
Yuval Tassa d88675a034 Change the default of <compiler autolimits> from "false" to "true".
PiperOrigin-RevId: 573184793
Change-Id: I24075a8d953d0a3c3ddf65c67e1e18075cd029b6
2023-10-13 05:05:24 -07:00
Yuval Tassa 493ae95d69 Add stack leak test to WriteReadCompare
PiperOrigin-RevId: 572953669
Change-Id: Id6cad3fc86777d68f218119f67c9dc473bdcfcc8
2023-10-12 10:53:24 -07:00
Alessio Quaglino 5a70ad08ab Add Flex component.
PiperOrigin-RevId: 572830650
Change-Id: I6908228087b7b9683be3506c8d9cdc725ed5dcd5
2023-10-12 10:49:35 +01:00
Alessio Quaglino 36d2ffe4f2 Specify camera parameters using standard robotics conventions.
PiperOrigin-RevId: 569147555
Change-Id: I3443f95e5de56a17024f5e5c03f33888dd583edb
2023-09-28 05:19:19 -07:00
Alessio Quaglino d3d46e16a4 Remove cloth and rope composites and deprecate loop.
PiperOrigin-RevId: 568168329
Change-Id: Ida4a5236bef74828c7bf59affdc28adea3db53b1
2023-09-25 03:38:43 -07:00
Alessio Quaglino 1afd98ec4b Add [SdfLib](https://github.com/UPC-ViRVIG/SdfLib) plugin to first-party SDFs.
The following dependencies are disabled with a cmake patch file.
- Enoki
- OpenMP
- Assimp
- FCPW

PiperOrigin-RevId: 565352386
Change-Id: Icff9de68408e0afa2032bb83b24491fc4e41d181
2023-09-14 06:42:42 -07:00
Saran Tunyasuvunakool 94a8705ad0 Add mj_markStack and mj_freeStack as public API functions.
Also add asan instrumentation to detect stack frame leakages (i.e. `mj_markStack` without a corresponding `mj_freeStack` in the same caller function).

PiperOrigin-RevId: 562625645
Change-Id: I4e3ff66ca0b9d08ed0a95cef45393db8e3053e22
2023-09-04 17:04:11 -07:00
Saran Tunyasuvunakool daa2ac7f8b Rename nstack to narena, change it and pstack to count bytes.
PiperOrigin-RevId: 561066311
Change-Id: I4d0e645e6c254dd906bfc42159e0e99149a7c6c8
2023-08-29 10:13:33 -07:00
Yuval Tassa 55173e58f9 Save <compiler {boundmass/boundinertia}> if nonzero.
Fixes #928

PiperOrigin-RevId: 560967976
Change-Id: Idc8c043278362d8925ce41061c65f3e678ad50ce
2023-08-29 02:41:22 -07:00
Yuval Tassa cf310079e2 Don't allow quat="0 0 0 0" in XML.
PiperOrigin-RevId: 557535436
Change-Id: Ie71246da5fff67a7cc37cb1801dd88d4a79b5766
2023-08-16 10:47:23 -07:00
Kyle Bayes 5f246ef210 Add ReadAttrVec, ReadAttrArr, ReadAttrStr, and ReadAttrNum to XML utils.
Moving forward, the compiler objects should have encapsulated data, therefore the old ReadAttr* methods are being deprecated as they require raw pointers to read into.

No external changes other than minor improvements to ReadAttr and ReadVector.

PiperOrigin-RevId: 550880401
Change-Id: I632f40322ccd935f9af9b69e66b056c5cda6face
2023-07-25 07:31:23 -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
Alessio Quaglino 46e06c4cac Add elasticity plugins to xml_native_writer_test. Fixes #961.
PiperOrigin-RevId: 545454207
Change-Id: I4e93499eaa53e5bc8c8afa682986657cef3ac20f
2023-07-04 08:30:30 -07:00
Yuval Tassa d40c395917 Add Visualization tab to simulate.
Also:
- Increased label width in mjUI tight theme spacing.
- Added `mjITEM_EDITFLOAT` for editing float values.
- Move mjUI numpad key codes to header file.
PiperOrigin-RevId: 535839953
Change-Id: Ibdc0a9a20be514caa5b487211212ed6f5b8a6ba9
2023-05-27 05:08:15 -07:00
Saran Tunyasuvunakool f887c1e928 Add ASAN and MSAN instrumentation for arena and mjData stack.
PiperOrigin-RevId: 535635490
Change-Id: Ia1e58771bae25bf72c861f57452fb8faa2b918fb
2023-05-26 09:17:26 -07:00
Saran Tunyasuvunakool fbbdf70401 Make XMLWriterLocaleTest hold a copy of the old locale string.
The rationale is the same as in 0d0a41d549. XMLWriterLocaleTest still sporadically fails with a stack buffer overflow error when built with MSVC 2019 prior to this change.

PiperOrigin-RevId: 534035241
Change-Id: I1c50457e386724021b8d97ab1fb9cc2ece795292
2023-05-22 05:34:24 -07:00
Yuval Tassa 770b4b363a Added optional smoothing to muscle dynamics:
- `muscle` actuators take a new `tausmooth` attribute (defaults to 0) which when positive, smooths the transition between activation and deactivation timescales.
- `mju_muscleDynamics` takes 3 parameters, adding width of smoothing sigmoid.

PiperOrigin-RevId: 531473354
Change-Id: I8ab6c0289ff04437e798c3ca6edda132a30fcc31
2023-05-12 04:58:53 -07:00
Yuval Tassa c65e046043 Don't save actdim="{0,1}" for state{less,ful} actuators, respectively.
actdim has a default value of -1 (==unset), which means it currently gets saved for all actuators. After this change, it will only be saved if the value is > 1, errors are thrown for stateful actuators with actdim=0 and stateless actuators with actdim>0.

PiperOrigin-RevId: 520627313
Change-Id: Ia498dae5c7314cfaa0995f8077d297c2339a5c35
2023-03-30 07:00:17 -07:00
Yuval Tassa 0becf8fd98 Remove unused headers in test files.
PiperOrigin-RevId: 520610859
Change-Id: I5ac906b422a7c02737af85f6a2aea46206f0cb28
2023-03-30 05:26:33 -07:00
Yuval Tassa 1d6a9e09bb Don't save body pos if "0 0 0".
PiperOrigin-RevId: 520598416
Change-Id: I5bb6ffaec386f228ac7a5fa221822000635900ae
2023-03-30 04:09:22 -07:00
Yuval Tassa 3f9defa8d0 Don't save an empty <default/> section.
PiperOrigin-RevId: 520594748
Change-Id: Ib5e1eb3a93e9d579adeda1052a2c29d724d6b497
2023-03-30 03:51:14 -07:00
Yuval Tassa ddfcd3b325 Don't save body gravcomp if 0.
PiperOrigin-RevId: 520592156
Change-Id: Ifb85c1e78498877bc576cfca224c41b3cf47c9ab
2023-03-30 03:34:04 -07:00