This is required to have parent body info during attach and during body to frame tranformation for uncompiled models.
PiperOrigin-RevId: 703038426
Change-Id: Ib482059ba419a020860c649d6ea1b1088045f2e1
Also associate all children that need a parent body to the parent of the deleted body.
This is a bug that was causing the former children of the body that gets transformed to a frame to not be children of the new frame.
PiperOrigin-RevId: 702702853
Change-Id: I36d48f0446bc87c665b18d34e0b0609d82c70f51
Spec were copied after bodies are attached, so the reference to the source spec got lost during mj_copySpec().
PiperOrigin-RevId: 701287267
Change-Id: I55eff53c7ae9d42b03957be48ea506b80d274e03
Also, fix a bug with Flex textures that was causing an incorrect allocation of the textures in mjModel. Fixes#2013.
PiperOrigin-RevId: 692510858
Change-Id: If781716216974e085244da27bc3aa57d91c3458c
`flex_xvert0` stored the Cartesian position of the vertices in `qpos0`. This array was unused, so it is now replaced with `flex_vert0`, which still contains the positions of the vertices, but normalized on the bounding box of the flex so that the coordinates are in `[0,1]^m->flex_dim`. This will be useful in the future for using different interpolation methods for computing flex deformations.
PiperOrigin-RevId: 691779361
Change-Id: I5c4223103cd4558f4e268fe3e8d8177541e4754f
This allows to resize parent keyframes also when the child has no keyframes.
PiperOrigin-RevId: 691045299
Change-Id: I3ab6509b13b5754e937ec77daf9efe697cabf1bc
Note:
- Move compiler options into `mjsCompiler` struct.
- The compiler options from the attached model are not written by mj_SaveXML.
PiperOrigin-RevId: 689391440
Change-Id: I1d63c146a32f87c737b7a55b64a54b0ffe3aecc9
The qposadr_ and dofadr_ variables of the joints were not being reset to -1 when a joint is copied. This could lead to errors when calling mj_recompile after attaching a compiled spec.
PiperOrigin-RevId: 686152004
Change-Id: I9e058089ce87ea0d8e51a7f43475bc48c6527a26
The `extension` section used to discard the plugin name and write the instance name in `plugin.name`, while all of the other sections wrote the instance name in `plugin.instance_name` and optionally the plugin name in `plugin.name` (via the function `OnePlugin`). Now all plugin names are in `plugin.plugin_name` and the instance is written in `plugin.name`, so that it is possible to lookup a plugin via its unique instance name.
PiperOrigin-RevId: 683183804
Change-Id: I179ef5d221143b720db24d745b09e327bf1449ef
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
Before this CL, the same mjCPlugin objects were referenced by both models.
Fixes#2100.
PiperOrigin-RevId: 680579479
Change-Id: Ida3459f78f9fa4a942cea31b3d5d3e8da2832feb
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
- Add errors in body compiler for incorrect mixing of specifiers.
- Correctly process inertia orientation specifiers.
PiperOrigin-RevId: 676843326
Change-Id: I7e7eb22e25a6769754794f98fad5e0dcc0e5946f
This enables to preserve the paths of the child spec during `attach`.
PiperOrigin-RevId: 673349237
Change-Id: Ibf075c7ec037ff5d540bc60d6e77c12f60269791