Polynomial stiffness and damping https://youtu.be/aKa3ZlEF9_Y

PiperOrigin-RevId: 884607673
Change-Id: If8088dbf37fed1055304778a7eb84dec52cba920
This commit is contained in:
Yuval Tassa
2026-03-16 13:24:44 -07:00
committed by Copybara-Service
parent aec1b45dce
commit efae9157a7
38 changed files with 1093 additions and 176 deletions
+9 -4
View File
@@ -42,6 +42,7 @@
#define mjNFLUID 12 // number of fluid interaction parameters
#define mjNREF 2 // number of solver reference parameters
#define mjNIMP 5 // number of solver impedance parameters
#define mjNPOLY 2 // number of high-order polynomial coefficients
#define mjNSENS 3 // number of sensor parameters
#define mjNSOLVER 200 // size of one mjData.solver array
#define mjNISLAND 20 // number of mjData.solver arrays
@@ -840,7 +841,8 @@ struct mjModel_ {
mjtNum* jnt_solimp; // constraint solver impedance: limit (njnt x mjNIMP)
mjtNum* jnt_pos; // local anchor position (njnt x 3)
mjtNum* jnt_axis; // local joint axis (njnt x 3)
mjtNum* jnt_stiffness; // stiffness coefficient (njnt x 1)
mjtNum* jnt_stiffness; // linear stiffness coefficient (njnt x 1)
mjtNum* jnt_stiffnesspoly; // high-order stiffness coefficients (njnt x mjNPOLY)
mjtNum* jnt_range; // joint limits (njnt x 2)
mjtNum* jnt_actfrcrange; // range of total actuator force (njnt x 2)
mjtNum* jnt_margin; // min distance for limit detection (njnt x 1)
@@ -857,7 +859,8 @@ struct mjModel_ {
mjtNum* dof_solimp; // constraint solver impedance:frictionloss (nv x mjNIMP)
mjtNum* dof_frictionloss; // dof friction loss (nv x 1)
mjtNum* dof_armature; // dof armature inertia/mass (nv x 1)
mjtNum* dof_damping; // damping coefficient (nv x 1)
mjtNum* dof_damping; // linear damping coefficient (nv x 1)
mjtNum* dof_dampingpoly; // high-order damping coefficients (nv x mjNPOLY)
mjtNum* dof_invweight0; // diag. inverse inertia in qpos0 (nv x 1)
mjtNum* dof_M0; // diag. inertia in qpos0 (nv x 1)
mjtNum* dof_length; // linear: 1; angular: approx. length scale (nv x 1)
@@ -1162,8 +1165,10 @@ struct mjModel_ {
mjtNum* tendon_range; // tendon length limits (ntendon x 2)
mjtNum* tendon_actfrcrange; // range of total actuator force (ntendon x 2)
mjtNum* tendon_margin; // min distance for limit detection (ntendon x 1)
mjtNum* tendon_stiffness; // stiffness coefficient (ntendon x 1)
mjtNum* tendon_damping; // damping coefficient (ntendon x 1)
mjtNum* tendon_stiffness; // linear stiffness coefficient (ntendon x 1)
mjtNum* tendon_stiffnesspoly; // high-order stiffness coefficients (ntendon x mjNPOLY)
mjtNum* tendon_damping; // linear damping coefficient (ntendon x 1)
mjtNum* tendon_dampingpoly; // high-order damping coefficients (ntendon x mjNPOLY)
mjtNum* tendon_armature; // inertia associated with tendon velocity (ntendon x 1)
mjtNum* tendon_frictionloss; // loss due to friction (ntendon x 1)
mjtNum* tendon_lengthspring; // spring resting length range (ntendon x 2)
+4 -4
View File
@@ -265,7 +265,7 @@ typedef struct mjsJoint_ { // joint specification
int align; // align free joint with body com (mjtAlignFree)
// stiffness
double stiffness; // stiffness coefficient
double stiffness[mjNPOLY+1]; // stiffness coefficients
double springref; // spring reference value: qpos_spring
double springdamper[2]; // timeconst, dampratio
@@ -280,7 +280,7 @@ typedef struct mjsJoint_ { // joint specification
// dof properties
double armature; // armature inertia (mass for slider)
double damping; // damping coefficient
double damping[mjNPOLY+1]; // damping coefficients
double frictionloss; // friction loss
mjtNum solref_friction[mjNREF]; // solver reference: dof friction
mjtNum solimp_friction[mjNIMP]; // solver impedance: dof friction
@@ -627,9 +627,9 @@ typedef struct mjsTendon_ { // tendon specification
mjsElement* element; // element type
// stiffness, damping, friction, armature
double stiffness; // stiffness coefficient
double stiffness[mjNPOLY+1]; // stiffness coefficients
double springlength[2]; // spring resting length; {-1, -1}: use qpos_spring
double damping; // damping coefficient
double damping[mjNPOLY+1]; // damping coefficients
double frictionloss; // friction loss
mjtNum solref_friction[mjNREF]; // solver reference: tendon friction
mjtNum solimp_friction[mjNIMP]; // solver impedance: tendon friction
+4
View File
@@ -323,6 +323,7 @@
X ( mjtNum, jnt_pos, njnt, 3 ) \
X ( mjtNum, jnt_axis, njnt, 3 ) \
X ( mjtNum, jnt_stiffness, njnt, 1 ) \
X ( mjtNum, jnt_stiffnesspoly, njnt, mjNPOLY ) \
X ( mjtNum, jnt_range, njnt, 2 ) \
X ( mjtNum, jnt_actfrcrange, njnt, 2 ) \
X ( mjtNum, jnt_margin, njnt, 1 ) \
@@ -340,6 +341,7 @@
X ( mjtNum, dof_frictionloss, nv, 1 ) \
X ( mjtNum, dof_armature, nv, 1 ) \
X ( mjtNum, dof_damping, nv, 1 ) \
X ( mjtNum, dof_dampingpoly, nv, mjNPOLY ) \
X ( mjtNum, dof_invweight0, nv, 1 ) \
X ( mjtNum, dof_M0, nv, 1 ) \
X ( mjtNum, dof_length, nv, 1 )
@@ -643,7 +645,9 @@
X ( mjtNum, tendon_actfrcrange, ntendon, 2 ) \
X ( mjtNum, tendon_margin, ntendon, 1 ) \
X ( mjtNum, tendon_stiffness, ntendon, 1 ) \
X ( mjtNum, tendon_stiffnesspoly, ntendon, mjNPOLY ) \
X ( mjtNum, tendon_damping, ntendon, 1 ) \
X ( mjtNum, tendon_dampingpoly, ntendon, mjNPOLY ) \
X ( mjtNum, tendon_armature, ntendon, 1 ) \
X ( mjtNum, tendon_frictionloss, ntendon, 1 ) \
X ( mjtNum, tendon_lengthspring, ntendon, 2 ) \