Add tendon actuator force limits and tendon actuator force sensor.

PiperOrigin-RevId: 745096883
Change-Id: Ib9acb727fbbfc6b0b0323ee6a889053a7a878056
This commit is contained in:
Taylor Howell
2025-04-08 05:15:27 -07:00
committed by Copybara-Service
parent 16e49f2761
commit 96dda6ea75
26 changed files with 464 additions and 74 deletions
+3
View File
@@ -317,6 +317,7 @@ typedef enum mjtSensor_ { // type of sensor
mjSENS_ACTUATORVEL, // scalar actuator velocity
mjSENS_ACTUATORFRC, // scalar actuator force
mjSENS_JOINTACTFRC, // scalar actuator force, measured at the joint
mjSENS_TENDONACTFRC, // scalar actuator force, measured at the tendon
// sensors related to ball joints
mjSENS_BALLQUAT, // 4D ball joint quaternion
@@ -1031,12 +1032,14 @@ struct mjModel_ {
int* tendon_matid; // material id for rendering (ntendon x 1)
int* tendon_group; // group for visibility (ntendon x 1)
mjtByte* tendon_limited; // does tendon have length limits (ntendon x 1)
mjtByte* tendon_actfrclimited; // does tendon have actuator force limits (ntendon x 1)
mjtNum* tendon_width; // width for rendering (ntendon x 1)
mjtNum* tendon_solref_lim; // constraint solver reference: limit (ntendon x mjNREF)
mjtNum* tendon_solimp_lim; // constraint solver impedance: limit (ntendon x mjNIMP)
mjtNum* tendon_solref_fri; // constraint solver reference: friction (ntendon x mjNREF)
mjtNum* tendon_solimp_fri; // constraint solver impedance: friction (ntendon x mjNIMP)
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)
+2
View File
@@ -628,7 +628,9 @@ typedef struct mjsTendon_ { // tendon specification
// length range
int limited; // does tendon have limits (mjtLimited)
int actfrclimited; // does tendon have actuator force limits
double range[2]; // length limits
double actfrcrange[2]; // actuator force limits
double margin; // margin value for tendon limit detection
mjtNum solref_limit[mjNREF]; // solver reference: tendon limits
mjtNum solimp_limit[mjNIMP]; // solver impedance: tendon limits
+2
View File
@@ -593,8 +593,10 @@ struct mjvSceneState_ {
int* tendon_matid;
int* tendon_group;
mjtByte* tendon_limited;
mjtByte* tendon_actfrclimited;
mjtNum* tendon_width;
mjtNum* tendon_range;
mjtNum* tendon_actfrcrange;
mjtNum* tendon_stiffness;
mjtNum* tendon_damping;
mjtNum* tendon_frictionloss;
+2
View File
@@ -475,12 +475,14 @@
XMJV( int, tendon_matid, ntendon, 1 ) \
XMJV( int, tendon_group, ntendon, 1 ) \
XMJV( mjtByte, tendon_limited, ntendon, 1 ) \
XMJV( mjtByte, tendon_actfrclimited, ntendon, 1 ) \
XMJV( mjtNum, tendon_width, ntendon, 1 ) \
X ( mjtNum, tendon_solref_lim, ntendon, mjNREF ) \
X ( mjtNum, tendon_solimp_lim, ntendon, mjNIMP ) \
X ( mjtNum, tendon_solref_fri, ntendon, mjNREF ) \
X ( mjtNum, tendon_solimp_fri, ntendon, mjNIMP ) \
XMJV( mjtNum, tendon_range, ntendon, 2 ) \
XMJV( mjtNum, tendon_actfrcrange, ntendon, 2 ) \
X ( mjtNum, tendon_margin, ntendon, 1 ) \
XMJV( mjtNum, tendon_stiffness, ntendon, 1 ) \
XMJV( mjtNum, tendon_damping, ntendon, 1 ) \