isaaclab_newton.actuators#
Newton-native actuator drives.
BAM voltage-domain servo drive. |
BAM Servo Drive#
- class isaaclab_newton.actuators.DriveBam[source]#
Bases:
DriveBaseBAM voltage-domain servo drive.
Each step delays the position command, sags the supply, runs the firmware proportional loop to a PWM duty cycle, converts it to motor torque, and publishes the gearbox friction budget that MJWarp applies as a constraint. Only the position target is consumed.
The drive clamps its own effort: authoring a registered clamping schema next to the unregistered
NewtonBamDriveAPItoken hides the drive from Newton’s schema discovery.Attributes:
Per-DOF parameter arrays, shape
(N,)each.Play-hinge coordinate indices, shape
(N,).External gearbox load of the previous MJWarp solve [N.m], shape
(N,).DOFs per environment, which share one supply and one command-delay stream.
BAM settings the start-up sampling ran with, or None if it has not run.
Velocity-independent friction budget of the last step [N.m], shape
(N,).Supply voltage after sag of the last step [V], shape
(N,).Motor torque of the last step, before friction [N.m], shape
(N,).Classes:
Double-buffered per-DOF state of the BAM drive.
Methods:
resolve_arguments(args)Resolve shared settings and per-DOF coefficients from a USD actuator prim.
__init__(*[, has_backlash, stribeck, ...])Initialize the drive from Newton's resolved arguments.
- PER_DOF_PARAMS: ClassVar[tuple[str, ...]] = ('kp_fw', 'kp_scale', 'kd_scale', 'vin', 'sag_gain', 'friction_scale', 'kt', 'resistance', 'error_gain', 'max_pwm', 'max_current', 'friction_base', 'friction_stribeck', 'dtheta_stribeck', 'alpha', 'load_friction_motor', 'load_friction_external', 'load_friction_motor_stribeck', 'load_friction_external_stribeck', 'load_friction_motor_quad', 'load_friction_external_quad', 'max_effort')#
Per-DOF parameter arrays, shape
(N,)each.
- class State[source]#
Bases:
StateDouble-buffered per-DOF state of the BAM drive.
Attributes:
Unclamped motor torque of the previous step, used for supply sag [N.m], shape
(N,).Clamped effort of the previous step, used for friction [N.m], shape
(N,).Past position commands [rad or m], shape
(N, max(max_delay, 1)).Current command lag [physics steps], shape
(N,).Number of valid entries in
delay_ring, shape(N,).Steps since the last reset, shape
(N,).Offset of the lag-resampling period per environment, shape
(N,).Episode seed per environment, shape
(N,).Lag-resampling period [physics steps].
DOFs sharing one command-delay stream.
Base seed of the lag and phase draws.
Number of resets applied, which decorrelates successive episodes.
Methods:
assign(other)Copy another state into this one, keeping this state's array storage.
__init__([prev_motor_torque, ...])- prev_motor_torque: wp.array[float] | None = None#
Unclamped motor torque of the previous step, used for supply sag [N.m], shape
(N,).
- prev_applied_torque: wp.array[float] | None = None#
Clamped effort of the previous step, used for friction [N.m], shape
(N,).
- delay_ring: wp.array2d[float] | None = None#
Past position commands [rad or m], shape
(N, max(max_delay, 1)).
- delay_fill: wp.array[wp.int32] | None = None#
Number of valid entries in
delay_ring, shape(N,).
- delay_phase: wp.array[wp.int32] | None = None#
Offset of the lag-resampling period per environment, shape
(N,).
- assign(other: State) None[source]#
Copy another state into this one, keeping this state’s array storage.
- __init__(prev_motor_torque: wp.array[float] | None = None, prev_applied_torque: wp.array[float] | None = None, delay_ring: wp.array2d[float] | None = None, delay_lag: wp.array[wp.int32] | None = None, delay_fill: wp.array[wp.int32] | None = None, delay_step_count: wp.array[wp.int32] | None = None, delay_phase: wp.array[wp.int32] | None = None, delay_rng_seed: wp.array[wp.int32] | None = None, delay_update_period: int = 0, env_dof_stride: int = 1, delay_seed: int = 0, reset_count: int = 0) None#
- classmethod resolve_arguments(args: dict[str, Any]) dict[str, Any][source]#
Resolve shared settings and per-DOF coefficients from a USD actuator prim.
- Parameters:
args¶ – Authored attribute values, keyed by snake-case name.
- Returns:
Shared settings and per-DOF coefficients.
- Raises:
ValueError – If names are unknown, coefficients are missing, or delays are invalid.
- __init__(*, has_backlash: int = 0, stribeck: int = 0, load_dependent: int = 0, quadratic: int = 0, vin_min: float = -inf, min_delay: int = 0, max_delay: int = 0, delay_hold_prob: float = 0.0, delay_update_period: int = 0, delay_seed: int = 0, **per_dof: warp.array)[source]#
Initialize the drive from Newton’s resolved arguments.
- Parameters:
has_backlash¶ – Whether the encoder reads through a passive play hinge.
stribeck¶ – Whether the Stribeck friction terms are active.
load_dependent¶ – Whether gearbox friction grows with the transmitted torque.
quadratic¶ – Whether the quadratic load-coupling term is active.
vin_min¶ – Lower bound on the sagged supply voltage [V]. The default
-infkeeps only the 0 V floor.min_delay¶ – Minimum command delay [physics steps].
max_delay¶ – Maximum command delay [physics steps].
0disables the delay.delay_hold_prob¶ – Probability of keeping the current lag instead of resampling it.
delay_update_period¶ – Physics steps between lag resamples.
0resamples every step.delay_seed¶ – Base seed of the lag and phase draws.
per_dof¶ – One
(N,)array per entry ofPER_DOF_PARAMS.
- backlash_pos_indices: wp.array[wp.uint32] | None#
Play-hinge coordinate indices, shape
(N,). Bound before stepping for backlash drives.
- external_torque: wp.array[float] | None#
External gearbox load of the previous MJWarp solve [N.m], shape
(N,). Bound by the MJWarp bridge.
- startup_settings: tuple | None#
BAM settings the start-up sampling ran with, or None if it has not run.