Commit Graph

151 Commits

Author SHA1 Message Date
Kyle Bayes dfd463cdb5 Reset nnzJ in resetData.
PiperOrigin-RevId: 517976421
Change-Id: I329c0096d368062f150c6dbeec181f5b0eeefcbf
2023-03-20 08:33:36 -07:00
Kyle Bayes 8696247f9d Add mj_stackAllocInt to get correct size for allocating ints on mjData stack. Reducing stack memory usage by 10% - 15%.
PiperOrigin-RevId: 517672195
Change-Id: Ie14e6c9c99e8b9e1c5d3686b77631f2df0651c67
2023-03-18 13:04:14 -07:00
Alessio Quaglino 70959c1a2c Added a collision midphase on geom pairs using rotated AABBs static trees.
PiperOrigin-RevId: 517357695
Change-Id: I068fee714d9638be2fb6d042d5d86f8ff970635b
2023-03-17 02:37:29 -07:00
Yuval Tassa 9a97674e1e Break up engine_derivative.c into analytical and finite-differencing functions (moved to engine_derivative_fd.c)
PiperOrigin-RevId: 517165392
Change-Id: I649f5521364877d36d7564bb650a889298f0c8a1
2023-03-16 10:45:15 -07:00
Yuval Tassa 8c7f6ce5a0 New implicitfast integrator and sparse RNE derivatives for implicit.
PiperOrigin-RevId: 516910733
Change-Id: I29a0465c0f0b1749a73e3d7e01925200d025ddd0
2023-03-15 13:17:41 -07:00
Kyle Bayes 056e849273 Provide improved mju_sqrMatTDSparse implementation that doesn't require dense memory allocation for sparse matrices.
PiperOrigin-RevId: 516812783
Change-Id: Ieb43337831d8d3b2c7f18a7facd8e0a0f2b0eff5
2023-03-15 06:56:16 -07:00
Yuval Tassa 222ee00a66 Break out passive force functions into a new file engine_passive.c
PiperOrigin-RevId: 513834952
Change-Id: I5347440f24d767a7dc81a34e48e1e17d8c10173f
2023-03-03 08:32:16 -08:00
Kyle Bayes 50bebcb4ee Precount number of non-zeros for constraint Jacobian sparse matrix.
PiperOrigin-RevId: 512947632
Change-Id: I9605e81b4e51fbc90854c13153e4fee38ad48fb9
2023-02-28 08:57:56 -08:00
Yuval Tassa 7e7cb177a4 Cosmetic changes.
PiperOrigin-RevId: 511008317
Change-Id: Id8d7cd4f4e22e0658857d16b47d51053f1477bb9
2023-02-20 09:23:32 -08:00
Yuval Tassa 7542c90cd2 Improved behaviour of mouse-spring interactions.
Also:

- Renamed recently introduced `mjvPerturb` member `reflocalpos` -> `refselpos` and corrected docstring.
- Added `mjvPerturb.localmass`: body spatial inertia at selection point.
- Removed `const` qualifier to `mjData` argument of `mjv_initPerturb()`, to facilitate spatial inertia computation.
- Improved `mj_Object{Velocity, Acceleration}` docstrings, clarifying that rotational velocities precede linear velocities.
- Removed redundant const qualifiers from non pointer arguments to `mju_dot` and `mju_writeNumBytes`.

PiperOrigin-RevId: 511002168
Change-Id: I27400f497947f330072d4abb7c9bf7e71e6c5d49
2023-02-20 08:40:33 -08:00
Alessio Quaglino 9756ed0d80 Read normals and textures from OBJ, do not duplicate vertices.
PiperOrigin-RevId: 510461549
Change-Id: I19245d691e722a8371e61153383f275f599353d6
2023-02-17 10:15:25 -08:00
Yuval Tassa 6a85b5db45 Improve cartesian actuator example model.
Significantly reduced joint-level damping, introduced damping in the actuators themselves. This reduces dynamics artifacts by matching the space in which damping and actuation forces are applied.

PiperOrigin-RevId: 509574523
Change-Id: Id99b69aea4562509c48ed1a24fb9ea3e008c0b69
2023-02-14 10:41:21 -08:00
Saran Tunyasuvunakool db28c31f05 Rename <required> tag to <plugin>.
PiperOrigin-RevId: 509237786
Change-Id: I35e812830b479004ac5025cbd9477888f51fb43e
2023-02-13 08:41:52 -08:00
Saran Tunyasuvunakool 5e989d18c3 Enable compiler errors for implicit switch case fallthroughs.
Also unify warning options across Clang and GCC and fix minor issues that was surfaced by this.

PiperOrigin-RevId: 508619655
Change-Id: I59b777bf2dfea4422485670e2427c7d3f5cf6405
2023-02-10 03:49:00 -08:00
Nimrod Gileadi 48e95817e4 Don't compute sensors in mjd_transitionFD, if not requested.
PiperOrigin-RevId: 507878658
Change-Id: I97ece521fd177d97fa5758dda1eb012ba26bcabe
2023-02-07 14:02:45 -08:00
Copybara-Service 6b80b010af Merge pull request #705 from hartikainen:bug/mj_deleteFileVFS-infinite-loop
PiperOrigin-RevId: 507544780
Change-Id: Ie5819d4cc567dce44ceb59624a889a06ecdd7c1b
2023-02-06 12:01:11 -08:00
Nimrod Gileadi dc3a900809 Apply body pair filtering at broadphase.
mj_contactFilter removed geom pairs where their bodies share the same weldid, but this check can be applied at broadphase instead of at geom-geom level.

PiperOrigin-RevId: 507435848
Change-Id: Ia37c741071dc5e1c26686dd319f42c9bd334d305
2023-02-06 03:46:20 -08:00
Yuval Tassa 7feecf6e94 Improve behaviour of set-pose mouse interactions with free and mocap bodies.
PiperOrigin-RevId: 506051745
Change-Id: If666757deb743f7bf3af4113d10976c3294e0879
2023-01-31 10:57:19 -08:00
DeepMind 929e09f84a Improve URDF geom name loading API.
PiperOrigin-RevId: 505112774
Change-Id: I866e58e664089256a41908dddab9ad79745fb1da
2023-01-27 07:29:45 -08:00
Kyle Bayes c741dfce7d Implement a more performant mju_transposeSparse that doesn't require dense memory allocation.
PiperOrigin-RevId: 505044194
Change-Id: Ibe0e39e3ad711b2b5bdad45180ca4f83b5c8fc82
2023-01-27 00:20:01 -08:00
Kristian Hartikainen d35670932f Fix for-loop syntax to match style convention 2023-01-25 19:11:13 +00:00
Kristian Hartikainen 436fc6e77c Fix infinite loop in mj_deleteFileVFS 2023-01-21 17:26:01 +00:00
Alessio Quaglino 6ba4d6f0de Fix a bug that was causing a mismatch between the orientation of the mesh frame and the vertex coordinates.
PiperOrigin-RevId: 502624466
Change-Id: Ib28fd2a118b6572be98fadb078fa2262b21cbfc0
2023-01-17 10:31:50 -08:00
Yuval Tassa 06557c1489 Set time correctly in mjd_transitionFD, to support time-dependent user code.
PiperOrigin-RevId: 502380864
Change-Id: Ief36135a900c091d95e4450992c7c73e86de267c
2023-01-16 07:52:17 -08:00
Yuval Tassa b5813c60ca Add some geom names to testdata/model.xml.
PiperOrigin-RevId: 502374873
Change-Id: I44a4c82327ed345cd84709d6b2966f54f4dec7bd
2023-01-16 07:08:56 -08:00
Yuval Tassa adf71cc6b4 Improve mesh-fitting image in changelog.
PiperOrigin-RevId: 500782543
Change-Id: Iecec45abd3cb1e5a06df58ae32ebe1998584024a
2023-01-09 12:40:10 -08:00
DeepMind 703b33c064 Add geom names to URDF parsing in MuJoCo.
Fixes #566

PiperOrigin-RevId: 500750288
Change-Id: I00f94ee37bb2f15be59df3933d0d4dba583f0921
2023-01-09 10:34:22 -08:00
Alessio Quaglino 19b6c70e13 Use global coordinates for computing the frame position of a primitive geom fitted to a mesh.
PiperOrigin-RevId: 500720200
Change-Id: I0a564aff1fe6943002db14f46f789cfdaef4d2de
2023-01-09 08:29:27 -08:00
Nimrod Gileadi f85f3fba2f Avoid duplicate contact points in compound bodies.
Sometimes broadphase returns the same body pair multiple times. In those cases, avoid creating every contact twice.

PiperOrigin-RevId: 499869235
Change-Id: I58606168b0723d40b4fdd43b1fafad79bf35d76d
2023-01-05 07:28:05 -08:00
Kyle Bayes f1007df013 Implement hash map for mj_name2id using djb2 and linear probing.
PiperOrigin-RevId: 499485127
Change-Id: I5aed6549db18b92d7c8a3b7590e50a00ce13a439
2023-01-04 07:57:55 -08:00
Saran Tunyasuvunakool 05216f183c Fix broken test on MSVC.
Test was broken by 2e6af64b31.

PiperOrigin-RevId: 495196716
Change-Id: I0402b05da2778c54c2761efe5d9977fd091cddd6
2022-12-13 20:22:50 -08:00
Yuval Tassa 30b4309af9 Rename mjpPlugin.capabilities -> mjpPlugin.capabilityflags
PiperOrigin-RevId: 495080532
Change-Id: I81743472b816a331890a7cb05bfb7a89ebf07ff9
2022-12-13 11:33:27 -08:00
Saran Tunyasuvunakool 5c021d042b Modify signature of plugin reset callback.
The `reset` function is called inside `mj_resetData`, before any physics forwarding call has been made. It is therefore an error to read anything from mjData at this stage.

The only valid operation on mjData during `reset` is for a plugin to write into its own state variable slots and data struct. We modify the function signature to only provide access to these.

PiperOrigin-RevId: 495032492
Change-Id: Ic6d2967d2571a9083cbca1ba239ca70a8a51f474
2022-12-13 08:41:35 -08:00
Saran Tunyasuvunakool 2e6af64b31 Change mj_versionString test to not rely on a golden value.
PiperOrigin-RevId: 495026376
Change-Id: I378d2cff1edfe4d49c1bd7c131d92502d0a6b5b2
2022-12-13 08:16:55 -08:00
Alessio Quaglino 3de2873883 Add deprecation warning for the Rope Composite type.
PiperOrigin-RevId: 494985209
Change-Id: I6ce7ca2aeae6f1e798bd4bda9b755852add26a36
2022-12-13 04:35:48 -08:00
Nimrod Gileadi 7076da6909 Correctly validate the size of user sensors in mj_validateReference.
PiperOrigin-RevId: 494877162
Change-Id: I0a070d7813efea6216d15270f62b6009c55e1a54
2022-12-12 17:49:06 -08:00
Alessio Quaglino b712e0757e Define kNumEdges and kNumVerts constants in Solid plugin.
PiperOrigin-RevId: 493587525
Change-Id: Ifa82211a4dfc3b288825b0961c48fc679aae204c
2022-12-07 06:30:40 -08:00
Alessio Quaglino 2d304d65e5 Use memcmp for mju_compare if no AVX. 15% faster on Humanoid.
PiperOrigin-RevId: 493324356
Change-Id: I5f71dc1a8ae40c18864ea80f00a5f86ff952f72c
2022-12-06 09:14:33 -08:00
Alessio Quaglino 7f459ab8ca Print vertex IDs when inconsistent face is found.
PiperOrigin-RevId: 493311839
Change-Id: I0283d86bc6092fbe4f47b845fa8ec212bffdfa1a
2022-12-06 08:24:46 -08:00
Saran Tunyasuvunakool e4f1d584ad Add control plugin API.
PiperOrigin-RevId: 493311715
Change-Id: Iccd99fb26004f39832818e378f01f9149a0e3e3b
2022-12-06 08:23:49 -08:00
Kyle Bayes 73fb61e3e2 Bump version number to 2.3.1.
PiperOrigin-RevId: 493076656
Change-Id: I48c7a45b503c4a7363ea1455a4a3788262d007f7
2022-12-05 12:13:55 -08:00
Yuval Tassa dee1d6020a Make "acc" the default computation stage for sensors of type user.
PiperOrigin-RevId: 492689134
Change-Id: I21c07c74cb4b94d39c091ae98b169fd1235769d4
2022-12-03 07:50:15 -08:00
Alessio Quaglino 89185b4af2 Using full path when adding a file to VFS. Fixes #616.
PiperOrigin-RevId: 492204185
Change-Id: If2b2230c095fe0bb776fcc3ffda48f13d0be5cb2
2022-12-01 08:34:20 -08:00
Alessio Quaglino 26f71e2f6c Check that spacing is greater than geometry size for Composite particles and grid.
PiperOrigin-RevId: 491858371
Change-Id: I03a669286c283a72947705463426badcfc9b0bfd
2022-11-30 02:17:42 -08:00
Alessio Quaglino d0b1a97338 Deformable solid plugin for particles.
Using coordinate-free formula equivalent to linear finite elements.

PiperOrigin-RevId: 491317615
Change-Id: I096b9a56075bbb630f64bfffac8a8d66457e5e2d
2022-11-28 05:32:30 -08:00
Alessio Quaglino c17375fa32 Stop profiling mju_halton in testspeed and bechmarks.
PiperOrigin-RevId: 490239351
Change-Id: Id73c101672e5b974f16b6b4da3aae757a657de15
2022-11-22 07:41:02 -08:00
Yuval Tassa 165e72f798 Apply force perturbations at selection point rather than body center-of-mass.
PiperOrigin-RevId: 489996756
Change-Id: I87870a0c1d173449f15a7249f2459a6b726ff417
2022-11-21 09:13:16 -08:00
Alessio Quaglino 638c9a6994 Support capsules in URDF import.
PiperOrigin-RevId: 489980760
Change-Id: I1c21e736a86f6637a00e2062727d2e6fd5694c42
2022-11-21 07:58:42 -08: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
Alessio Quaglino 043ed273a7 Automated g4 rollback of changelist 489207765.
*** Reason for rollback ***

Corrected logic in CMake

*** Original change description ***

Automated g4 rollback of changelist 489183597.

*** Reason for rollback ***

GitHub path is different

*** Original change description ***

Activate plugin tests on Windows.

***

***

PiperOrigin-RevId: 489228199
Change-Id: Ic0ee9114e9680fc0aef9f668fc172c73fe74cd38
2022-11-17 09:15:40 -08:00