From dd5a7115cf7cf5fb46efb1dbec45772f814bbcda Mon Sep 17 00:00:00 2001 From: Alessio Quaglino Date: Wed, 20 Sep 2023 08:59:26 -0700 Subject: [PATCH] Add shell plugin. - Add bending passive force - Add two examples (plate and poncho) - Add stretching constraints for particles using tendons on mesh edges PiperOrigin-RevId: 566980584 Change-Id: Id0cd8e1084c05560f1008518a8afbd5311d563e2 --- doc/XMLreference.rst | 2 +- doc/changelog.rst | 57 +- model/plugin/elasticity/mannequin.xml | 171 +++ model/plugin/elasticity/plate.xml | 54 + model/plugin/elasticity/poncho.xml | 1417 +++++++++++++++++++++ plugin/elasticity/CMakeLists.txt | 2 + plugin/elasticity/register.cc | 2 + plugin/elasticity/shell.cc | 305 +++++ plugin/elasticity/shell.h | 79 ++ src/user/user_composite.cc | 48 +- test/engine/engine_plugin_test.cc | 2 +- test/plugin/elasticity/elasticity_test.cc | 64 +- 12 files changed, 2171 insertions(+), 32 deletions(-) create mode 100644 model/plugin/elasticity/mannequin.xml create mode 100644 model/plugin/elasticity/plate.xml create mode 100644 model/plugin/elasticity/poncho.xml create mode 100644 plugin/elasticity/shell.cc create mode 100644 plugin/elasticity/shell.h diff --git a/doc/XMLreference.rst b/doc/XMLreference.rst index b605c1dc..b8e1b949 100644 --- a/doc/XMLreference.rst +++ b/doc/XMLreference.rst @@ -3346,7 +3346,7 @@ coordinates results in compiler error. See :ref:`CComposite` in the modeling gui .. _body-composite-vertex: :at:`vertex`: :at-val:`real(3*nvert), optional` - Vertex 3D positions in global coordinates (cable only). + Vertex 3D positions in global coordinates (cable and shell). .. _body-composite-face: diff --git a/doc/changelog.rst b/doc/changelog.rst index 20e8110c..988c1ef5 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -31,27 +31,38 @@ New features 3. Added :ref:`mjThreadPool` and :ref:`mjTask` which allow for multi-threaded operations within the MuJoCo engine pipeline. +.. youtube:: ra2bTiZHGlw + :align: right + :width: 240px + +4. Added capability to initialize :ref:`composite` particles with arbitrary positions. + +5. Added `shell `_ passive force plugin: + + - Collisions use spheres located at mesh vertices. + - Stretching as tendon constraints and bending using a constant precomputed Hessian (cotangent operator). + General ^^^^^^^ .. admonition:: Breaking API changes :class: attention - 4. Removed the macros ``mjMARKSTACK`` and ``mjFREESTACK``. + 6. Removed the macros ``mjMARKSTACK`` and ``mjFREESTACK``. **Migration:** These macros have been replaced by new functions :ref:`mj_markStack` and :ref:`mj_freeStack`. These functions manage the :ref:`mjData stack` in a fully encapsulated way (i.e., without introducing a local variable at the call site). - 5. Renamed ``mj_stackAlloc`` to :ref:`mj_stackAllocNum`. The new function :ref:`mj_stackAllocByte` allocates an + 7. Renamed ``mj_stackAlloc`` to :ref:`mj_stackAllocNum`. The new function :ref:`mj_stackAllocByte` allocates an arbitrary number of bytes and has an additional argument for specifying the alignment of the returned pointer. **Migration:** The functionality for allocating ``mjtNum`` arrays is now available via :ref:`mj_stackAllocNum`. - 6. Renamed the ``nstack`` field in :ref:`mjModel` and :ref:`mjData` to ``narena``. Changed ``narena``, ``pstack``, + 8. Renamed the ``nstack`` field in :ref:`mjModel` and :ref:`mjData` to ``narena``. Changed ``narena``, ``pstack``, and ``maxuse_stack`` to count number of bytes rather than number of :ref:`mjtNum` |-| s. - 7. Changed :ref:`mjData.solver`, the array used to collect solver diagnostic information. + 9. Changed :ref:`mjData.solver`, the array used to collect solver diagnostic information. This array of :ref:`mjSolverStat` structs is now of length ``mjNISLAND * mjNSOLVER``, interpreted as as a matrix. Each row of length ``mjNSOLVER`` contains separate solver statistics for each constraint island. If the solver does not use islands, only row 0 is filled. @@ -62,46 +73,46 @@ General - Renamed ``mjData.solver_iter`` to ``solver_niter``. Both this member and ``mjData.solver_nnz`` are now integer vectors of length ``mjNISLAND``. - 8. Removed ``mjOption.collision`` and the associated ``option/collision`` attribute. + 10. Removed ``mjOption.collision`` and the associated ``option/collision`` attribute. - **Migration:** + **Migration:** - - For models which have ``