Add automatic free-joint alignment.

PiperOrigin-RevId: 671010083
Change-Id: Ib7d60f75c7f545b1886703715663db8de77feeef
This commit is contained in:
Yuval Tassa
2024-09-04 10:06:29 -07:00
committed by Copybara-Service
parent ae4987026c
commit 8954a088ce
18 changed files with 308 additions and 13 deletions
+8
View File
@@ -84,6 +84,12 @@ typedef enum mjtLimited_ { // type of limit specification
mjLIMITED_AUTO, // limited inferred from presence of range
} mjtLimited;
typedef enum mjtAlignFree_ { // whether to align free joints with the inertial frame
mjALIGNFREE_FALSE = 0, // don't align
mjALIGNFREE_TRUE, // align
mjALIGNFREE_AUTO, // respect the global compiler flag
} mjtAlignFree;
typedef enum mjtInertiaFromGeom_ { // whether to infer body inertias from child geoms
mjINERTIAFROMGEOM_FALSE = 0, // do not use; inertial element required
@@ -131,6 +137,7 @@ typedef struct mjSpec_ { // model specification
int inertiafromgeom; // use geom inertias (mjtInertiaFromGeom)
int inertiagrouprange[2]; // range of geom groups used to compute inertia
mjtByte exactmeshinertia; // if false, use old formula
int alignfree; // align free joints with inertial frame
mjLROpt LRopt; // options for lengthrange computation
// engine data
@@ -231,6 +238,7 @@ typedef struct mjsJoint_ { // joint specification
double pos[3]; // anchor position
double axis[3]; // joint axis
double ref; // value at reference configuration: qpos0
int align; // align free joint with body com (mjtAlignFree)
// stiffness
double stiffness; // stiffness coefficient