Disable RK4 integrator in mjd_transitionFD by throwing an error and improve documentation for mjd_transitionFD and mjd_inverseFD.

PiperOrigin-RevId: 659492713
Change-Id: I84ab7ebfba34742f239f60311d8f0a55559995fb
This commit is contained in:
Taylor Howell
2024-08-05 03:17:32 -07:00
committed by Copybara-Service
parent 6a8e28f0e9
commit 20011a2f53
3 changed files with 22 additions and 0 deletions
+9
View File
@@ -2618,6 +2618,9 @@ These matrices and their dimensions are:
fixed (small) value and solver :ref:`tolerance<option-tolerance>` is set to 0. This insures that fixed (small) value and solver :ref:`tolerance<option-tolerance>` is set to 0. This insures that
all calls to the solver will perform exactly the same number of iterations. all calls to the solver will perform exactly the same number of iterations.
.. attention::
- The Runge-Kutta 4th-order integrator (``mjINT_RK4``) is not supported.
.. _mjd_inverseFD: .. _mjd_inverseFD:
mjd_inverseFD mjd_inverseFD
@@ -2654,6 +2657,12 @@ using finite-differencing. These matrices and their dimensions are:
- ``eps`` is the (forward) finite-differencing epsilon. - ``eps`` is the (forward) finite-differencing epsilon.
- ``flg_actuation`` denotes whether to subtract actuation forces (``qfrc_actuator``) from the output of the inverse - ``flg_actuation`` denotes whether to subtract actuation forces (``qfrc_actuator``) from the output of the inverse
dynamics. If this flag is positive, actuator forces are not considered as external. dynamics. If this flag is positive, actuator forces are not considered as external.
- The model option flag ``invdiscrete`` should correspond to the representation of ``mjData.qacc`` in order to compute
the correct derivative information.
.. attention::
- The Runge-Kutta 4th-order integrator (``mjINT_RK4``) is not supported.
- The noslip solver is not supported.
.. _mjd_subQuat: .. _mjd_subQuat:
+9
View File
@@ -592,6 +592,9 @@ These matrices and their dimensions are:
fixed (small) value and solver :ref:`tolerance<option-tolerance>` is set to 0. This insures that fixed (small) value and solver :ref:`tolerance<option-tolerance>` is set to 0. This insures that
all calls to the solver will perform exactly the same number of iterations. all calls to the solver will perform exactly the same number of iterations.
.. attention::
- The Runge-Kutta 4th-order integrator (``mjINT_RK4``) is not supported.
.. _mjd_inverseFD: .. _mjd_inverseFD:
Finite differenced continuous-time inverse-dynamics Jacobians. Finite differenced continuous-time inverse-dynamics Jacobians.
@@ -623,6 +626,12 @@ using finite-differencing. These matrices and their dimensions are:
- ``eps`` is the (forward) finite-differencing epsilon. - ``eps`` is the (forward) finite-differencing epsilon.
- ``flg_actuation`` denotes whether to subtract actuation forces (``qfrc_actuator``) from the output of the inverse - ``flg_actuation`` denotes whether to subtract actuation forces (``qfrc_actuator``) from the output of the inverse
dynamics. If this flag is positive, actuator forces are not considered as external. dynamics. If this flag is positive, actuator forces are not considered as external.
- The model option flag ``invdiscrete`` should correspond to the representation of ``mjData.qacc`` in order to compute
the correct derivative information.
.. attention::
- The Runge-Kutta 4th-order integrator (``mjINT_RK4``) is not supported.
- The noslip solver is not supported.
.. _mjd_subQuat: .. _mjd_subQuat:
+4
View File
@@ -548,6 +548,10 @@ void mjd_stepFD(const mjModel* m, mjData* d, mjtNum eps, mjtByte flg_centered,
// D: (nsensordata x nu) // D: (nsensordata x nu)
void mjd_transitionFD(const mjModel* m, mjData* d, mjtNum eps, mjtByte flg_centered, void mjd_transitionFD(const mjModel* m, mjData* d, mjtNum eps, mjtByte flg_centered,
mjtNum* A, mjtNum* B, mjtNum* C, mjtNum* D) { mjtNum* A, mjtNum* B, mjtNum* C, mjtNum* D) {
if (m->opt.integrator == mjINT_RK4) {
mjERROR("RK4 integrator is not supported");
}
int nv = m->nv, na = m->na, nu = m->nu, ns = m->nsensordata; int nv = m->nv, na = m->na, nu = m->nu, ns = m->nsensordata;
int ndx = 2*nv+na; // row length of state Jacobians int ndx = 2*nv+na; // row length of state Jacobians