Commit Graph

253 Commits

Author SHA1 Message Date
Yuval Tassa fdbbc8bbe0 Allow in-place computation for mju_mulQuat and mju_mulQuatAxis
PiperOrigin-RevId: 471222168
Change-Id: If43210636cf20000b343ad1efd02836465380ebe
2022-08-31 04:09:08 -07:00
DeepMind 366e1c53d4 Clarify docs on MJCF format comparison to inline CSS.
PiperOrigin-RevId: 471009039
Change-Id: I79704fd7939daef50918e5093b092f144436a47d
2022-08-30 09:11:01 -07:00
Yuval Tassa eb65273fa1 Add test for rotational Jacobian formula used in weld constraints
PiperOrigin-RevId: 470947389
Change-Id: I39b9495e3e6d6cf8994e603d6eb69e3e5322e734
2022-08-30 03:42:55 -07:00
Nimrod Gileadi 6b6fff69ba Make URDF parser stricter about required attributes.
Following the spec at http://wiki.ros.org/urdf/XML

PiperOrigin-RevId: 470192022
Change-Id: I4699b6f87fff5706b3ba5f33bb8242bb2ad33478
2022-08-26 02:08:39 -07:00
Saran Tunyasuvunakool 9d9493153c Fix GCC "declaration of ... changes meaning" errors.
PiperOrigin-RevId: 470175500
Change-Id: If13a81f308f803d3cc4731b3d4d0561cfe56d5c8
2022-08-26 00:13:57 -07:00
Saran Tunyasuvunakool 3240596c3a Call GLFW functions via a dynamic dispatch table.
This allows us to use GLFW without needing to introduce a link-time dependency on the library, which in turn enables us to get GLFW through Python.

PiperOrigin-RevId: 470100999
Change-Id: I27c84ad3310afdbebd582ab0033b6a963ba6307e
2022-08-25 15:41:53 -07:00
Alessio Quaglino d26501c0f3 Add two new attributes to weld constraints:
- `anchor` determines the point of wrench application, in the frame of body2.
- `tfratio` scales applied torques relative to applied forces.
- Add visualisation of both anchor points to both weld and connect constraints.
- Add a test model showing how the new weld parameters behave.

PiperOrigin-RevId: 470021901
Change-Id: I3faba0e5dcab2e29ee81096f5ff71ff66d99758c
2022-08-25 10:22:15 -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
Yuval Tassa c7e36e9350 Fix typo.
PiperOrigin-RevId: 469880250
Change-Id: I4d7d61ced696bb5dcbaafc9c49188d8a61a20ae5
2022-08-24 19:04:32 -07:00
Kevin Zakka a90803d643 "exactmeshinertia" is now only saved if its value is different than default.
PiperOrigin-RevId: 469848032
Change-Id: I9abdeccbf764f5e4267753c0e2bfdd42b3bec723
2022-08-24 16:08:55 -07:00
Yuval Tassa 62b185bd52 Fix indentation in the changelog.
PiperOrigin-RevId: 469825941
Change-Id: Ica8a9561a58c33816633266e51bc85ef1b827974
2022-08-24 14:35:19 -07:00
Nimrod Gileadi 00fcd10b20 Don't use user input as a format string in mjCError.
PiperOrigin-RevId: 469686222
Change-Id: Icb05df04f11387847aa8d66dcf1b63da9c470b9f
2022-08-24 03:54:34 -07:00
Yuval Tassa 090fe2db3f Add a disable flag for sensors.
PiperOrigin-RevId: 469473066
Change-Id: I296ed790c6261c4fb15b349540edcb77e53e0567
2022-08-23 09:02:56 -07:00
Alessio Quaglino 83ce236479 Process meshes for computing the correct scaling even when they have flipped faces.
PiperOrigin-RevId: 469414367
Change-Id: Ia5c75b4f2c9fd592c81a1ec659720f9820c0dfbb
2022-08-23 03:29:40 -07:00
Alessio Quaglino abc0a39b7a Add two new attributes to weld constraints:
- `anchor` determines the point of wrench application, in the frame of body2.
- `tfratio` scales applied torques relative to applied forces.
- Add visualisation of both anchor points to both weld and connect constraints.
- Add a test model showing how the new weld parameters behave.

PiperOrigin-RevId: 469228149
Change-Id: I836b0791f10fb624607a12ef3c687da991c21789
2022-08-22 10:46:46 -07:00
Yuval Tassa 558aaf2923 Tighter bound for triggering invalid condim in mj_collideGeoms.
PiperOrigin-RevId: 469210244
Change-Id: I349de59aac7ba1bc80df322f667fa9afc87d4b1f
2022-08-22 09:50:42 -07:00
Alessio Quaglino 8ca5887c20 Add two new attributes to weld constraints:
- `anchor` determines the point of wrench application, in the frame of body2.
- `tfratio` scales applied torques relative to applied forces.
- Add visualisation of both anchor points to both weld and connect constraints.
- Add a test model showing how the new weld parameters behave.

PiperOrigin-RevId: 469190483
Change-Id: I20f6da85b09cd2c4c0b5d29eb8003eabb524e55e
2022-08-22 08:19:22 -07:00
Yuval Tassa f16a6e513d Remove unused ranges in a test model.
PiperOrigin-RevId: 469168585
Change-Id: I50ac9af0e00743f538fe6d42b5c1ac292f4b6e37
2022-08-22 06:31:17 -07:00
Kevin Zakka 0b2f19bbe7 Fix "actrange" parsing for "intvelocity" actuators.
PiperOrigin-RevId: 468759706
Change-Id: I1d9eeb723d28cccb64a6112b103345fcf451700f
2022-08-19 12:22:55 -07:00
Kevin Zakka ee6fed1230 Add minor enhancements to compile binary.
* If output file exists, ask user whether to overwrite
* Fix erroneous check for whether XML file was successfully saved

PiperOrigin-RevId: 468743682
Change-Id: I06058c498328d333792e4b40d65c3a99ca1842e4
2022-08-19 11:15:19 -07:00
Yuval Tassa 7b7cf0c27a Add mjd_transitionFD to Python bindings.
PiperOrigin-RevId: 468731887
Change-Id: I2152e10bc0f50a6c6a6b6832b1e7ef7c413976f7
2022-08-19 10:27:40 -07:00
Yuval Tassa ae0ac86ec3 Add catenary visualisation to string-like tendons.
https://youtu.be/I2q7D0Vda-A

PiperOrigin-RevId: 468687422
Change-Id: I84f34e149cf098346a77a51f265113d8fa4f2525
2022-08-19 06:25:07 -07:00
Saran Tunyasuvunakool 7bd686cd87 Change signature of TryCompile so that *m isn't strewn across the function.
PiperOrigin-RevId: 468685571
Change-Id: I61e5b0cff29a0b1fc1a88bc088dc73f48b95c800
2022-08-19 06:12:07 -07:00
Kevin Zakka d466e390fc Add new simulate to CI.
PiperOrigin-RevId: 468670988
Change-Id: I2c6c7ac4763402f2a3e8df734746477e54a8ed8e
2022-08-19 04:17:10 -07:00
Yuval Tassa 833dc74074 Add support for excluded contacts in adhesion actuators.
- Update example model.
- Update video.

PiperOrigin-RevId: 468464196
Change-Id: I603c5a89c2d5a736de127440e6d542beffc12583
2022-08-18 08:28:11 -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 29535a8eca Fix typos.
PiperOrigin-RevId: 467656092
Change-Id: If908b58129c975a042c920ca2242f320876e4f54
2022-08-15 06:38:20 -07:00
Yuval Tassa 670b6136f9 Geoms of selected bodies respect transparency setting.
PiperOrigin-RevId: 467505247
Change-Id: I6864118e28d9c98aa1f8002583c2faeb011659ee
2022-08-14 04:34:38 -07:00
Yuval Tassa ed1ca199a7 Add weld constraint to test/testdata/model.xml
PiperOrigin-RevId: 467187914
Change-Id: I87c4788d069ad7a9fbbd1fe38276c38f56e974e0
2022-08-12 05:28:08 -07:00
Nimrod Gileadi 5dd7bf8613 Verify that body_parentid and similar properties always go up the kinematic chain.
PiperOrigin-RevId: 467063831
Change-Id: I591c6a6f78178e9c2196cc94d7e622eba93d8191
2022-08-11 15:27:10 -07:00
Yuval Tassa c8ff7b3d34 Remove distance constraints.
- `distance` constraints were not very useful and increased the contact buffer within the constraint solver, violating a core design principle. Therefore they have been removed.
- The enum value `mjEQ_DISTANCE` is retained, but errors will be thrown in the parser and engine if these constraints are selected.

PiperOrigin-RevId: 467050101
Change-Id: Ie72a07e4fe338eea5107004a9fc0f5e47eb0c3b7
2022-08-11 14:31:11 -07:00
Copybara-Service 396fdf00c3 Merge pull request #425 from aftersomemath:cull-face-flag
PiperOrigin-RevId: 466904386
Change-Id: Icd5515c2bbb8f8f3417501ea43c8e5ae22b32f91
2022-08-11 02:44:37 -07:00
Nimrod Gileadi 01c297cddd Validate that fields like mjModel.body_jntnum don't contain negative values.
PiperOrigin-RevId: 466733848
Change-Id: I0b1f41fa8841c678307f2185aac4c46a2fd40396
2022-08-10 10:57:36 -07:00
Saran Tunyasuvunakool e3ded23c66 Fix memory leak in mjCModel::Compile.
This is a very subtle leak caused interaction between longjmp and compiler optimisation. Specifically, at the point where the setjmp takes places, these pointers have never been reassigned from its nullptr initialization. Without the volatile keyword, the compiler is free to assume that these pointers remain nullptr when the setjmp returns, and therefore to pass nullptr directly to the mj_deleteModel and mj_deleteData calls in the subsequent catch block, without ever reading the actual pointer values.

PiperOrigin-RevId: 466649447
Change-Id: I51e82ec8b566deb144221e11a99d5124a8267de4
2022-08-10 05:11:53 -07:00
Saran Tunyasuvunakool c2aff3a9f2 Fix memory leak and possibly use-after-free in user_mesh.cc.
The memory handling in the asset loading logic in user_mesh.cc is currently flipped: it frees the asset content buffer when reading from VFS but not from the filesystem. This causes the VFS object to leave these functions in an invalid state, while leaking locally allocated buffers that hold contents read from the filesystem.

PiperOrigin-RevId: 466643390
Change-Id: I162221e019861f23fb61308facd63dbb0422e113
2022-08-10 04:40:11 -07:00
Yuval Tassa d6e46bda50 Add missing braces.
PiperOrigin-RevId: 466576293
Change-Id: Ifea04abeed531befac6ab335bb66b1f1ce0f10a6
2022-08-09 22:53:13 -07:00
Alessio Quaglino 95d5db3f81 Allow malformed meshes for visualization purposes. Throw error only if the mesh is required for inertia computation.
PiperOrigin-RevId: 466421062
Change-Id: I947dbc107e481bd8c328b1a6430ab2e88bc82fd6
2022-08-09 11:41:29 -07:00
Saran Tunyasuvunakool aee73a9023 Fix memory leaks in mj_makeData and mj_makeModel.
Currently, if these functions fail to allocate space for the buffer or stack, it will exit without freeing any of the memory successfully allocated so far.

PiperOrigin-RevId: 466271030
Change-Id: Id01c115ec976482ac5d28c373b5eb47d77f424be
2022-08-09 00:42:17 -07:00
Yuval Tassa 1e41bf5076 Improve <statistic meansize/> documentation.
PiperOrigin-RevId: 466002484
Change-Id: I83edfa4f49e0129c85a2558ecc7bbdef8725ff13
2022-08-08 03:48:21 -07:00
Yuval Tassa 50976a2a1f Move separator to correct location.
PiperOrigin-RevId: 465885126
Change-Id: I7cb8854461cccf56e4f07ec7ae284a102928f9ee
2022-08-07 09:29:52 -07:00
Kevin Zakka e96776c901 Add documentation badge to README.
PiperOrigin-RevId: 465791060
Change-Id: I7d1266bea1b4d59f6ff7f112f35f14f2a62282b1
2022-08-06 13:58:03 -07:00
Yuval Tassa 83b30a6210 Correct mention of the implicit integrator in viscosity documentation.
PiperOrigin-RevId: 465763354
Change-Id: I605165c536de294c6d0981524d7dfab566da55aa
2022-08-06 07:54:10 -07:00
Yuval Tassa 4d24d56c64 Fix simulate window title.
PiperOrigin-RevId: 465763279
Change-Id: I21405891071ae151c057c40725be645fc28cd748
2022-08-06 07:53:11 -07:00
Kevin Zakka a6841120f8 Mention the new Implicit-in-velocity Euler integrator in the XML reference.
#mujoco

PiperOrigin-RevId: 465754132
Change-Id: If1578afe00a69bfa6816d8e18d5fdc9296a69dc4
2022-08-06 05:44:34 -07:00
Copybara-Service 9cd1c2f726 Merge pull request #428 from aftersomemath:segmentation-doc-fix
PiperOrigin-RevId: 465644599
Change-Id: I5f3c0ef5d52935906e73035c371345f936e062ea
2022-08-05 14:11:08 -07:00
Kevin Zakka 80b4ffdd6a Add screenshot button to simulate.
PiperOrigin-RevId: 465628684
Change-Id: I0eb86d6b18c25bb437f197229be6d1c57ccbc50a
2022-08-05 12:56:32 -07:00
Levi Burner 581f009c02 Cull face flag 2022-08-05 11:53:46 -04:00
Levi Burner eab1f0da7d Fix off by one in segmentation with IDCOLOR documentation 2022-08-05 11:46:22 -04:00
Nimrod Gileadi 7a0e0ed80c Use testspeed to test all sample models and all models in mujoco/test.
PiperOrigin-RevId: 465534183
Change-Id: Ic0c398d45ce3a4da5d0a2b7310439f17f0ec4162
2022-08-05 04:25:19 -07:00
Nimrod Gileadi fae896c51b Use a negative size instead of overflow in EngineIoTest.
The MSVC build on GH Actions doesn't detect overflows in mjData or mjModel sizes, so use a negative size instead to trigger an intentional failure in the test.

PiperOrigin-RevId: 465529615
Change-Id: Ic7f15eed782cdda11b29984b136ed4f625418cc8
2022-08-05 03:54:35 -07:00