Preparation for MIMO actuators: split actuator counts: nu (inputs), nactuator (objects), nout (outputs).

An actuator now owns a block of consecutive controls
(actuator_ctrladr/ctrlnum, width defined by the actuator type) and a block
of consecutive force outputs (actuator_outadr/outnum, width defined by the
transmission type). Force outputs are the scalars of actuation space: one
force, length, velocity and moment row each. nout = dim(actuator_force) is
derived from transmission types; all current types have width 1, so all
three counts coincide for every existing model and behavior is bit-exact.

Array re-keying: ctrlrange/ctrllimited by nu; forcerange/forcelimited/gear/
acc0/length0/lengthrange and the moment row structure by nout; everything
else per actuator. The mjModel actuator block is re-sorted by size key.

Layout-breaking, not behavior-breaking: saved .mjb files are invalidated
(size list changed) and recompilation is required.

PiperOrigin-RevId: 948351772
Change-Id: Icbc196ffa083cb1eaa6f1a3710869c89d8f62540
This commit is contained in:
Yuval Tassa
2026-07-15 08:29:38 -07:00
committed by Copybara-Service
parent 06f12a9372
commit d507e92198
27 changed files with 750 additions and 538 deletions
+23 -17
View File
@@ -1021,6 +1021,8 @@ public unsafe struct mjModel_ {
public UInt64 nq;
public UInt64 nv;
public UInt64 nu;
public UInt64 nactuator;
public UInt64 nout;
public UInt64 na;
public UInt64 nbody;
public UInt64 nbvh;
@@ -1480,33 +1482,37 @@ public unsafe struct mjModel_ {
public int* actuator_dyntype;
public int* actuator_gaintype;
public int* actuator_biastype;
public int* actuator_trnid;
public double* actuator_damping;
public double* actuator_dampingpoly;
public double* actuator_armature;
public int* actuator_ctrladr;
public int* actuator_ctrlnum;
public int* actuator_outadr;
public int* actuator_outnum;
public int* actuator_actadr;
public int* actuator_actnum;
public int* actuator_group;
public int* actuator_history;
public int* actuator_historyadr;
public double* actuator_delay;
public byte* actuator_ctrllimited;
public byte* actuator_forcelimited;
public byte* actuator_actlimited;
public int* actuator_trnid;
public double* actuator_cranklength;
public double* actuator_dynprm;
public double* actuator_gainprm;
public double* actuator_biasprm;
public byte* actuator_actearly;
public double* actuator_ctrlrange;
public double* actuator_forcerange;
public byte* actuator_actlimited;
public double* actuator_actrange;
public byte* actuator_actearly;
public int* actuator_history;
public int* actuator_historyadr;
public double* actuator_delay;
public double* actuator_damping;
public double* actuator_dampingpoly;
public double* actuator_armature;
public int* actuator_group;
public double* actuator_user;
public int* actuator_plugin;
public byte* actuator_ctrllimited;
public double* actuator_ctrlrange;
public double* actuator_gear;
public double* actuator_cranklength;
public byte* actuator_forcelimited;
public double* actuator_forcerange;
public double* actuator_acc0;
public double* actuator_length0;
public double* actuator_lengthrange;
public double* actuator_user;
public int* actuator_plugin;
public int* sensor_type;
public int* sensor_datatype;
public int* sensor_needstage;