Commit Graph

2295 Commits

Author SHA1 Message Date
Alessio Quaglino dfd1f8fefc Fixed a bug causing an early stop of tree traversal.
Fixes #2112.

PiperOrigin-RevId: 681804470
Change-Id: I15a6f010db1a97931438fa6d8fd1d5cda6863c32
2024-10-03 03:38:17 -07:00
Alessio Quaglino 249c4b3f4f Prevent attaching models with different eulerseq, autolimits, or angle options.
PiperOrigin-RevId: 681801855
Change-Id: Iaf107853797768270319e971a3e318db0703bca0
2024-10-03 03:27:47 -07:00
Alessio Quaglino e973dc74dd Yield ownership of char[], vector<string>, and vector<byte> to mjSpec in Python bindings.
PiperOrigin-RevId: 681522091
Change-Id: Icb3788d9ef6e914a307531e39ad8171c24f590af
2024-10-02 11:14:48 -07:00
Alessio Quaglino 36ee89d6da Copy only referenced plugins.
Fixes #2111.

PiperOrigin-RevId: 681486400
Change-Id: I384ac63fa76b27d6e84d91fa857127c42ff52e34
2024-10-02 09:40:48 -07:00
Baruch Tabanpour 1a9d307042 Use mocap pos/quat in smooth.kinematics.
PiperOrigin-RevId: 681136974
Change-Id: I0ece009ed1e68b61b0b96da2e685e86000f7f6b8
2024-10-01 13:12:33 -07:00
Google DeepMind befe4af8f0 Add missing includes necessary after changes in libc++ headers.
Tested:
    TAP train for global presubmit queue
    http://test/OCL:680649491:BASE:680620735:1727746506750:fa29d104
PiperOrigin-RevId: 681090682
Change-Id: I3346ed996d9b6cd0fc7d600c02c41e0cd1b72400
2024-10-01 11:08:01 -07:00
Alessio Quaglino dfe8e45101 Namespace plugin instances when attaching.
Fixes #2112.

PiperOrigin-RevId: 681045462
Change-Id: I2c945c5405fcb91e0f9a1b0b1e94f68d174c84ee
2024-10-01 09:14:37 -07:00
Alessio Quaglino 89aea5e217 Add body.find_all() to Python bindings.
This enables to generate a list of all body children of a given type.

Also, add recursive option to mjs_firstChild and mjs_nextChild. Fixes #2112.

PiperOrigin-RevId: 681039348
Change-Id: Iebbb26fd5ec314150206edfdddd88633baa0bec6
2024-10-01 08:57:25 -07:00
Alessio Quaglino 8a825e6050 Add auto-generated tree element lists to Python bindings.
PiperOrigin-RevId: 680973047
Change-Id: I948151260cba330c6b7218cecf13aae2c7ae92c7
2024-10-01 05:23:03 -07:00
Yuval Tassa 62ec802ec1 Tweaks to benchmarks.
- Modify parse_benchmark_test to not time the first instance of file loading.
- Improve readability of step_benchmark_test.

PiperOrigin-RevId: 680953562
Change-Id: I4569d1b946ecb49b6590ea313f0b598ffc897888
2024-10-01 04:08:40 -07:00
Baruch Tabanpour cb745db412 Ensure ten_wrapnum/wrapadr are int type.
PiperOrigin-RevId: 680709773
Change-Id: Iebc0c796e66e657b8bebcc5fe4b2d347d9bdf42c
2024-09-30 14:02:48 -07:00
Alessio Quaglino 6832df3091 Replace mjs_setActivePlugins with mjs_activatePlugin.
PiperOrigin-RevId: 680613007
Change-Id: Ic03e0dc42a1f5f083e313672bc6e3ccebadc58b3
2024-09-30 09:46:47 -07:00
Yuval Tassa cf13413c0b Clean up dual solver functions.
PiperOrigin-RevId: 680587029
Change-Id: I20c78e96785af94634361d7823b1e5caba08800d
2024-09-30 08:31:40 -07:00
Alessio Quaglino e6e6e3b51b Copy plugins when attaching a model.
Before this CL, the same mjCPlugin objects were referenced by both models.

Fixes #2100.

PiperOrigin-RevId: 680579479
Change-Id: Ida3459f78f9fa4a942cea31b3d5d3e8da2832feb
2024-09-30 08:08:12 -07:00
Kyle Bayes 43a82e08be Add benchmark test for collisions.
PiperOrigin-RevId: 680554813
Change-Id: I0be5b102d68aa1a54b4ceca6b2bd24fbc519f5df
2024-09-30 06:46:25 -07:00
Alessio Quaglino 40b2ae92e5 Reset pending keyframes in source model after attaching.
Fixes #2101.

PiperOrigin-RevId: 680526395
Change-Id: I3bd06db5231d653b1c5bc1c2ba6b03b52e65f288
2024-09-30 05:05:21 -07:00
Alessio Quaglino 58a49bad96 Add nested keyframes attachment test.
This is a no-op change for keyframes but it shows an example of behavior.

Also, fixed two bugs:
- Missing namespace when attaching frames.
- Incorrect body id and subtreedof when attaching a compiled spec. Fixes #2063.

PiperOrigin-RevId: 680289467
Change-Id: I2ddaa7ad2226fa466ec3bbf74a7553d497bb4bb9
2024-09-29 11:57:56 -07:00
Copybara-Service 807ee852d0 Merge pull request #2097 from emotodorov:ui
PiperOrigin-RevId: 679704368
Change-Id: Iae396a134e6019c8cdb935a306f097f9427e134c
2024-09-27 13:16:01 -07:00
Alessio Quaglino 25e4d75a07 Return attached body/frame in mjs_attachBody/Frame.
PiperOrigin-RevId: 679601525
Change-Id: Icdc4616808e14bf0a3ebc17d89392382d084c31b
2024-09-27 08:34:00 -07:00
Yuval Tassa 176345b4e1 Remove meaningless const qualifier for scalar arguments in sparse function signatures.
PiperOrigin-RevId: 679568516
Change-Id: I910626cd9555966c3b0a9ffba4064d263b2c16e1
2024-09-27 06:37:18 -07:00
Taylor Howell 6a6e10d779 Add mju_cholFactorNNZ to compute the number of non-zeros per row for sparse Cholesky factorization.
PiperOrigin-RevId: 679553197
Change-Id: I6f92deec347dae97d2e219cfb5376f92e777da1a
2024-09-27 05:39:08 -07:00
Alessio Quaglino bb6da503dc Make 3 the default number of channels in mjsTexture.
PiperOrigin-RevId: 679521155
Change-Id: Ie6c962e75983c8bf8323170338b3d480be3a1117
2024-09-27 03:33:04 -07:00
Emo Todorov a985faef51 section checkbox highligting 2024-09-26 22:22:02 -04:00
Alessio Quaglino 6a415da267 Make from_file() and from_string() classmethod functions.
This prevents the user from modifying an mjSpec and then calling the functions to load it from string/file.

PiperOrigin-RevId: 679311284
Change-Id: I4f1ae3cc8f15bece245f624303470d538deec410
2024-09-26 15:16:10 -07:00
Yuval Tassa 8bbf9c7b4f Rename config.yaml -> config.yml.
PiperOrigin-RevId: 679225889
Change-Id: I2e3d26dbd763485c34880d287511f2810886422b
2024-09-26 11:26:12 -07:00
Nimrod Gileadi d758349632 Correct the docs about available attributes on the default/mesh tag.
PiperOrigin-RevId: 679125186
Change-Id: I5cd597ac12b0600a835cdd23bda69c9aae4f651f
2024-09-26 06:31:27 -07:00
Nimrod Gileadi 86ea1e498c Update pillow dependency used in tests to 10.3.0.
PiperOrigin-RevId: 679114607
Change-Id: I5729d5ce1baff02cdf1caa8124ef46b2b17b85b5
2024-09-26 05:53:41 -07:00
Taylor Howell 30cd8cc0e2 Add keyword argument example to code block in model editing section of the documentation.
PiperOrigin-RevId: 678643644
Change-Id: Ie1d5659f01cc882628a669e7be22eff975a888fc
2024-09-25 04:34:03 -07:00
Alessio Quaglino 1eb6fc2285 Disallow using elasticity and edge constraints at the same time.
Fixes #2084.

PiperOrigin-RevId: 678614880
Change-Id: I44eead3dc4edf82d725a3063b927a421c660721a
2024-09-25 02:56:20 -07:00
Erik Frey 2785dbc0da Add tendon types to MJX name2id and id2name.
PiperOrigin-RevId: 678424789
Change-Id: I2634be0810f8f7dafec597919c512752d2efcfa6
2024-09-24 15:46:33 -07:00
Baruch Tabanpour 306e52c30f internal change.
PiperOrigin-RevId: 678355240
Change-Id: I271bece139de5d6e2e629d7f2fe84a4e2dd71138
2024-09-24 12:37:58 -07:00
Alessio Quaglino f0d52813b8 Copy joint state to the modified mjSpec when detaching bodies.
Fixes #2085.

PiperOrigin-RevId: 678351210
Change-Id: I2a546877dd50abc7805099f8d5c40807ffe780e6
2024-09-24 12:26:29 -07:00
Baruch Tabanpour b09c1a977e Add jit flag to viewer (easier debugging). Make convex.xml stable.
PiperOrigin-RevId: 678312872
Change-Id: I0d65d7c2d05a7b5103fa0be2233cbc5ba232817c
2024-09-24 10:49:34 -07:00
Alessio Quaglino 5bca7876c4 Update spec.from_string() and spec.from_file() to match the respective mjModel functions.
PiperOrigin-RevId: 678230403
Change-Id: I7f3d8c5fd44d30b5695eee1f8513cc27f4158d94
2024-09-24 06:57:20 -07:00
Copybara-Service 910cd89cc7 Merge pull request #2083 from jjyyxx:patch-1
PiperOrigin-RevId: 678207225
Change-Id: I440823d00faa119bbd948351f38e3774c6fa37a6
2024-09-24 05:42:17 -07:00
Yuxuan Jiang 55962538c4 Fix typo in programming documentation 2024-09-24 15:33:27 +08:00
Baruch Tabanpour 3a17be2d24 Add pause key to MJX viewer.
PiperOrigin-RevId: 677959701
Change-Id: I7f816eb6bf702461f0d749b2aa6cd1664c258f3d
2024-09-23 15:23:13 -07:00
Erik Frey 5838f84777 Fix bug where MJX data tendon fields are incorrect after calling put_data.
PiperOrigin-RevId: 677911639
Change-Id: I75f536fa348e2941d9ec2d454f475cd067e6d3af
2024-09-23 13:12:49 -07:00
Yuval Tassa 5219893813 Replace mjQUICKSORT with std::stable_sort in user_mesh.cc
PiperOrigin-RevId: 677864209
Change-Id: I1cca8e1ae8c84e652b12c24cfddfbca97d8c6841
2024-09-23 11:06:46 -07:00
Google DeepMind bbe8a0c516 Strip weak_types in mjx.put_model.
PiperOrigin-RevId: 677859138
Change-Id: I9ef010c0c37d04f9931adf884ab1dce0521b8567
2024-09-23 10:54:53 -07:00
Yuval Tassa 84e0e2839d Improve error message when requested stack allocation is larger than 2^64 bytes.
PiperOrigin-RevId: 677851110
Change-Id: Iaef92f7f48f41f3a4bfaae9c517ff6664afed039
2024-09-23 10:34:33 -07:00
Taylor Howell 76b48b8e61 Add site semantics to weld constraint in MJX.
PiperOrigin-RevId: 677823461
Change-Id: Iab20e042695dfad416d61fa7cc938faba8c7a6b6
2024-09-23 09:25:08 -07:00
Kyle Bayes 04f8403d8e Add unit tests for NativeCCD to produce better test coverage.
PiperOrigin-RevId: 677793306
Change-Id: I435865f00553c74d1d0c0fa86d9c41fb1e5497ff
2024-09-23 07:55:39 -07:00
Alessio Quaglino b5bcc91a03 Add bindings generation for mjOption, mjVisual, and mjStatistic.
Fixes #2076.

PiperOrigin-RevId: 677789263
Change-Id: Ie1bda40af62c5ac9bbba541668a50adfc59d3f7c
2024-09-23 07:43:09 -07:00
Yuval Tassa 41ea95f077 Add a section for element casting in the function API reference, move these functions to the end.
PiperOrigin-RevId: 677783917
Change-Id: I5042e7df20f2a2e0ecfe01a85a1969ccfc2307cd
2024-09-23 07:26:01 -07:00
Alessio Quaglino 0ba11b9623 Add plugins list to mjSpec Python API.
Fixes #2061.

PiperOrigin-RevId: 677762985
Change-Id: I8e407373e7b505d9b0f1c023e97c5ea92169bbf6
2024-09-23 06:13:42 -07:00
Yuval Tassa 91cedfd65c Avoid square roots in barycentric coordinate computation.
Also add some `inline` qualifiers.

PiperOrigin-RevId: 676873457
Change-Id: I76f57dc870a8714bd86749a7dee1f10fc5e4be1c
2024-09-20 09:37:40 -07:00
Taylor Howell ab3954d892 Set actuator_force in MJX. Fixes #2068.
PiperOrigin-RevId: 676867005
Change-Id: I80514a050ff40cb6d43a95b74c4a36c4991db588
2024-09-20 09:16:55 -07:00
Yuval Tassa 50f43b8745 Fix various issues with body inertial parsing and compiling.
- Add errors in body compiler for incorrect mixing of specifiers.
- Correctly process inertia orientation specifiers.

PiperOrigin-RevId: 676843326
Change-Id: I7e7eb22e25a6769754794f98fad5e0dcc0e5946f
2024-09-20 07:53:42 -07:00
Yuval Tassa 78832db53f Use designated initializers for mjCCDObj.
PiperOrigin-RevId: 676794693
Change-Id: Ie8a35415232e8a9f619713763c5d5a37a6f82935
2024-09-20 04:32:10 -07:00