@@ -215,9 +215,9 @@ typedef struct mjData_ {
215215 mjtNum * wrap_xpos ; // Cartesian 3D points in all paths (nwrap x 6)
216216
217217 // computed by mj_fwdPosition/mj_transmission
218- mjtNum * actuator_length ; // actuator lengths (nu x 1)
219- int * moment_rownnz ; // number of non-zeros in actuator_moment row (nu x 1)
220- int * moment_rowadr ; // row start address in colind array (nu x 1)
218+ mjtNum * actuator_length ; // actuator lengths, one per force output (nout x 1)
219+ int * moment_rownnz ; // number of non-zeros in actuator_moment row (nout x 1)
220+ int * moment_rowadr ; // row start address in colind array (nout x 1)
221221 int * moment_colind ; // column indices in sparse Jacobian (nJmom x 1)
222222 mjtNum * actuator_moment ; // actuator moments (nJmom x 1)
223223
@@ -244,7 +244,7 @@ typedef struct mjData_ {
244244 // computed by mj_fwdVelocity
245245 mjtNum * flexedge_velocity ; // flex edge velocities (nflexedge x 1)
246246 mjtNum * ten_velocity ; // tendon velocities (ntendon x 1)
247- mjtNum * actuator_velocity ; // actuator velocities (nu x 1)
247+ mjtNum * actuator_velocity ; // actuator velocities, one per force output (nout x 1)
248248
249249 // computed by mj_fwdVelocity/mj_comVel
250250 mjtNum * cvel ; // com-based velocity (rot:lin) (nbody x 6)
@@ -277,8 +277,8 @@ typedef struct mjData_ {
277277 //-------------------- POSITION, VELOCITY, CONTROL/ACCELERATION dependent
278278
279279 // computed by mj_fwdActuation
280- mjtNum * actuator_force ; // actuator force in actuation space (nu x 1)
281- mjtNum * qfrc_actuator ; // actuator force (nv x 1)
280+ mjtNum * actuator_force ; // actuator force in actuation space (nout x 1)
281+ mjtNum * qfrc_actuator ; // actuator force in joint space (nv x 1)
282282
283283 // computed by mj_fwdAcceleration
284284 mjtNum * qfrc_smooth ; // net unconstrained force (nv x 1)
@@ -557,7 +557,9 @@ typedef struct mjModel_ {
557557 // sizes needed at mjModel construction
558558 mjtSize nq ; // number of generalized coordinates = dim(qpos)
559559 mjtSize nv ; // number of degrees of freedom = dim(qvel)
560- mjtSize nu ; // number of actuators/controls = dim(ctrl)
560+ mjtSize nu ; // number of scalar controls = dim(ctrl)
561+ mjtSize nactuator ; // number of actuators
562+ mjtSize nout ; // number of force outputs, derived from transmission type
561563 mjtSize na ; // number of activation states = dim(act)
562564 mjtSize nbody ; // number of bodies
563565 mjtSize nbvh ; // number of total bounding volumes in all bodies
@@ -1072,37 +1074,41 @@ typedef struct mjModel_ {
10721074 mjtNum * wrap_prm ; // divisor, joint coef, or site id (nwrap x 1)
10731075
10741076 // actuators
1075- int * actuator_trntype ; // transmission type (mjtTrn) (nu x 1)
1076- int * actuator_dyntype ; // dynamics type (mjtDyn) (nu x 1)
1077- int * actuator_gaintype ; // gain type (mjtGain) (nu x 1)
1078- int * actuator_biastype ; // bias type (mjtBias) (nu x 1)
1079- int * actuator_trnid ; // transmission id: joint, tendon, site (nu x 2)
1080- mjtNum * actuator_damping ; // linear damping coefficient (nu x 1)
1081- mjtNum * actuator_dampingpoly ; // high-order damping coefficients (nu x mjNPOLY)
1082- mjtNum * actuator_armature ; // armature added to target (joint, tendon) (nu x 1)
1083- int * actuator_actadr ; // first activation address; -1: stateless (nu x 1)
1084- int * actuator_actnum ; // number of activation variables (nu x 1)
1085- int * actuator_group ; // group for visibility (nu x 1)
1086- int * actuator_history ; // history buffer: [nsample, interp] (nu x 2)
1087- int * actuator_historyadr ; // address in history buffer; -1: none (nu x 1)
1088- mjtNum * actuator_delay ; // delay time in seconds; 0: no delay (nu x 1)
1077+ int * actuator_trntype ; // transmission type (mjtTrn) (nactuator x 1)
1078+ int * actuator_dyntype ; // dynamics type (mjtDyn) (nactuator x 1)
1079+ int * actuator_gaintype ; // gain type (mjtGain) (nactuator x 1)
1080+ int * actuator_biastype ; // bias type (mjtBias) (nactuator x 1)
1081+ int * actuator_ctrladr ; // address of first control (nactuator x 1)
1082+ int * actuator_ctrlnum ; // number of controls (nactuator x 1)
1083+ int * actuator_outadr ; // address of first force output (nactuator x 1)
1084+ int * actuator_outnum ; // number of force outputs, from trntype (nactuator x 1)
1085+ int * actuator_actadr ; // first activation address; -1: stateless (nactuator x 1)
1086+ int * actuator_actnum ; // number of activation variables (nactuator x 1)
1087+ int * actuator_trnid ; // transmission id: joint, tendon, site (nactuator x 2)
1088+ mjtNum * actuator_cranklength ; // crank length for slider-crank (nactuator x 1)
1089+ mjtNum * actuator_dynprm ; // dynamics parameters (nactuator x mjNDYN)
1090+ mjtNum * actuator_gainprm ; // gain parameters (nactuator x mjNGAIN)
1091+ mjtNum * actuator_biasprm ; // bias parameters (nactuator x mjNBIAS)
1092+ mjtBool * actuator_actlimited ; // is activation limited (nactuator x 1)
1093+ mjtNum * actuator_actrange ; // range of activations (nactuator x 2)
1094+ mjtBool * actuator_actearly ; // step activation before force (nactuator x 1)
1095+ int * actuator_history ; // history buffer: [nsample, interp] (nactuator x 2)
1096+ int * actuator_historyadr ; // address in history buffer; -1: none (nactuator x 1)
1097+ mjtNum * actuator_delay ; // delay time; 0: no delay (nactuator x 1)
1098+ mjtNum * actuator_damping ; // linear damping coefficient (nactuator x 1)
1099+ mjtNum * actuator_dampingpoly ; // high-order damping coefficients (nactuator x mjNPOLY)
1100+ mjtNum * actuator_armature ; // armature added to target (joint, tendon) (nactuator x 1)
1101+ int * actuator_group ; // group for visibility (nactuator x 1)
1102+ mjtNum * actuator_user ; // user data (nactuator x nuser_actuator)
1103+ int * actuator_plugin ; // plugin instance id; -1: not a plugin (nactuator x 1)
10891104 mjtBool * actuator_ctrllimited ; // is control limited (nu x 1)
1090- mjtBool * actuator_forcelimited ;// is force limited (nu x 1)
1091- mjtBool * actuator_actlimited ; // is activation limited (nu x 1)
1092- mjtNum * actuator_dynprm ; // dynamics parameters (nu x mjNDYN)
1093- mjtNum * actuator_gainprm ; // gain parameters (nu x mjNGAIN)
1094- mjtNum * actuator_biasprm ; // bias parameters (nu x mjNBIAS)
1095- mjtBool * actuator_actearly ; // step activation before force (nu x 1)
10961105 mjtNum * actuator_ctrlrange ; // range of controls (nu x 2)
1097- mjtNum * actuator_forcerange ; // range of forces (nu x 2)
1098- mjtNum * actuator_actrange ; // range of activations (nu x 2)
1099- mjtNum * actuator_gear ; // scale length and transmitted force (nu x 6)
1100- mjtNum * actuator_cranklength ; // crank length for slider-crank (nu x 1)
1101- mjtNum * actuator_acc0 ; // acceleration from unit force in qpos0 (nu x 1)
1102- mjtNum * actuator_length0 ; // actuator length in qpos0 (nu x 1)
1103- mjtNum * actuator_lengthrange ; // feasible actuator length range (nu x 2)
1104- mjtNum * actuator_user ; // user data (nu x nuser_actuator)
1105- int * actuator_plugin ; // plugin instance id; -1: not a plugin (nu x 1)
1106+ mjtNum * actuator_gear ; // scale length and transmitted force (nout x 6)
1107+ mjtBool * actuator_forcelimited ;// is force limited (nout x 1)
1108+ mjtNum * actuator_forcerange ; // range of forces (nout x 2)
1109+ mjtNum * actuator_acc0 ; // acceleration from unit force in qpos0 (nout x 1)
1110+ mjtNum * actuator_length0 ; // actuator length in qpos0 (nout x 1)
1111+ mjtNum * actuator_lengthrange ; // feasible actuator length range (nout x 2)
11061112
11071113 // sensors
11081114 int * sensor_type ; // sensor type (mjtSensor) (nsensor x 1)
@@ -1174,7 +1180,7 @@ typedef struct mjModel_ {
11741180 int * name_excludeadr ; // exclude name pointers (nexclude x 1)
11751181 int * name_eqadr ; // equality constraint name pointers (neq x 1)
11761182 int * name_tendonadr ; // tendon name pointers (ntendon x 1)
1177- int * name_actuatoradr ; // actuator name pointers (nu x 1)
1183+ int * name_actuatoradr ; // actuator name pointers (nactuator x 1)
11781184 int * name_sensoradr ; // sensor name pointers (nsensor x 1)
11791185 int * name_numericadr ; // numeric name pointers (nnumeric x 1)
11801186 int * name_textadr ; // text name pointers (ntext x 1)
0 commit comments