isaaclab_newton.actuators#

Newton-native actuator drives.

DriveBam

BAM voltage-domain servo drive.

BAM Servo Drive#

class isaaclab_newton.actuators.DriveBam[source]#

Bases: DriveBase

BAM 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 NewtonBamDriveAPI token hides the drive from Newton’s schema discovery.

Attributes:

PER_DOF_PARAMS

Per-DOF parameter arrays, shape (N,) each.

backlash_pos_indices

Play-hinge coordinate indices, shape (N,).

external_torque

External gearbox load of the previous MJWarp solve [N.m], shape (N,).

env_dof_stride

DOFs per environment, which share one supply and one command-delay stream.

startup_settings

BAM settings the start-up sampling ran with, or None if it has not run.

friction_budget

Velocity-independent friction budget of the last step [N.m], shape (N,).

effective_vin

Supply voltage after sag of the last step [V], shape (N,).

motor_torque

Motor torque of the last step, before friction [N.m], shape (N,).

Classes:

State

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: State

Double-buffered per-DOF state of the BAM drive.

Attributes:

prev_motor_torque

Unclamped motor torque of the previous step, used for supply sag [N.m], shape (N,).

prev_applied_torque

Clamped effort of the previous step, used for friction [N.m], shape (N,).

delay_ring

Past position commands [rad or m], shape (N, max(max_delay, 1)).

delay_lag

Current command lag [physics steps], shape (N,).

delay_fill

Number of valid entries in delay_ring, shape (N,).

delay_step_count

Steps since the last reset, shape (N,).

delay_phase

Offset of the lag-resampling period per environment, shape (N,).

delay_rng_seed

Episode seed per environment, shape (N,).

delay_update_period

Lag-resampling period [physics steps].

env_dof_stride

DOFs sharing one command-delay stream.

delay_seed

Base seed of the lag and phase draws.

reset_count

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_lag: wp.array[wp.int32] | None = None#

Current command lag [physics steps], shape (N,).

delay_fill: wp.array[wp.int32] | None = None#

Number of valid entries in delay_ring, shape (N,).

delay_step_count: wp.array[wp.int32] | None = None#

Steps since the last reset, shape (N,).

delay_phase: wp.array[wp.int32] | None = None#

Offset of the lag-resampling period per environment, shape (N,).

delay_rng_seed: wp.array[wp.int32] | None = None#

Episode seed per environment, shape (N,).

delay_update_period: int = 0#

Lag-resampling period [physics steps].

env_dof_stride: int = 1#

DOFs sharing one command-delay stream.

delay_seed: int = 0#

Base seed of the lag and phase draws.

reset_count: int = 0#

Number of resets applied, which decorrelates successive episodes.

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 -inf keeps only the 0 V floor.

  • min_delay – Minimum command delay [physics steps].

  • max_delay – Maximum command delay [physics steps]. 0 disables the delay.

  • delay_hold_prob – Probability of keeping the current lag instead of resampling it.

  • delay_update_period – Physics steps between lag resamples. 0 resamples every step.

  • delay_seed – Base seed of the lag and phase draws.

  • per_dof – One (N,) array per entry of PER_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.

env_dof_stride: int#

DOFs per environment, which share one supply and one command-delay stream.

startup_settings: tuple | None#

BAM settings the start-up sampling ran with, or None if it has not run.

friction_budget: wp.array[float] | None#

Velocity-independent friction budget of the last step [N.m], shape (N,).

effective_vin: wp.array[float] | None#

Supply voltage after sag of the last step [V], shape (N,).

motor_torque: wp.array[float] | None#

Motor torque of the last step, before friction [N.m], shape (N,).