Add mj_setKeyframe function to save current state in k-th model keyframe.

Fixes #1719.

Also improve documentation of `mju_sigmoid`, was previously only documented in changelog.

PiperOrigin-RevId: 642637458
Change-Id: I811a0bf8f881c8b76c9a62d2faec8fdec4e7585b
This commit is contained in:
Yuval Tassa
2024-06-12 09:21:54 -07:00
committed by Copybara-Service
parent f37f840880
commit c9bcf8371e
13 changed files with 169 additions and 13 deletions
+18 -1
View File
@@ -235,6 +235,15 @@ mj_setState
Copy concatenated state components specified by ``spec`` from ``state`` into ``d``. The bits of the integer
``spec`` correspond to element fields of :ref:`mjtState`. Fails with :ref:`mju_error` if ``spec`` is invalid.
.. _mj_setKeyframe:
mj_setKeyframe
~~~~~~~~~~~~~~
.. mujoco-include:: mj_setKeyframe
Copy current state to the k-th model keyframe.
.. _mj_addContact:
mj_addContact
@@ -1866,7 +1875,15 @@ mju_sigmoid
.. mujoco-include:: mju_sigmoid
Sigmoid function over 0<=x<=1 using quintic polynomial.
Twice continuously differentiable sigmoid function using a quintic polynomial:
.. math::
s(x) =
\begin{cases}
0, & & x \le 0 \\
6x^5 - 15x^4 + 10x^3, & 0 \lt & x \lt 1 \\
1, & 1 \le & x \qquad
\end{cases}
.. _Interaction:
+12
View File
@@ -533,6 +533,18 @@ Symmetrize square matrix :math:`R = \frac{1}{2}(M + M^T)`.
.. _Miscellaneous:
.. _mju_sigmoid:
Twice continuously differentiable sigmoid function using a quintic polynomial:
.. math::
s(x) =
\begin{cases}
0, & & x \le 0 \\
6x^5 - 15x^4 + 10x^3, & 0 \lt & x \lt 1 \\
1, & 1 \le & x \qquad
\end{cases}
.. _Derivatives-api:
The functions below provide useful derivatives of various functions, both analytic and