Commit Graph

16 Commits

Author SHA1 Message Date
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