Add nJmom, the number of non-zeros in sparse actuator_moment matrix, to mjModel.

PiperOrigin-RevId: 698343986
Change-Id: I3d4a4dea1ec095d4e7b231c2fffc0e6241cee39f
This commit is contained in:
Taylor Howell
2024-11-20 04:29:55 -08:00
committed by Copybara-Service
parent cd84011d7b
commit aae5fd6906
13 changed files with 78 additions and 33 deletions
+2 -2
View File
@@ -291,8 +291,8 @@ struct mjData_ {
mjtNum* actuator_length; // actuator lengths (nu x 1)
int* moment_rownnz; // number of non-zeros in actuator_moment row (nu x 1)
int* moment_rowadr; // row start address in colind array (nu x 1)
int* moment_colind; // column indices in sparse Jacobian (nu x nv)
mjtNum* actuator_moment; // actuator moments (nu x nv)
int* moment_colind; // column indices in sparse Jacobian (nJmom x 1)
mjtNum* actuator_moment; // actuator moments (nJmom x 1)
// computed by mj_fwdPosition/mj_crb
mjtNum* crb; // com-based composite inertia and mass (nbody x 10)
+1
View File
@@ -663,6 +663,7 @@ struct mjModel_ {
int nB; // number of non-zeros in sparse body-dof matrix
int nC; // number of non-zeros in sparse reduced dof-dof matrix
int nD; // number of non-zeros in sparse dof-dof matrix
int nJmom; // number of non-zeros in sparse actuator_moment matrix
int ntree; // number of kinematic trees under world body
int ngravcomp; // number of bodies with nonzero gravcomp
int nemax; // number of potential equality-constraint rows
+3 -2
View File
@@ -137,6 +137,7 @@
X ( nB ) \
X ( nC ) \
X ( nD ) \
X ( nJmom ) \
XMJV( ntree ) \
X ( ngravcomp ) \
X ( nemax ) \
@@ -625,8 +626,8 @@
X ( mjtNum, actuator_length, nu, 1 ) \
X ( int, moment_rownnz, nu, 1 ) \
X ( int, moment_rowadr, nu, 1 ) \
X ( int, moment_colind, nu, MJ_M(nv) ) \
X ( mjtNum, actuator_moment, nu, MJ_M(nv) ) \
X ( int, moment_colind, nJmom, 1 ) \
X ( mjtNum, actuator_moment, nJmom, 1 ) \
X ( mjtNum, crb, nbody, 10 ) \
X ( mjtNum, qM, nM, 1 ) \
X ( mjtNum, qLD, nM, 1 ) \