Add mjs_makeFlex to the MuJoCo C and Python APIs.
- Add mjs_makeFlex C API that wraps mjCFlexcomp::Make(), creating a flex with auto-generated bodies, joints, and equality constraints from parameters (type, dim, dof, count, cellcount, spacing, scale, radius, mass, inertiabox, equality, rigid, flatskin, elastic2d, pos, quat, origin, file, vfs). - Add Python binding body.make_flex() in specs.cc with keyword args. - Refactor flex_spec_provision.py to use make_flex() instead of XML string templating + separate spec + attach. Eliminates textwrap dependency. - Merge user_flexcomp into user_model BUILD target to resolve circular dependency. PiperOrigin-RevId: 922725304 Change-Id: Ice13787c45f3173407fec659f9590a6453bc65dd
This commit is contained in:
committed by
Copybara-Service
parent
b9fb817af8
commit
4c381635e1
@@ -4496,6 +4496,17 @@ Add sensor.
|
||||
|
||||
Add flex.
|
||||
|
||||
.. _mjs_makeFlex:
|
||||
|
||||
`mjs_makeFlex <#mjs_makeFlex>`__
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mujoco-include:: mjs_makeFlex
|
||||
|
||||
Add flexcomp: create flex with auto-generated bodies/joints, return flex spec.
|
||||
|
||||
*Nullable:* ``type``, ``dof``, ``count``, ``cellcount``, ``spacing``, ``scale``, ``pos``, ``quat``, ``origin``, ``file``, ``vfs``
|
||||
|
||||
.. _mjs_addPair:
|
||||
|
||||
`mjs_addPair <#mjs_addPair>`__
|
||||
|
||||
+6
-1
@@ -5,11 +5,16 @@ Changelog
|
||||
Upcoming version (not yet released)
|
||||
-----------------------------------
|
||||
|
||||
General
|
||||
^^^^^^^
|
||||
- Added :ref:`mjs_makeFlex`, a new C API function equivalent to the :ref:`flexcomp<body-flexcomp>` element for
|
||||
programmatically creating flex objects with auto-generated bodies, joints, and equality constraints. Exposed as
|
||||
``body.make_flex()`` in Python.
|
||||
|
||||
Bug fixes
|
||||
^^^^^^^^^
|
||||
- Fixed a bug in the ``mjz`` :ref:`decoder <mjpDecoder>` where unnormalized paths would fail to be read.
|
||||
|
||||
|
||||
Version 3.9.0 (May 27, 2026)
|
||||
----------------------------
|
||||
|
||||
|
||||
@@ -3678,6 +3678,12 @@ int mjs_delete(mjSpec* spec, mjsElement* element);
|
||||
mjsActuator* mjs_addActuator(mjSpec* s, const mjsDefault* def);
|
||||
mjsSensor* mjs_addSensor(mjSpec* s);
|
||||
mjsFlex* mjs_addFlex(mjSpec* s);
|
||||
mjsFlex* mjs_makeFlex(mjsBody* body, const char* name, const char* type, int dim,
|
||||
const char* dof, const int count[3], const int cellcount[3],
|
||||
const double spacing[3], const double scale[3], double radius,
|
||||
double mass, double inertiabox, int equality, int rigid, int flatskin,
|
||||
int elastic2d, const double pos[3], const double quat[4],
|
||||
const double origin[3], const char* file, const mjVFS* vfs);
|
||||
mjsPair* mjs_addPair(mjSpec* s, const mjsDefault* def);
|
||||
mjsExclude* mjs_addExclude(mjSpec* s);
|
||||
mjsEquality* mjs_addEquality(mjSpec* s, const mjsDefault* def);
|
||||
|
||||
Reference in New Issue
Block a user