JointDynamics#
- class JointDynamics(
- inertia__kg_m2: float,
- damping__Nm_s_per_rad: float,
- stiffness__Nm_per_rad: float = 0.0,
- initial_angle__deg: float = 0.0,
- initial_velocity__deg_per_s: float = 0.0,
Bases:
objectJoint dynamics integrator for closed-loop neuromechanical control.
This class implements second-order joint dynamics using the equation: I⋅α = τ - B⋅ω - K⋅θ where α = angular acceleration, τ = torque, ω = angular velocity, θ = joint angle, I = inertia, B = damping, K = stiffness.
- Parameters:
inertia__kg_m2 (float) – Joint rotational inertia in kg⋅m².
damping__Nm_s_per_rad (float) – Joint viscous damping coefficient in N⋅m⋅s/rad. Controls velocity-dependent resistance.
stiffness__Nm_per_rad (float, default=0.0) – Joint elastic stiffness in N⋅m/rad. Set to 0 for passive joints, >0 for spring-loaded joints.
initial_angle__deg (float, default=0.0) – Initial joint angle in degrees.
initial_velocity__deg_per_s (float, default=0.0) – Initial angular velocity in degrees per second.
Notes
JointDynamics uses plain
floatparameters (notquantities.Quantity) for the inertial/damping coefficients because no canonicalQuantity__kg_m2,Quantity__Nm_s_per_rad, orQuantity__deg_per_stype aliases exist inmyogen.utils.types. Values are interpreted as:inertia__kg_m2— rotational inertia in kg·m²damping__Nm_s_per_rad— viscous damping in N·m·s/radinitial_angle__deg— starting joint angle in degreesinitial_velocity__deg_per_s— starting angular velocity in degrees/second
Methods
Get current joint state.
Integrate joint dynamics for one time step.
Reset joint to initial conditions.
Attributes
Current joint angle in degrees.