newton.Control#
- class newton.Control[source]#
Bases:
objectTime-varying control data for a
Model.Carries joint torques, control inputs, muscle activations, and tri/tet activation forces. Create via
newton.Model.control().Position and velocity targets live on
joint_target_qandjoint_target_qd. The shape ofjoint_target_qdepends onnewton.use_coord_layout_targets— coord-shaped whenTrue, DOF-shaped otherwise. Legacyjoint_target_pos/joint_target_velaliases are available underFalseand raise underTrue.- __init__()#
- clear(model=None)#
Reset all control inputs to zero.
joint_target_qis special: zeroing it under coord layout corrupts FREE/BALL/DISTANCE quaternion slots ((0,0,0,0)is not a valid rotation). Passmodelto restore it frommodel.joint_target_qinstead. Withoutmodelit falls back to the legacy zero-fill.
- joint_act: array | None#
Per-DOF feedforward actuation input, shape
(joint_dof_count,), typefloat(optional).This is an additive feedforward term used by actuators (e.g.
ActuatorPD) in their control law before PD/PID correction is applied.
- joint_f: array | None#
Array of generalized joint forces [N or N·m, depending on joint type] with shape
(joint_dof_count,)and typefloat.The degrees of freedom for FREE and DISTANCE joints are included in this array and have the same convention as the
newton.State.body_farray where the 6D wrench is defined as(f_x, f_y, f_z, t_x, t_y, t_z), wheref_x,f_y, andf_zare the components of the force vector (linear) [N] andt_x,t_y, andt_zare the components of the torque vector (angular) [N·m]. For FREE and DISTANCE joints, the wrench is applied in world frame with the child body’s center of mass (COM) as reference point.
- property joint_target_pos: array | None#
Deprecated alias for
joint_target_q(DOF-shape only). RaisesAttributeErrorundernewton.use_coord_layout_targetsTrue.Deprecated since version 1.3: Use
joint_target_qinstead.
- joint_target_q: array | None#
Joint position targets [m or rad]. Shape is
(joint_coord_count,)whennewton.use_coord_layout_targetsisTrue, otherwise(joint_dof_count,)for legacy compat withjoint_target_pos.
- joint_target_qd: array | None#
Joint velocity targets [m/s or rad/s], shape
(joint_dof_count,). Matchesjoint_qd; replacesjoint_target_vel.
- property joint_target_vel: array | None#
Deprecated alias for
joint_target_qd. RaisesAttributeErrorundernewton.use_coord_layout_targetsTrue.Deprecated since version 1.3: Use
joint_target_qdinstead.
- muscle_activations: array | None#
Array of muscle activations [dimensionless, 0 to 1] with shape
(muscle_count,)and typefloat.Note
Support for muscle dynamics is not yet implemented.