Add mjs_findElement() to find any element in a spec by name.

Also, remove mjs_findMesh() and mjs_findKeyframe().

PiperOrigin-RevId: 670978980
Change-Id: Id88b800eb8a4c5efc40866f72a4442bf1d1437d0
This commit is contained in:
Alessio Quaglino
2024-09-04 08:23:18 -07:00
committed by Copybara-Service
parent 0e8c0b80eb
commit d3dfa6f970
13 changed files with 149 additions and 156 deletions
+10 -19
View File
@@ -4123,7 +4123,16 @@ mjs_findBody
.. mujoco-include:: mjs_findBody
Find body in model by name.
Find body in spec by name.
.. _mjs_findElement:
mjs_findElement
~~~~~~~~~~~~~~~
.. mujoco-include:: mjs_findElement
Find element in spec by name.
.. _mjs_findChild:
@@ -4134,15 +4143,6 @@ mjs_findChild
Find child body by name.
.. _mjs_findMesh:
mjs_findMesh
~~~~~~~~~~~~
.. mujoco-include:: mjs_findMesh
Find mesh by name.
.. _mjs_findFrame:
mjs_findFrame
@@ -4152,15 +4152,6 @@ mjs_findFrame
Find frame by name.
.. _mjs_findKeyframe:
mjs_findKeyframe
~~~~~~~~~~~~~~~~
.. mujoco-include:: mjs_findKeyframe
Find keyframe by name.
.. _mjs_getDefault:
mjs_getDefault
+2
View File
@@ -15,6 +15,8 @@ General
:ref:`ccd_tolerance<option-ccd_tolerance>` and :ref:`ccd_iterations<option-ccd_iterations>`, both in XML and in
the :ref:`mjOption` struct. This is because the new convex collision detection pipeline (see below) does not use
the MPR algorithm. The semantics of these options remain identical.
- The functions ``mjs_findMesh`` and ``mjs_findKeyframe`` were replaced by ``mjs_findElement``, which allows to look
for any object type.
- Added a new way of defining :ref:`connect<equality-connect>` equality constraints, using two sites rather than bodies.
The new semantic is useful when the assumption that the constraint is satisfied in the base configuration does not
+1 -2
View File
@@ -3572,10 +3572,9 @@ mjsTexture* mjs_addTexture(mjSpec* s);
mjsMaterial* mjs_addMaterial(mjSpec* s, mjsDefault* def);
mjSpec* mjs_getSpec(mjsBody* body);
mjsBody* mjs_findBody(mjSpec* s, const char* name);
mjsElement* mjs_findElement(mjSpec* s, mjtObj type, const char* name);
mjsBody* mjs_findChild(mjsBody* body, const char* name);
mjsMesh* mjs_findMesh(mjSpec* s, const char* name);
mjsFrame* mjs_findFrame(mjSpec* s, const char* name);
mjsKey* mjs_findKeyframe(mjSpec* s, const char* name);
mjsDefault* mjs_getDefault(mjsElement* element);
mjsDefault* mjs_findDefault(mjSpec* s, const char* classname);
mjsDefault* mjs_getSpecDefault(mjSpec* s);