newton.Control#

class newton.Control[source]#

Bases: object

Time-varying control data for a Model.

Time-varying control data includes joint torques, control inputs, muscle activations, and activation forces for triangle and tetrahedral elements.

The exact attributes depend on the contents of the model. Control objects should generally be created using the newton.Model.control() function.

__init__()#
clear()#

Reset the control inputs to zero.

joint_f: array | None#

Array of generalized joint forces with shape (joint_dof_count,) and type float.

The degrees of freedom for free joints are included in this array and have the same convention as the newton.State.body_f array where the 6D wrench is defined as (f_x, f_y, f_z, t_x, t_y, t_z), where f_x, f_y, and f_z are the components of the force vector (linear) and t_x, t_y, and t_z are the components of the torque vector (angular). For free joints, the wrench is applied in world frame with the body’s center of mass (COM) as reference point.

Note

The Featherstone solver currently applies free-joint forces in the body-origin frame instead of the center-of-mass frame, which can lead to unexpected rotation when applying linear force to a body with a non-zero COM offset.

joint_target_pos: array | None#

Per-DOF position targets, shape (joint_dof_count,), type float (optional).

joint_target_vel: array | None#

Per-DOF velocity targets, shape (joint_dof_count,), type float (optional).

muscle_activations: array | None#

Array of muscle activations with shape (muscle_count,) and type float.

Note

Support for muscle dynamics is not yet implemented.

tet_activations: array | None#

Array of tetrahedral element activations with shape with shape (tet_count,) and type ``float.

tri_activations: array | None#

Array of triangle element activations with shape (tri_count,) and type float.