Commit Graph

43 Commits

Author SHA1 Message Date
Yuval Tassa 8954a088ce Add automatic free-joint alignment.
PiperOrigin-RevId: 671010083
Change-Id: Ib7d60f75c7f545b1886703715663db8de77feeef
2024-09-04 10:07:33 -07:00
Yuval Tassa a1036b86d3 Allow connect constraints to be specified using sites.
PiperOrigin-RevId: 668925419
Change-Id: I10cb71e6706e617c830cd90d6d0836b94a5a8cfa
2024-08-29 07:10:51 -07:00
Yuval Tassa ad9cd7301e Correctly apply frame transform to light direction.
PiperOrigin-RevId: 665340267
Change-Id: Ida16ddbf3a057ffd3e260b71180a45acbf749931
2024-08-20 06:48:11 -07:00
Taylor Howell 466368efc6 Add shellinertia support for primitives: sphere, capsule, cylinder, ellipsoid, and box.
PiperOrigin-RevId: 661407997
Change-Id: Icddac58c540c71ea26ac7a3be874788443bd1122
2024-08-09 14:40:13 -07:00
Kyle Bayes f8b944bf7f Fix missing fclose when resource is closed without being read. Fixes #1685.
PiperOrigin-RevId: 649416747
Change-Id: I05eeb1071868116b6e5be76e26b465788e4d35b1
2024-07-04 08:07:34 -07:00
Yuval Tassa f2c3be470f Make seed fixed for random number generator when using <texture mark="random"/>
Also improve documentation regarding texture height and width attributes.

PiperOrigin-RevId: 648427167
Change-Id: I59a0fe75d3526f8563a5252584ed60ef7fb8fd70
2024-07-01 11:11:17 -07:00
Kyle Bayes 18634b6726 Add missing mj_deleteVFS to user unit tests.
PiperOrigin-RevId: 645001843
Change-Id: I671514ea4cb7786e5d1f7f55404d4925e446a262
2024-06-20 06:04:32 -07:00
Kyle Bayes ba93a9b5d6 Remove mj_makeEmptyFileVFS in favor of mj_addBufferVFS from MuJoCo codebases.
build / windows-2022 (push) Has been cancelled
build / macos-12 (push) Has been cancelled
build / ubuntu-20.04-clang-10 (push) Has been cancelled
build / ubuntu-20.04-clang-11 (push) Has been cancelled
build / ubuntu-20.04-clang-12 (push) Has been cancelled
build / ubuntu-22.04-clang-13 (push) Has been cancelled
build / ubuntu-22.04-clang-14 (push) Has been cancelled
build / ubuntu-22.04-gcc-10 (push) Has been cancelled
build / ubuntu-22.04-gcc-11 (push) Has been cancelled
build / ubuntu-22.04-gcc-12 (push) Has been cancelled
build / ubuntu-22.04-gcc-9 (push) Has been cancelled
PiperOrigin-RevId: 639824744
Change-Id: I7746c71b0be88a61e76c4622d605356701881563
2024-06-03 10:08:36 -07:00
Yuval Tassa 02d015458c Add mj_geomDistance API function and sensors for geometric distance, normal direction and segment between between two geoms. Fixes #51
PiperOrigin-RevId: 632458301
Change-Id: I65b7e5bb0df59008028114cf4a07e0d6365ff3d3
2024-05-10 04:52:43 -07:00
Kyle Bayes dc68bc6c13 Add another unit test for caching PNG decoded images verifying that when a PNG file is updated the stale cached asset is not used.
PiperOrigin-RevId: 629748520
Change-Id: I6935a3d172ac1459602d3d82ac548adeb08a7b11
2024-05-01 09:39:40 -07:00
Yuval Tassa 6f97f42458 Geoms of type mesh with zero density don't trigger the check for valid mesh volume.
PiperOrigin-RevId: 629416817
Change-Id: I23eaa0d61a703988a4eb96a3cad09e562384035e
2024-04-30 08:12:40 -07:00
Alessio Quaglino 618d879904 Make BVH generation robust to very small perturbations.
PiperOrigin-RevId: 629070367
Change-Id: I62b91a572cd59a51ed85e4e97aea53fdb2da1986
2024-04-29 08:06:32 -07:00
Yuval Tassa 027c26a153 Improve error reporting of sensorized objects.
Also remove duplication of element name and id from most error messages.

PiperOrigin-RevId: 628065116
Change-Id: Idd962fbab7aeba09e3a70c6c9d044b23db94cf23
2024-04-25 07:13:54 -07:00
Yuval Tassa cbb048ff00 Allow parent targeting for cameras and lights.
PiperOrigin-RevId: 628002614
Change-Id: I047dd3d62cfbc6432a3ec53fe6465afc52ca615b
2024-04-25 02:10:35 -07:00
Nimrod Gileadi f1d4f8f0a1 Test that mj_resetDataKeyframe treats negative keyframe IDs as a normal reset.
PiperOrigin-RevId: 607655812
Change-Id: Ia9bb1031468f04e8f9563b9228a46983356dafef
2024-02-16 05:09:05 -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 3601026b1d Refactor handling of auto-limits.
PiperOrigin-RevId: 605972151
Change-Id: If468af2081182787178d805124f2d2c90ee29951
2024-02-10 22:01:13 -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 42515033a7 Fix linter issues in user_objects_test.
PiperOrigin-RevId: 597204770
Change-Id: I0b396d4c64684d845dc9baf205800e22c8fac314
2024-01-10 04:00:08 -08:00
Yuval Tassa b1a912e9e2 Improve readability of test.
PiperOrigin-RevId: 589048504
Change-Id: I5087cfd67481df90103da2d7f5f06e421fc28e11
2023-12-08 01:18:59 -08:00
Alessio Quaglino 1db0a9946f Fix frame accumulation order for <frame> meta-element.
PiperOrigin-RevId: 588803425
Change-Id: Id0289c34d1a6cfb6007540a29cc1f32d879e43ed
2023-12-07 08:37:20 -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
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 8064ad59c8 Add camera projection sensor.
BEGIN_PUBLIC
Add camera projection sensor.
END_PUBLIC

PiperOrigin-RevId: 564726114
Change-Id: I33b8e5562eff29c21538bf8f38ce3116c7dfc5a9
2023-09-12 08:16:20 -07:00
Kyle Bayes 5fcdae771b Add content_type attribute that takes a MIME type to specify the file contents for meshes, hfields, and textures.
PiperOrigin-RevId: 549302344
Change-Id: I30a8adfef5b5d87bb20479329f3396892f5137ff
2023-07-19 06:51:36 -07:00
Nimrod Gileadi 74747e2ae6 Don't accept NaN geom sizes.
PiperOrigin-RevId: 542209911
Change-Id: I80f9728e8e624d19783370ba5072f39624c1bbe7
2023-06-21 04:02:48 -07:00
Kyle Bayes 23961e24b7 Refactor user codebase to use LoadResource helper method.
* 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
2023-04-25 07:24:45 -07:00
Nimrod Gileadi 4b1375297b Add a test that hfields are loaded and normalised to [0, 1].
PiperOrigin-RevId: 525103908
Change-Id: I3a6cc3a339cf31aa40700cd44962038d5c6bcf74
2023-04-18 04:05:04 -07:00
Yuval Tassa 221c63d744 Sensors of type user no longer require objtype and objname. If unspecified, the objtype will be mjOBJ_UNKNOWN. Also, `user sensors datatype default is now "real"`.
PiperOrigin-RevId: 489652972
Change-Id: I0a8f21ee1a2f5292e6bbcfe3785536cfd1498b85
2022-11-19 02:05:42 -08:00
Yuval Tassa 36b30e4500 Allow more than 1 activation state per actuator, but only for dyntype user.
Fixes #305.

PiperOrigin-RevId: 486597273
Change-Id: I3eb806f60949e68ebe6cbe35a6e66218a167ed45
2022-11-07 01:43:02 -08:00
Yuval Tassa 893942a729 Allow tendon springlength attribute to take two values between which the spring produces no force (a deadband).
If given two non-decreasing values, `springlength` specifies a deadband for spring stiffness, inside of which the force is 0 and outside of which force behaves like a regular spring, with the setpoint corresponding to the nearest value. This can be used to create tendons whose limits are enforced by springs rather than constraints, which are cheaper and easier to analyse. See test/engine/testdata/tendon_springlength.xml example model.

Spring-limited spatial tendons whose lower range value is 0 are rendered as catenaries.

Fixes #520.

PiperOrigin-RevId: 484509706
Change-Id: I6698e94ee36168f52d501e83057559805e05172d
2022-10-28 05:57:37 -07:00
Yuval Tassa 0eb7f871b9 Remove requirement that stateless actuators come before stateful actuators.
PiperOrigin-RevId: 484332415
Change-Id: I1dae92c0f8e027e4ca71c20ea3f68b2926526f53
2022-10-27 13:18:57 -07:00
Alessio Quaglino f695f55253 Do not infer inertia if geom is not in inertiagrouprange.
PiperOrigin-RevId: 483994271
Change-Id: Ia663cd30e93d9c3a2e32408a658f091af4d1ca1a
2022-10-26 09:45:18 -07:00
Saran Tunyasuvunakool 077acb1c8f Revert test fixture name in user_{model,objects}_test.cc.
These were inadvertently renamed to XMLReaderTest by an overzealous auto-renamer in 58fd72f53d.

PiperOrigin-RevId: 479520906
Change-Id: Ia50ec659f21a92cbcd4b953cde54dd98f0adb67a
2022-10-07 01:42:55 -07:00
Saran Tunyasuvunakool 58fd72f53d Dynamically allocate contact and efc_ arrays on a new memory arena.
- Add private function `mj_arenaAlloc`. This is used internally to allocate memory from the arena.

- Add private function `mj_nefc` to count constraints. This function returns a tight upper bound on `d->nefc`. The number of counted constraints can be slightly bigger than exact `d->nefc` in the case of constraints with empty Jacobian, as when placing a frictional tendon between two world sites.

- Add new `memory` attribute to the `size` XML element for specification of arena memory size. This attribute is mutually exclusive with `nstack` and `njmax` specifications, which are now deprecated (but left around for the time being for legacy compatibility).

- Move `d->stack` to the end of the new arena space. The stack now grows in reverse from the end.

PiperOrigin-RevId: 479341539
Change-Id: Ie019c202e0908577ffc6f833a37920858116f667
2022-10-06 10:03:05 -07:00
Nimrod Gileadi f556d4d94f Avoid out-of-bounds access when checking file extensions.
Include the '.' in the file extension check.

PiperOrigin-RevId: 474866478
Change-Id: I809ae975e4c8b00f17278735975a7d07e0748643
2022-09-16 11:49:33 -07:00
Nimrod Gileadi a693a2d981 Don't infer limited attributes automatically by default.
This is an amendment to 4bfc2c0311.

Add an autolimits compiler option. When true, *limited will be inferred from the presence of the *range attributes.
When false, models where limited is not specified, and range is will fail to compile.

PiperOrigin-RevId: 472438650
Change-Id: I489098e879ee695030f44e0d8cd969787e75fb90
2022-09-06 06:11:53 -07:00
Kevin Zakka e2c3f04097 Improve error message for invalid keyframe values.
PiperOrigin-RevId: 470007035
Change-Id: I482aea255954b0ec811b7400226419836d8449e3
2022-08-25 09:23:21 -07:00
Kevin Zakka 4bfc2c0311 Automatically infer *limited field from *range field for joints, tendons and actuators.
PiperOrigin-RevId: 467980594
Change-Id: If635c55a90cf949796b99a41395a6c2c4f7ea094
2022-08-16 11:35:34 -07:00
Yuval Tassa 09a5efc09e Add control values to keyframes.
- Add basic test for keyframes.
- Add missing documentation for keyframe mocap positions and quaternions.

PiperOrigin-RevId: 459021649
Change-Id: I91cf7ecbddc6262e8c72a868eeb82d627f389fb3
2022-07-05 01:07:37 -07:00
Saran Tunyasuvunakool 1913a02b40 Initial open sourcing of MuJoCo.
PiperOrigin-RevId: 450374687
Change-Id: Ie3225a46ce095fc28ae8e63c326a640261f562bb
2022-05-23 01:08:49 -07:00