Commit Graph

10 Commits

Author SHA1 Message Date
Alessio Quaglino 505d01a1c1 Add error handling to mj_recompile.
This CL adds error handling to the mj_recompile function. If the recompile fails, the function will return -1 and set the error message in the spec. The Python wrapper for mj_recompile will catch the error and raise a ValueError exception.

PiperOrigin-RevId: 666784579
Change-Id: I225eca1769ea839c782be3c03fc4ff1ea5885a48
2024-08-23 07:18:28 -07:00
Alessio Quaglino e0e134ca63 Add plugin tests for mjSpec.
Fixes #1903.

PiperOrigin-RevId: 663352920
Change-Id: I3a9e17aec5694e49c20b542f4b0a4402f88a2f17
2024-08-15 10:19:53 -07:00
Alessio Quaglino b341bd391d Fix a bug with mjs_delete functions.
PiperOrigin-RevId: 657615906
Change-Id: Ic70eaa9a5c20337db3897cf882a60e9d94f2869b
2024-07-30 09:13:57 -07:00
Alessio Quaglino 70ac76bb4b Add assets to MjSpec.compile()
PiperOrigin-RevId: 653965318
Change-Id: Ib9ec1c70a7241f7ee547b799a08cc58e7d4bace7
2024-07-19 04:34:38 -07:00
Alessio Quaglino 5d51b4cd5f Check that element is a nullptr before casting.
The bug was caused by the fact that the `mjs_as*` functions would return a pointer to a `mjC*` object, even if the input `mjsElement` pointer was null. This would cause a segfault.

PiperOrigin-RevId: 651802736
Change-Id: Ibec00d269a4befadff8a68e0513fd381c7e38a2a
2024-07-12 09:46:16 -07:00
Yuval Tassa 9d0812911c Add a test for type attribute.
PiperOrigin-RevId: 649635359
Change-Id: Ibe5d9fcb5f14371e5f154d645b838a9d012331d5
2024-07-05 06:16:46 -07:00
Yuval Tassa 118b6810b3 Make "id" a property rather than a method of mjsElements in Python bindings.
PiperOrigin-RevId: 649424035
Change-Id: I8226b3040aa2001ae9748399257e36ac263b7c8b
2024-07-04 08:35:37 -07:00
Alessio Quaglino a0945e4b5a Add non-tree element lists to python bindings.
Fixes #1752.

PiperOrigin-RevId: 649405039
Change-Id: Ie0b575a3ec912b773141694397ac2f394bff1227
2024-07-04 07:24:02 -07:00
Yuval Tassa 8f16b72f44 Rename mjSpec.euler to eulerseq to match MJCF.
PiperOrigin-RevId: 649007737
Change-Id: Iedb53c1d8a6e6a082a6ba30a1fb2bb4516839fa1
2024-07-03 03:10:02 -07:00
Alessio Quaglino 9106f40e2b Add mjSpec bindings.
Co-authored-by: Saran Tunyasuvunakool <stunya@google.com>
PiperOrigin-RevId: 648444641
Change-Id: I08ee1d3f4fae1efbc7934ba94702b1c06d8cb92a
2024-07-01 12:05:50 -07:00