Kyle Bayes
b935d4153c
Add new mju_threadpool API function, and delete old threading API.
...
PiperOrigin-RevId: 922838541
Change-Id: Id9f7e0fb298ffde61fcc49a802dc78971858ce51
2026-05-28 10:11:44 -07:00
Alessio Quaglino
f6cd0234fd
Change tactile sensor normal component to report penetration depth.
...
The normal component of the tactile sensor now reports the maximum penetration depth at each taxel, instead of a derived normal force. The depth is negated so that positive values indicate penetration.
PiperOrigin-RevId: 921980899
Change-Id: Ide4103c0aff465e25a81cfdda650f6a0e2da9e0b
2026-05-27 02:00:34 -07:00
Alessio Quaglino
8287d9d152
Fix insidesite sensor for massless flex parent bodies.
...
mjSENS_INSIDESITE uses xipos to test containment, but for massless flex
parent bodies xipos equals the static body frame origin and does not
track the actual flex position.
Fix: in the INSIDESITE sensor case, when the object is a massless body
with positive subtree mass (i.e., a flex parent), use subtree_com
instead of xipos. This correctly reflects the mass-weighted centroid of
the flex child bodies without changing the global semantics of xipos.
PiperOrigin-RevId: 908745144
Change-Id: I527f0efb7b419345188411c9da883505156ebeea
2026-05-01 08:27:04 -07:00
Alessio Quaglino
2d33b50243
Parallelize tactile sensor computation.
...
The computation of tactile sensor values for each taxel is now parallelized using the MuJoCo threadpool when the number of taxels exceeds a threshold. Each thread processes a batch of taxels, accumulating forces from all colliding geoms.
PiperOrigin-RevId: 888606457
Change-Id: I98abf3e98a7318fc14080054bea7093ab46e8b8b
2026-03-24 05:21:08 -07:00
Yuval Tassa
efae9157a7
Polynomial stiffness and damping https://youtu.be/aKa3ZlEF9_Y
...
PiperOrigin-RevId: 884607673
Change-Id: If8088dbf37fed1055304778a7eb84dec52cba920
2026-03-16 13:25:25 -07:00
Alessio Quaglino
8dc5cc4c70
Skip tangential components in tactile sensor if mesh has only normals.
...
PiperOrigin-RevId: 879036130
Change-Id: Ic4184dd535700c5099768dabf5009ba96b218542
2026-03-05 06:35:41 -08:00
Yuval Tassa
6419534bad
Add actuator and sensor delays. Fixes #1004
...
PiperOrigin-RevId: 866478839
Change-Id: Id21a6da0f98454c8fa39ea5af8a5e213d6eae497
2026-02-06 08:47:36 -08:00
Yuval Tassa
19ff06155a
Refactor sensor computation into per-sensor functions.
...
PiperOrigin-RevId: 862180688
Change-Id: I9f3f4da8ca8abed778965fd3970171276ee4570d
2026-01-28 05:04:59 -08:00
Yuval Tassa
1d2d0b1c37
Remove batching optimization from GEOM* sensors
...
PiperOrigin-RevId: 861938606
Change-Id: Ibb135a4d99cab9ce23a04f844f7c730e8f3b31c8
2026-01-27 16:44:10 -08:00
Yuval Tassa
5fb47df197
Add mjData flags marking lazily evaluated pipeline stages
...
PiperOrigin-RevId: 861763477
Change-Id: Ib613c56949264573a16306800658f868d2aa7665
2026-01-27 09:45:06 -08:00
Yuval Tassa
218226fc95
Breaking change: Add surface normal output to MuJoCo raycast functions.
...
PiperOrigin-RevId: 855781592
Change-Id: Id96b1ca7eaf722e260cc69d7706c28dc51f52d92
2026-01-13 10:22:21 -08:00
Yuval Tassa
70bc7be4bc
Add additional data fields that can be reported by rangefinder sensors.
...
PiperOrigin-RevId: 848316991
Change-Id: Idbf7ba81b4da711a22c23302c8782ab2b0b98d82
2025-12-23 15:33:00 -08:00
Yuval Tassa
9d646e6548
Extend rangefinder sensor to support cameras.
...
PiperOrigin-RevId: 848255889
Change-Id: I6e1a9ed13d29d2242558625a47e24e47ad6e87db
2025-12-23 12:04:49 -08:00
Kyle Bayes
ae24034f24
Refactor hfield-convex collision code. This should be a no-op.
...
PiperOrigin-RevId: 837045492
Change-Id: I82851615c7f69774da83cab361316e5a6e9982c6
2025-11-26 03:26:56 -08:00
Yuval Tassa
769f37b653
Implement sleeping in engine
...
PiperOrigin-RevId: 829361787
Change-Id: I6f64d8e25c4248cf32c18cd94d37ff5def78946e
2025-11-07 03:33:07 -08:00
Yuval Tassa
5715cebbb9
MSAN: Don't clear mjData.sensordata in mj_resetData
...
This is strictly an out array and should not be read before it is written to. This change improves MSAN coverage of engine code.
PiperOrigin-RevId: 819767673
Change-Id: I57500c8147f4774d326cf87ea3bac5420e4dd54d
2025-10-15 08:31:03 -07:00
Yuval Tassa
edbdb5195c
Change MuJoCo engine source code function-spacing convention from 3 blank lines to 2
...
PiperOrigin-RevId: 813754244
Change-Id: I6836e41c3b021cb727e922c25c60f629b9814c93
2025-10-01 07:58:17 -07:00
Kyle Bayes
8de86c9944
Remove margin name from geomdist sensors.
...
PiperOrigin-RevId: 811775910
Change-Id: I4d265d4ad0206ea2d92c6c4b659f509a17f12baa
2025-09-26 05:24:12 -07:00
Yuval Tassa
681f5767b2
Remove -Wno-extra-semi, add workaround for mjSORT confusing some IDEs
...
PiperOrigin-RevId: 808689636
Change-Id: Ia091fb597c171a33842e62690d06f32614fbe4eb
2025-09-18 12:28:09 -07:00
Yuval Tassa
b9900db00e
Extract memory allocation functions and core utilities
...
PiperOrigin-RevId: 801745499
Change-Id: Iaf05c3430769d3115743d8ab020d13148cb2eb59
2025-09-01 03:38:25 -07:00
Yuval Tassa
b092563cab
Remove mjDSBL_PASSIVE, split it into mjDSBL_SPRING and mjDSBL_DAMPING.
...
PiperOrigin-RevId: 800870384
Change-Id: I273e0ceec090901e2620febb67e57914928e94bb
2025-08-29 06:06:28 -07:00
Yuval Tassa
7443e685ac
Allow contact sensor subtree1/subtree2 to be any body.
...
PiperOrigin-RevId: 799632590
Change-Id: If9cd6c5a3a5f83d89ae024a8f64232ab1f1d603a
2025-08-26 11:00:39 -07:00
Alessio Quaglino
49f45a93c8
Guard against division by zero when calculating pressure in tactile sensor.
...
PiperOrigin-RevId: 791641958
Change-Id: I457bc7f55c0b03e14b9c3944935866ede14f1d51
2025-08-06 05:07:12 -07:00
Alessio Quaglino
51babec9c5
Move tactile sensor to the engine.
...
PiperOrigin-RevId: 788863133
Change-Id: I3172ebb7641fa8146469da25cba7db794760e7b1
2025-07-30 05:27:44 -07:00
Yuval Tassa
576a34bcf2
Add netforce reduction to contact sensor.
...
PiperOrigin-RevId: 783020713
Change-Id: I0d11ccc4e1fd16d07e6f116d64a26485346d9cf1
2025-07-14 13:27:43 -07:00
Yuval Tassa
d0e4771c8c
Add contact sensor.
...
PiperOrigin-RevId: 783011982
Change-Id: Ica56fe9d520fa1d1ee7338e09148b1a55a049912
2025-07-14 13:03:35 -07:00
Yuval Tassa
e6c5715903
Add insidesite sensor for detecting when an object is inside the volume of a site.
...
PiperOrigin-RevId: 780993257
Change-Id: I2dcfc840d222680adc3b934344a0819f4d78b6eb
2025-07-09 04:56:42 -07:00
Taylor Howell
9accc7ae51
Update mj_energyPos.
...
PiperOrigin-RevId: 757678945
Change-Id: If236b9e8f376a2673abc87e818326e9188f6c15a
2025-05-12 03:14:43 -07:00
Taylor Howell
b0b2c48190
Update comment in mj_energyPos.
...
PiperOrigin-RevId: 757670899
Change-Id: I3827089f4298b3800c20ed64ca0ccfcf3ed83d92
2025-05-12 02:45:45 -07:00
Taylor Howell
96dda6ea75
Add tendon actuator force limits and tendon actuator force sensor.
...
PiperOrigin-RevId: 745096883
Change-Id: Ib9acb727fbbfc6b0b0323ee6a889053a7a878056
2025-04-08 05:16:35 -07:00
Yuval Tassa
240a7afdee
Add sensors for potential and kinetic energy.
...
PiperOrigin-RevId: 716775375
Change-Id: Ic8ab7f1a51df970ab551dabe7c797cde13cd97fd
2025-01-17 13:10:12 -08:00
Yuval Tassa
2691887500
Add engine-internal convenience macro for allocating typed arrays, improve error message.
...
PiperOrigin-RevId: 705126655
Change-Id: I2bd8fada6d33a919d2fb82297f93ac57958355a4
2024-12-11 09:04:44 -08:00
Taylor Howell
78ade58aff
Remove rootid from touch sensor (unused).
...
PiperOrigin-RevId: 685196948
Change-Id: Ifd574165717f07a58a13ae187bc1c63527c986e7
2024-10-12 08:10:09 -07:00
Yuval Tassa
e4d4153352
Move sanitizer instrumentation to a separate header file. Fixes #2049 .
...
PiperOrigin-RevId: 672986547
Change-Id: I42522f4925237a73168e965364a2dd65c0f067cb
2024-09-10 09:05:35 -07:00
Yuval Tassa
4d4b0bb2c3
Don't normalize mjData->qpos quaternions in-place.
...
PiperOrigin-RevId: 647927542
Change-Id: I13b0be55498d1da3af2cdc414cfed4c3908a6fe1
2024-06-29 03:07:10 -07:00
Yuval Tassa
6067048537
Deprecate mju_rotVecMat and mju_rotVecMatT in favor of mju_mulMatVec3 and mju_mulMatTVec3.
...
These functions names and argument ordering are more consistent with the rest of the API.
PiperOrigin-RevId: 643788290
Change-Id: I783eda8021b80b82098e23ed95669b102bb82508
2024-06-16 10:02: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
Yuval Tassa
5d26b50fce
Remove native sensor noise sampling.
...
PiperOrigin-RevId: 620075316
Change-Id: I6a0a1d63834e7c8bfd290f89d86fea791d794739
2024-03-28 15:33:03 -07:00
Yuval Tassa
a6687885a5
In mj_sensorAcc, flip condition for triggering call to mj_rnePostConstraint to enumerate sensors that require the call rather than eliminating those that do not.
...
PiperOrigin-RevId: 579804886
Change-Id: I1093fcfa66e637015cd702d7e59ec3bcddc670ef
2023-11-06 04:51:53 -08:00
Alessio Quaglino
01a932e052
Fix flex constraint Jacobian for edges belonging to a single body.
...
PiperOrigin-RevId: 575161094
Change-Id: If4153bcb751cdd6dbdddeb08672f7107c7c5bbc2
2023-10-20 02:49:34 -07:00
Alessio Quaglino
110ade1435
Update Solid and Shell plugins to use FlexComp.
...
PiperOrigin-RevId: 573755821
Change-Id: I3b8d7fb27f0e940038fa9fd2b26ecc746df4f7ac
2023-10-16 03:03:06 -07:00
Yuval Tassa
a9ee497e33
Add spaces around comparison operators.
...
PiperOrigin-RevId: 573620198
Change-Id: Icf295cc0dd381a4a7f0e2c94f2e12b499193e862
2023-10-15 07:40:10 -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
Yuval Tassa
dfd48dd821
Replace mjMIN and mjMAX with mju_min and mju_max, where possible.
...
PiperOrigin-RevId: 566602924
Change-Id: I2d24183d0d9df3e647bb2d7d7544473582f38128
2023-09-19 05:40:41 -07:00
Alessio Quaglino
b0abafe3bb
Set camera origin at top-left of the first pixel.
...
PiperOrigin-RevId: 564768176
Change-Id: Ieef632f0f6888390acca91b6de01c8951c747fe4
2023-09-12 10:44:51 -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
Saran Tunyasuvunakool
4929077211
Remove mjMARKSTACK and mjFREESTACK macros.
...
PiperOrigin-RevId: 562844184
Change-Id: Id2f57f5d132c47094dad75c6dab7297d7aa73458
2023-09-05 11:41:43 -07:00
Saran Tunyasuvunakool
0e36f00857
Fix more mjData stack leakages.
...
PiperOrigin-RevId: 562545230
Change-Id: I2facf25b00878669dc12d5865767a44229d2ca48
2023-09-04 06:38:50 -07:00
Saran Tunyasuvunakool
b979a26b10
Rename mj_stackAlloc to mj_stackAllocNum.
...
PiperOrigin-RevId: 561040193
Change-Id: I49ea21ffb5b596471d2aacefb1961c11c5c905d0
2023-08-29 08:43:03 -07:00