Skip to content

mdp

Modules:

Name Description
actions
events

Ground-mode modal-transition events.

observations
rewards

Classes:

Name Description
FlightActionMapper

Map batched normalized actions into controller targets, wrench, or RPM.

FlightMappingConfig

Mapping-range configuration for normalized action scaling.

Mixer

Map batched thrust and moment demands to rotor speed commands.

AerodynamicEffects

Compute drag, ground effect, and planar near-wall effect in batches.

AerodynamicEffectsCfg

Environment-specific aerodynamic-effect configuration.

VehicleParams

Generic multi-rotor vehicle physics.

RotorDynamics

Batched motor dynamics model for rotor thrust and torque.

FlightControlAction

Body torque control action term.

FlightControlActionCfg

See :class:FlightControlAction for more details.

DifferentialDriveController

PX4-style position/heading cascade with differential speed allocation.

DifferentialDriveActionMapper

Map normalized ground actions into differential controller targets.

DifferentialDriveMappingConfig

Policy-facing scaling for differential-drive controller modes.

GroundDriveActuatorAdapter

Batched yaw allocation, side limiting, and actuator command latency.

GroundDriveActuatorConfig

Nominal actuator response applied after differential allocation.

DifferentialDriveControlAction

Map selectable ground-control actions to drive-joint velocity targets.

DifferentialDriveControlActionCfg

Configuration for selectable differential-drive control.

Functions:

Name Description
randomize_action_term_attr

Randomize a selected action-term attribute.

randomize_ground_actuator_params

Randomize the ground actuator adapter attached to an action term.

hold_joint_position_target

Re-assert a fixed joint position target on reset.

scale_body_inertia

Apply scalar or per-axis Isaac inertia scales from the default tensor.

base_roll_pitch

Return roll and pitch without exposing task-irrelevant absolute yaw.

ground_velocity_commands

Return the controllable nonholonomic command channels: forward speed and yaw rate.

track_lin_vel_x_exp

Reward forward-speed tracking without treating lateral speed as a command.

lateral_velocity_l2

Penalize nonholonomic lateral slip separately from command tracking.

Attributes:

Name Type Description
ACTION_KEY_ORDER

Stable policy-action field order derived from the shared controller schema.

ACTION_KEY_ORDER module-attribute

ACTION_KEY_ORDER = tuple(ControllerState.__annotations__)

Stable policy-action field order derived from the shared controller schema.

Only fields present in the active control mask consume action slices.

FlightActionMapper

FlightActionMapper(control_mode: str, params: VehicleParams = VehicleParams(), mapping: FlightMappingConfig | None = None, control_mask: dict | None = None, num_envs: int = 1, device=None, *, backend: BackendName | None = None, xp: ModuleType | None = None)

Map batched normalized actions into controller targets, wrench, or RPM.

Initialize the batched action mapper and backend namespace.

Methods:

Name Description
randomize

Randomize.

action_to_collective_acc

Action to collective acc.

collective_acc_to_thrust

Collective acc to thrust.

action_to_collective_thrust

Action to collective thrust.

decode_action

Decode normalized batched action into a runtime-neutral control request.

map_action

Resolve normalized batched action into simulation rotor RPM commands.

Attributes:

Name Type Description
requires_controller bool

Requires controller.

requires_controller property

requires_controller: bool

Requires controller.

randomize

randomize(env_ids=None, randomization: dict | None = None)

Randomize.

action_to_collective_acc

action_to_collective_acc(action: ArrayLike, mixer) -> ArrayLike

Action to collective acc.

Returns:

Type Description
ArrayLike

The total collective acceleration array.

collective_acc_to_thrust

collective_acc_to_thrust(collective_acc: ArrayLike) -> ArrayLike

Collective acc to thrust.

Returns:

Type Description
ArrayLike

The total thrust array.

action_to_collective_thrust

action_to_collective_thrust(action: ArrayLike, mixer) -> ArrayLike

Action to collective thrust.

Returns:

Type Description
ArrayLike

The total thrust array.

decode_action

decode_action(action: ArrayLike, mixer, *, state: ControllerState | None = None) -> FlightMapping

Decode normalized batched action into a runtime-neutral control request.

Returns:

Type Description
FlightMapping

FlightMapping dictionary containing control requests.

Raises:

Type Description
ValueError

If state is missing when required for control mode.

map_action

map_action(action: ArrayLike, mixer, *, state: ControllerState | None = None, flight_controller: ControllerBase | None = None) -> FlightMapping

Resolve normalized batched action into simulation rotor RPM commands.

Returns:

Type Description
FlightMapping

FlightMapping dictionary containing RPM commands and wrench details.

Raises:

Type Description
ValueError

If flight_controller is missing for mapped modes.

FlightMappingConfig dataclass

FlightMappingConfig(velocity_range: tuple[float, float, float] | None = (3.0, 3.0, 1.5), acceleration_range: tuple[float, float, float] | None = (3.0, 3.0, 2.0), attitude_range: tuple[float, float, float] | None = None, body_rate_range: tuple[float, float, float] | None = (2.0, 2.0, 2.0), rel_rotation: bool = False, rotation_step_len: float | None = None)

Mapping-range configuration for normalized action scaling.

Methods:

Name Description
from_params

Build mapping ranges from vehicle parameters.

resolve

Resolve config overrides into concrete mapping ranges.

from_params classmethod

from_params(params: VehicleParams) -> FlightMappingConfig

Build mapping ranges from vehicle parameters.

Returns:

Type Description
FlightMappingConfig

Instantiated FlightMappingConfig object.

resolve

resolve(params: VehicleParams) -> FlightMappingConfig

Resolve config overrides into concrete mapping ranges.

Returns:

Type Description
FlightMappingConfig

Resolved FlightMappingConfig object.

Mixer

Mixer(params: VehicleParams = VehicleParams(), num_envs: int = 1, device=None, *, backend: BackendName | None = None, xp: ModuleType | None = None, allocation_mode: Literal['pinv', 'saturation'] = 'pinv')

Map batched thrust and moment demands to rotor speed commands.

The default "pinv" allocator applies direct pseudo-inverse allocation. "saturation" enables a staged trim strategy: roll/pitch authority is trimmed first if needed, and yaw authority is allocated from the remaining rotor-speed margin.

Initialize the mixer matrix and backend namespace.

Parameters:

Name Type Description Default

params

VehicleParams

Vehicle parameters used to build the allocation matrix.

VehicleParams()

num_envs

int

Number of parallel environments represented by the batch.

1

device

Optional backend device, mainly used by Torch.

None

backend

BackendName | None

Explicit Array API backend. If omitted, NumPy is used when device is None and Torch otherwise for compatibility.

None

xp

ModuleType | None

Pre-resolved Array API namespace. Overrides backend.

None

allocation_mode

Literal['pinv', 'saturation']

"pinv" for direct pseudo-inverse allocation or "saturation" for staged saturation-aware allocation.

'pinv'

Methods:

Name Description
randomize

Randomize mixer parameters for selected environments.

calculate_rotor_commands

Allocate [thrust, roll, pitch, yaw] controls to rotor RPM.

randomize

randomize(env_ids=None, randomization: dict | None = None)

Randomize mixer parameters for selected environments.

calculate_rotor_commands

calculate_rotor_commands(control: ArrayLike) -> ArrayLike

Allocate [thrust, roll, pitch, yaw] controls to rotor RPM.

Parameters:

Name Type Description Default

control

ArrayLike

Batched control array with shape (num_envs, 4).

required

Returns:

Type Description
ArrayLike

Batched rotor speed magnitudes with shape (num_envs, 4).

AerodynamicEffects

AerodynamicEffects(params: VehicleParams = VehicleParams(), cfg: AerodynamicEffectsCfg | None = None, num_envs: int = 1, num_rotors: int = 4, device=None, *, backend: BackendName | None = None, xp: ModuleType | None = None)

Compute drag, ground effect, and planar near-wall effect in batches.

Surface geometry is represented in each environment's local world frame. Rotor-force increments, body forces, and force telemetry are represented in the vehicle body frame. The model owns no simulator objects and can therefore be shared by NumPy, Torch, JAX, and CuPy callers.

Initialize coefficients, plane geometry, and telemetry buffers.

Parameters:

Name Type Description Default

params

VehicleParams

Vehicle physical and aerodynamic coefficients.

VehicleParams()

cfg

AerodynamicEffectsCfg | None

Environment-specific switches, wind, and plane geometry.

None

num_envs

int

Number of parallel simulation environments.

1

num_rotors

int

Number of rotors per environment.

4

device

Optional backend device, mainly used by Torch.

None

backend

BackendName | None

Explicit Array API backend name.

None

xp

ModuleType | None

Pre-resolved Array API namespace. Overrides backend.

None

Methods:

Name Description
randomize

Sample per-environment aerodynamic state for selected environments.

set_external_force

Set one shared or per-environment world-frame external force.

set_wall_plane

Set one shared or per-environment wall plane.

update

Compute rotor-force increments and root-body force for one simulation step.

Attributes:

Name Type Description
enabled bool

Whether any aerodynamic effect is enabled.

enabled property

enabled: bool

Whether any aerodynamic effect is enabled.

randomize

randomize(env_ids: ArrayLike | list[int] | slice | None = None, parameter_ranges: dict[str, tuple[ArrayLike, ArrayLike]] | None = None, effect_probabilities: dict[str, float] | None = None, effect_scale_ranges: dict[str, tuple[ArrayLike, ArrayLike]] | None = None) -> None

Sample per-environment aerodynamic state for selected environments.

Parameter ranges are absolute values rather than multipliers. Effect probabilities create exact per-episode on/off masks, while scale ranges multiply the corresponding computed force increment. If every optional argument is omitted, configuration is read from params.randomization["aerodynamics"].

Parameters:

Name Type Description Default

env_ids

ArrayLike | list[int] | slice | None

Environment indices to resample, or all environments.

None

parameter_ranges

dict[str, tuple[ArrayLike, ArrayLike]] | None

Absolute ranges for aerodynamic coefficients.

None

effect_probabilities

dict[str, float] | None

Bernoulli probability for each effect.

None

effect_scale_ranges

dict[str, tuple[ArrayLike, ArrayLike]] | None

Multiplicative force-scale range per effect.

None

Raises:

Type Description
ValueError

If a key, probability, or physical range is invalid.

set_external_force

set_external_force(external_force_w: ArrayLike) -> None

Set one shared or per-environment world-frame external force.

set_wall_plane

set_wall_plane(point_w: ArrayLike, normal_w: ArrayLike) -> None

Set one shared or per-environment wall plane.

Moving-surface scenarios can call this before :meth:update to update the analytic plane pose.

Raises:

Type Description
ValueError

If any wall normal is zero, near-zero, or non-finite.

update

update(rotor_thrusts: ArrayLike, rotor_positions_w: ArrayLike, rotor_axes_b: ArrayLike, body_velocity_b: ArrayLike, body_rotation_wb: ArrayLike) -> tuple[ArrayLike, ArrayLike]

Compute rotor-force increments and root-body force for one simulation step.

Parameters:

Name Type Description Default

rotor_thrusts

ArrayLike

Positive rotor thrust magnitudes, shape (N, R).

required

rotor_positions_w

ArrayLike

Rotor centers in environment-local world frame, shape (N, R, 3).

required

rotor_axes_b

ArrayLike

Rotor positive-thrust axes in vehicle body frame, shape (N, R, 3).

required

body_velocity_b

ArrayLike

Root-body velocity in the vehicle body frame, shape (N, 3).

required

body_rotation_wb

ArrayLike

Body-to-world rotation matrices, shape (N, 3, 3).

required

Returns:

Type Description
ArrayLike

Tuple of per-rotor vehicle-body-frame force increments (N, R, 3)

ArrayLike

and root-body-frame drag plus prescribed force (N, 3).

AerodynamicEffectsCfg dataclass

AerodynamicEffectsCfg(*, enable_drag: bool = False, enable_external_force: bool = False, enable_ground_effect: bool = False, enable_wall_effect: bool = False, external_force_w: tuple[float, float, float] = (0.0, 0.0, 0.0), ground_height: float = 0.0, max_ground_effect_gain: float = 2.0, wall_plane_point_w: tuple[float, float, float] = (0.0, 0.0, 0.0), wall_plane_normal_w: tuple[float, float, float] = (1.0, 0.0, 0.0), max_surface_distance: float = 5.0)

Environment-specific aerodynamic-effect configuration.

Plane coordinates use each simulator environment's local world frame. Effects default to disabled so existing tasks retain their current physics.

Attributes:

Name Type Description
enable_drag bool

Apply body-axis linear drag.

enable_external_force bool

Apply the configured world-frame external force.

enable_ground_effect bool

Augment per-rotor thrust near a horizontal ground plane.

enable_wall_effect bool

Apply per-rotor forces near the configured wall plane.

external_force_w tuple[float, float, float]

Constant environment-local world-frame external force (N).

ground_height float

Height of the analytic horizontal ground plane (m).

max_ground_effect_gain float

Maximum ground-effect thrust multiplier used near the model singularity.

wall_plane_point_w tuple[float, float, float]

One point on the analytic wall plane (m).

wall_plane_normal_w tuple[float, float, float]

Wall-plane unit-normal direction; either side of the plane is valid.

max_surface_distance float

Distance beyond which surface effects are exactly disabled (m).

enable_drag class-attribute instance-attribute

enable_drag: bool = False

Apply body-axis linear drag.

enable_external_force class-attribute instance-attribute

enable_external_force: bool = False

Apply the configured world-frame external force.

enable_ground_effect class-attribute instance-attribute

enable_ground_effect: bool = False

Augment per-rotor thrust near a horizontal ground plane.

enable_wall_effect class-attribute instance-attribute

enable_wall_effect: bool = False

Apply per-rotor forces near the configured wall plane.

external_force_w class-attribute instance-attribute

external_force_w: tuple[float, float, float] = (0.0, 0.0, 0.0)

Constant environment-local world-frame external force (N).

ground_height class-attribute instance-attribute

ground_height: float = 0.0

Height of the analytic horizontal ground plane (m).

max_ground_effect_gain class-attribute instance-attribute

max_ground_effect_gain: float = 2.0

Maximum ground-effect thrust multiplier used near the model singularity.

wall_plane_point_w class-attribute instance-attribute

wall_plane_point_w: tuple[float, float, float] = (0.0, 0.0, 0.0)

One point on the analytic wall plane (m).

wall_plane_normal_w class-attribute instance-attribute

wall_plane_normal_w: tuple[float, float, float] = (1.0, 0.0, 0.0)

Wall-plane unit-normal direction; either side of the plane is valid.

max_surface_distance class-attribute instance-attribute

max_surface_distance: float = 5.0

Distance beyond which surface effects are exactly disabled (m).

VehicleParams dataclass

VehicleParams(*, rho: float = 1.184, g: float = 9.81, sim_dt: float = 0.01, step_dt: float = 0.01, randomization: VehicleRandomization = VehicleRandomization(), mass: float = 2.1, inertia: list = (lambda: [[0.015, 0.0, 0.0], [0.0, 0.0348, 0.0], [0.0, 0.0, 0.042503]])(), x: float = 0.0952, y: float = 0.114423, h: float = -0.0125, alpha: float = math.radians(8.0), diameter: float = 0.476, drag_coefficients: tuple[float, float, float] = (0.1, 0.1, 0.1), ground_effect_k: float = 0.171, wall_effect_a1: float = 0.21, wall_effect_b1: float = 0.34, wall_effect_a2: float = 0.06, wall_effect_b2: float = 0.54, r_p: float = 0.0775, Ct: float = 0.666, Cq: float = 0.0716, theta0: float = math.radians(14.6), thetaTip: float = math.radians(6.8), theta1: float = math.nan, lock: float = 0.6051, cT: float = math.nan, cM: float = math.nan, spin_dir: tuple[float, float, float, float] = (1.0, 1.0, -1.0, -1.0), tau_f: float = 0.01, tau_m: float = 0.05, max_rpm: float = 10000.0, init_rpm: float = math.nan, rotor_rpm_rate_limit: float = 50000.0, tau_up: float = math.nan, tau_down: float = math.nan, mpc_xy_vel_max: float = 12.0, mpc_z_vel_max_up: float = 3.0, mpc_z_vel_max_dn: float = 1.5, mpc_acc_hor_max: float = 5.0, mpc_acc_up_max: float = 4.0, mpc_acc_down_max: float = 3.0, mpc_man_tilt_max: float = math.radians(35.0), mc_rollrate_max: float = math.radians(220.0), mc_pitchrate_max: float = math.radians(220.0), mc_yawrate_max: float = math.radians(200.0))

Generic multi-rotor vehicle physics.

The base class carries LAV2-compatible defaults for the shared multi-rotor parameters so that VehicleParams() continues to produce a working LAV2-flavoured flight configuration without the ground chassis (2.1 kg).

Concrete subclasses add robot-specific locomotion and geometry:

  • TrackVehicleParams — LAV2: tracked ground locomotion + ducted airframe
  • TiltWheelVehicleParams — ATMO: tilting arms + two side motors whose belt transmissions synchronize four wheel shells

Methods:

Name Description
__post_init__

Calculate derived parameters and resolve default sentinels.

Attributes:

Name Type Description
rho float

Air density (kg/m³).

g float

Gravitational acceleration (m/s²).

sim_dt float

Simulation time step (s).

step_dt float

Control time step (s).

randomization VehicleRandomization

Per-component runtime-randomization configuration.

mass float

Total vehicle mass (kg); concrete robot subclasses may override it.

inertia list

Vehicle inertia matrix at its center of mass (kg*m^2).

x float

Arm length in x — rotor moment-arm for roll (m).

y float

Arm length in y — rotor moment-arm for pitch (m).

h float

CG height below rotor plane (m, negative = below).

alpha float

Duct / rotor cant angle about y-axis (rad — 0 for flat rotors like ATMO).

diameter float

Overall vehicle diameter (m).

drag_coefficients tuple[float, float, float]

Linear body-axis drag coefficients (N·s/m).

ground_effect_k float

Empirical ground-effect distance coefficient for the target multirotor.

wall_effect_a1 float

Near-wall lateral-force amplitude fitted by Ding et al. (2023).

wall_effect_b1 float

Near-wall lateral-force exponential base fitted by Ding et al. (2023).

wall_effect_a2 float

Near-wall vertical-thrust amplitude fitted by Ding et al. (2023).

wall_effect_b2 float

Near-wall vertical-thrust exponential base fitted by Ding et al. (2023).

r_p float

Propeller radius (m).

Ct float

Thrust coefficient (blade-element).

Cq float

Torque coefficient (blade-element).

theta0 float

Blade root pitch angle (rad).

thetaTip float

Blade tip pitch angle (rad).

theta1 float

Blade twist (rad), defaults to theta0 - thetaTip.

lock float

Lock number.

cT float

Thrust coefficient T = cT·rpm² (N / rpm²); defaults from Ct.

cM float

Reaction-torque coefficient M = cM·rpm² (N·m / rpm²); defaults from Cq.

spin_dir tuple[float, float, float, float]

Rotor spin direction signs; + means clockwise, - means counter-clockwise.

tau_f float

Motor filter time constant (s).

tau_m float

Legacy motor time constant (s).

max_rpm float

Maximum rotor speed (rpm — LAV2 default).

init_rpm float

Initial rotor speed — defaults to 0.2·max_rpm.

rotor_rpm_rate_limit float

Rotor-speed rate-of-change limit (rpm/s).

tau_up float

Motor spin-up time constant (s), defaults to tau_m.

tau_down float

Motor spin-down time constant (s), defaults to tau_m.

mpc_xy_vel_max float

Maximum horizontal velocity setpoint magnitude in m/s (0 - 20).

mpc_z_vel_max_up float

Maximum upward velocity setpoint in m/s (0.5 - 8).

mpc_z_vel_max_dn float

Maximum downward velocity setpoint magnitude in m/s (0.5 - 4).

mpc_acc_hor_max float

Maximum horizontal acceleration setpoint magnitude in m/s^2 (2 - 15).

mpc_acc_up_max float

Maximum upward acceleration setpoint in m/s^2 (2 - 15).

mpc_acc_down_max float

Maximum downward acceleration setpoint magnitude in m/s^2 (2 - 15).

mpc_man_tilt_max float

Maximum manual tilt angle in radians (deg: 0 - 90).

mc_rollrate_max float

Maximum roll-rate setpoint in rad/s (deg/s: 0 - 1800).

mc_pitchrate_max float

Maximum pitch-rate setpoint in rad/s (deg/s: 0 - 1800).

mc_yawrate_max float

Maximum yaw-rate setpoint in rad/s (deg/s: 0 - 1800).

rho class-attribute instance-attribute

rho: float = 1.184

Air density (kg/m³).

g class-attribute instance-attribute

g: float = 9.81

Gravitational acceleration (m/s²).

sim_dt class-attribute instance-attribute

sim_dt: float = 0.01

Simulation time step (s).

step_dt class-attribute instance-attribute

step_dt: float = 0.01

Control time step (s).

randomization class-attribute instance-attribute

randomization: VehicleRandomization = field(default_factory=VehicleRandomization)

Per-component runtime-randomization configuration.

mass class-attribute instance-attribute

mass: float = 2.1

Total vehicle mass (kg); concrete robot subclasses may override it.

inertia class-attribute instance-attribute

inertia: list = field(default_factory=lambda: [[0.015, 0.0, 0.0], [0.0, 0.0348, 0.0], [0.0, 0.0, 0.042503]])

Vehicle inertia matrix at its center of mass (kg*m^2).

x class-attribute instance-attribute

x: float = 0.0952

Arm length in x — rotor moment-arm for roll (m).

y class-attribute instance-attribute

y: float = 0.114423

Arm length in y — rotor moment-arm for pitch (m).

h class-attribute instance-attribute

h: float = -0.0125

CG height below rotor plane (m, negative = below).

alpha class-attribute instance-attribute

alpha: float = math.radians(8.0)

Duct / rotor cant angle about y-axis (rad — 0 for flat rotors like ATMO).

diameter class-attribute instance-attribute

diameter: float = 0.476

Overall vehicle diameter (m).

drag_coefficients class-attribute instance-attribute

drag_coefficients: tuple[float, float, float] = (0.1, 0.1, 0.1)

Linear body-axis drag coefficients (N·s/m).

ground_effect_k class-attribute instance-attribute

ground_effect_k: float = 0.171

Empirical ground-effect distance coefficient for the target multirotor.

wall_effect_a1 class-attribute instance-attribute

wall_effect_a1: float = 0.21

Near-wall lateral-force amplitude fitted by Ding et al. (2023).

wall_effect_b1 class-attribute instance-attribute

wall_effect_b1: float = 0.34

Near-wall lateral-force exponential base fitted by Ding et al. (2023).

wall_effect_a2 class-attribute instance-attribute

wall_effect_a2: float = 0.06

Near-wall vertical-thrust amplitude fitted by Ding et al. (2023).

wall_effect_b2 class-attribute instance-attribute

wall_effect_b2: float = 0.54

Near-wall vertical-thrust exponential base fitted by Ding et al. (2023).

r_p class-attribute instance-attribute

r_p: float = 0.0775

Propeller radius (m).

Ct class-attribute instance-attribute

Ct: float = 0.666

Thrust coefficient (blade-element).

Cq class-attribute instance-attribute

Cq: float = 0.0716

Torque coefficient (blade-element).

theta0 class-attribute instance-attribute

theta0: float = math.radians(14.6)

Blade root pitch angle (rad).

thetaTip class-attribute instance-attribute

thetaTip: float = math.radians(6.8)

Blade tip pitch angle (rad).

theta1 class-attribute instance-attribute

theta1: float = math.nan

Blade twist (rad), defaults to theta0 - thetaTip.

lock class-attribute instance-attribute

lock: float = 0.6051

Lock number.

cT class-attribute instance-attribute

cT: float = math.nan

Thrust coefficient T = cT·rpm² (N / rpm²); defaults from Ct.

cM class-attribute instance-attribute

cM: float = math.nan

Reaction-torque coefficient M = cM·rpm² (N·m / rpm²); defaults from Cq.

spin_dir class-attribute instance-attribute

spin_dir: tuple[float, float, float, float] = (1.0, 1.0, -1.0, -1.0)

Rotor spin direction signs; + means clockwise, - means counter-clockwise.

LAV2 defaults to rotors 0/1 clockwise and 2/3 counter-clockwise, so the signs are (+,+,-,-).

tau_f class-attribute instance-attribute

tau_f: float = 0.01

Motor filter time constant (s).

tau_m class-attribute instance-attribute

tau_m: float = 0.05

Legacy motor time constant (s).

max_rpm class-attribute instance-attribute

max_rpm: float = 10000.0

Maximum rotor speed (rpm — LAV2 default).

init_rpm class-attribute instance-attribute

init_rpm: float = math.nan

Initial rotor speed — defaults to 0.2·max_rpm.

rotor_rpm_rate_limit class-attribute instance-attribute

rotor_rpm_rate_limit: float = 50000.0

Rotor-speed rate-of-change limit (rpm/s).

tau_up class-attribute instance-attribute

tau_up: float = math.nan

Motor spin-up time constant (s), defaults to tau_m.

tau_down class-attribute instance-attribute

tau_down: float = math.nan

Motor spin-down time constant (s), defaults to tau_m.

mpc_xy_vel_max class-attribute instance-attribute

mpc_xy_vel_max: float = 12.0

Maximum horizontal velocity setpoint magnitude in m/s (0 - 20).

mpc_z_vel_max_up class-attribute instance-attribute

mpc_z_vel_max_up: float = 3.0

Maximum upward velocity setpoint in m/s (0.5 - 8).

mpc_z_vel_max_dn class-attribute instance-attribute

mpc_z_vel_max_dn: float = 1.5

Maximum downward velocity setpoint magnitude in m/s (0.5 - 4).

mpc_acc_hor_max class-attribute instance-attribute

mpc_acc_hor_max: float = 5.0

Maximum horizontal acceleration setpoint magnitude in m/s^2 (2 - 15).

mpc_acc_up_max class-attribute instance-attribute

mpc_acc_up_max: float = 4.0

Maximum upward acceleration setpoint in m/s^2 (2 - 15).

mpc_acc_down_max class-attribute instance-attribute

mpc_acc_down_max: float = 3.0

Maximum downward acceleration setpoint magnitude in m/s^2 (2 - 15).

mpc_man_tilt_max class-attribute instance-attribute

mpc_man_tilt_max: float = math.radians(35.0)

Maximum manual tilt angle in radians (deg: 0 - 90).

mc_rollrate_max class-attribute instance-attribute

mc_rollrate_max: float = math.radians(220.0)

Maximum roll-rate setpoint in rad/s (deg/s: 0 - 1800).

mc_pitchrate_max class-attribute instance-attribute

mc_pitchrate_max: float = math.radians(220.0)

Maximum pitch-rate setpoint in rad/s (deg/s: 0 - 1800).

mc_yawrate_max class-attribute instance-attribute

mc_yawrate_max: float = math.radians(200.0)

Maximum yaw-rate setpoint in rad/s (deg/s: 0 - 1800).

__post_init__

__post_init__()

Calculate derived parameters and resolve default sentinels.

Raises:

Type Description
ValueError

If spin_dir does not contain four signs.

RotorDynamics

RotorDynamics(params: VehicleParams = VehicleParams(), num_envs: int = 1, device=None, *, backend: BackendName | None = None, xp: ModuleType | None = None)

Bases: DynamicsBase

Batched motor dynamics model for rotor thrust and torque.

This backend-agnostic Array API implementation keeps the same low-pass motor response, RPM rate limiting, quadratic thrust/torque coefficients, and motor-direction torque signs while operating on (num_envs, 4) batches.

Initialize rotor dynamics and backend arrays.

Parameters:

Name Type Description Default

params

VehicleParams

Vehicle parameters used by the motor model.

VehicleParams()

num_envs

int

Number of parallel environments represented by the batch.

1

device

Optional backend device, mainly used by Torch.

None

backend

BackendName | None

Explicit Array API backend name.

None

xp

ModuleType | None

Pre-resolved Array API namespace. Overrides backend.

None

Methods:

Name Description
randomize

Randomize motor parameters for selected environments.

update

Update motor state and return thrust/torque outputs.

reset

Reset selected environments to initial rotor speeds.

Attributes:

Name Type Description
params VehicleParams

Vehicle parameters for the dynamics model.

params instance-attribute

params: VehicleParams = params

Vehicle parameters for the dynamics model.

randomize

randomize(env_ids=None, randomization: dict[str, tuple[float, float]] | None = None)

Randomize motor parameters for selected environments.

update

update(commands: ArrayLike) -> ArrayLike

Update motor state and return thrust/torque outputs.

Parameters:

Name Type Description Default

commands

ArrayLike

Desired rotor speeds with shape (num_envs, 4).

required

Returns:

Type Description
ArrayLike

Batched thrusts followed by torques with shape (num_envs, 8).

reset

reset(env_ids=None)

Reset selected environments to initial rotor speeds.

FlightControlAction

FlightControlAction(cfg: FlightControlActionCfg, env: ManagerBasedRLEnv)

Bases: ActionTerm

Body torque control action term.

This action term applies a wrench to the drone body frame based on action commands

Attributes:

Name Type Description
cfg FlightControlActionCfg

The configuration of the action term.

aerodynamics AerodynamicEffects

Shared aerodynamic model and force telemetry.

IO_descriptor GenericActionIODescriptor

The IO descriptor of the LAV2 flight control action term.

cfg instance-attribute

cfg: FlightControlActionCfg = cfg

The configuration of the action term.

aerodynamics property

aerodynamics: AerodynamicEffects

Shared aerodynamic model and force telemetry.

IO_descriptor property

IO_descriptor: GenericActionIODescriptor

The IO descriptor of the LAV2 flight control action term.

FlightControlActionCfg

Bases: ActionTermCfg

See :class:FlightControlAction for more details.

Attributes:

Name Type Description
class_type type[ActionTerm]

Class of the action term.

asset_name str

Name of the asset in the environment for which the commands are generated.

rotor_body_names tuple[str, ...]

Ordered rotor body names matching controller/mixer rotor order.

root_body_name str | None

Body receiving drag and prescribed force; defaults to the articulation root.

params VehicleParams

Vehicle parameters.

gains dict | None

Optional gains configuration for the flight controller.

limits dict | None

Optional command-limit configuration passed directly to the flight controller.

controller str

Controller class name. Options: 'FlightController' (PID), 'GeoControl'.

control_mode str

Control mode, options: cmd_motor_thrusts, cmd_motor_speeds, cmd_ctbm, cmd_ctbr, cmd_ctatt, cmd_ctatt_euler, cmd_ctatt_quat, cmd_ctatt_rotmat, cmd_ctatt_rotvec, cmd_acc, cmd_vel, cmd_vel_ffacc, cmd_pos.

mapping FlightMappingConfig

Action-mapping range overrides resolved against params.

aerodynamics AerodynamicEffectsCfg

Optional drag, external-force, ground-effect, and wall configuration.

class_type class-attribute instance-attribute

class_type: type[ActionTerm] = FlightControlAction

Class of the action term.

asset_name class-attribute instance-attribute

asset_name: str = 'robot'

Name of the asset in the environment for which the commands are generated.

rotor_body_names class-attribute instance-attribute

rotor_body_names: tuple[str, ...] = ('rotor0', 'rotor1', 'rotor2', 'rotor3')

Ordered rotor body names matching controller/mixer rotor order.

root_body_name class-attribute instance-attribute

root_body_name: str | None = None

Body receiving drag and prescribed force; defaults to the articulation root.

params class-attribute instance-attribute

params: VehicleParams = VehicleParams()

Vehicle parameters.

gains class-attribute instance-attribute

gains: dict | None = None

Optional gains configuration for the flight controller.

limits class-attribute instance-attribute

limits: dict | None = None

Optional command-limit configuration passed directly to the flight controller.

controller class-attribute instance-attribute

controller: str = 'FlightController'

Controller class name. Options: 'FlightController' (PID), 'GeoControl'.

control_mode class-attribute instance-attribute

control_mode: str = 'cmd_motor_speeds'

Control mode, options: cmd_motor_thrusts, cmd_motor_speeds, cmd_ctbm, cmd_ctbr, cmd_ctatt, cmd_ctatt_euler, cmd_ctatt_quat, cmd_ctatt_rotmat, cmd_ctatt_rotvec, cmd_acc, cmd_vel, cmd_vel_ffacc, cmd_pos.

rotorpy ref: - https://github.com/spencerfolk/rotorpy/blob/main/rotorpy/learning/quadrotor_environments.py#L319C1-L350C12 - https://github.com/spencerfolk/rotorpy/blob/main/rotorpy/vehicles/multirotor.py#L997

TODO: also align control modes with px4, see: https://docs.px4.io/v1.14/en/flight_modes/offboard (version is unclear ATM)

mapping class-attribute instance-attribute

mapping: FlightMappingConfig = FlightMappingConfig()

Action-mapping range overrides resolved against params.

The default mapping is an intentional policy-facing behavior rather than a direct reflection of the parameter-derived controller ranges.

aerodynamics class-attribute instance-attribute

aerodynamics: AerodynamicEffectsCfg = AerodynamicEffectsCfg()

Optional drag, external-force, ground-effect, and wall configuration.

DifferentialDriveController

DifferentialDriveController(params: VehicleParams, control_mask: dict | None = None, gains: dict | None = None, limits: dict | None = None, num_envs: int = 1, device=None, *, backend: BackendName | None = None, xp: ModuleType | None = None)

Bases: ControllerBase

PX4-style position/heading cascade with differential speed allocation.

The output is [left, right] drive-shaft angular velocity in rad/s. The controller is independent of wheel count: a platform adapter commands one physical drive joint per side, while backend mechanical constraints synchronize any follower road wheels or wheel shells.

Initialize the batched differential-drive controller.

Methods:

Name Description
randomize

Randomize gains and limits for selected environments.

reset

Reset all PID state for selected environments.

update

Compute left/right drive-shaft angular-velocity targets in rad/s.

Attributes:

Name Type Description
params VehicleParams

Vehicle parameters for the controller.

params instance-attribute

params: VehicleParams = params

Vehicle parameters for the controller.

randomize

randomize(env_ids=None, gains: dict[str, Any] | None = None, limits: dict[str, Any] | None = None)

Randomize gains and limits for selected environments.

reset

reset(env_ids=None)

Reset all PID state for selected environments.

update

update(target: ControllerTarget, state: ControllerState) -> ArrayLike

Compute left/right drive-shaft angular-velocity targets in rad/s.

Returns:

Type Description
ArrayLike

The computed drive-shaft angular velocity array.

DifferentialDriveActionMapper

DifferentialDriveActionMapper(control_mode: str, params: VehicleParams, mapping: DifferentialDriveMappingConfig | None = None, control_mask: dict | None = None, num_envs: int = 1, device=None, *, backend: BackendName | None = None, xp: ModuleType | None = None)

Map normalized ground actions into differential controller targets.

Initialize the ground mapper and stable action-field indices.

Raises:

Type Description
ValueError

If mapping ranges or control mode is invalid.

Methods:

Name Description
decode_action

Decode a policy action into side speed or a controller target.

map_action

Resolve an action into left/right output-shaft speed targets.

Attributes:

Name Type Description
requires_controller bool

Whether this mode passes through the differential controller.

requires_controller property

requires_controller: bool

Whether this mode passes through the differential controller.

decode_action

decode_action(action: ArrayLike, *, state: ControllerState | None = None) -> DifferentialDriveMapping

Decode a policy action into side speed or a controller target.

Returns:

Type Description
DifferentialDriveMapping

DifferentialDriveMapping dictionary containing decoded action.

Raises:

Type Description
ValueError

If state is missing when required.

map_action

map_action(action: ArrayLike, *, state: ControllerState | None = None, controller: ControllerBase | None = None) -> DifferentialDriveMapping

Resolve an action into left/right output-shaft speed targets.

Returns:

Type Description
DifferentialDriveMapping

DifferentialDriveMapping dictionary containing side speed targets.

Raises:

Type Description
ValueError

If controller is missing when required.

DifferentialDriveMappingConfig dataclass

DifferentialDriveMappingConfig(forward_speed_range: float | None = None, yaw_rate_range: float | None = None, heading_range: float = pi, side_speed_range: float | None = None)

Policy-facing scaling for differential-drive controller modes.

Methods:

Name Description
from_params

Build mapping ranges from track or wheel platform parameters.

resolve

Resolve explicit overrides against platform-derived defaults.

from_params classmethod

from_params(params: VehicleParams) -> DifferentialDriveMappingConfig

Build mapping ranges from track or wheel platform parameters.

Returns:

Type Description
DifferentialDriveMappingConfig

Instantiated DifferentialDriveMappingConfig object.

Raises:

Type Description
TypeError

If params lacks track or wheel attributes.

resolve

resolve(params: VehicleParams) -> DifferentialDriveMappingConfig

Resolve explicit overrides against platform-derived defaults.

Returns:

Type Description
DifferentialDriveMappingConfig

Resolved DifferentialDriveMappingConfig object.

GroundDriveActuatorAdapter

GroundDriveActuatorAdapter(*, physics_dt: float, side_speed_limit: float, config: GroundDriveActuatorConfig, num_envs: int = 1, device=None, backend: BackendName | None = None, xp: ModuleType | None = None)

Batched yaw allocation, side limiting, and actuator command latency.

Build an Array API adapter for one fixed-rate physics loop.

Methods:

Name Description
randomize

Randomize selected actuator parameters as nominal-relative scales.

reset

Clear actuator command state for selected environments.

update

Return the physical-side target for the current physics step.

Attributes:

Name Type Description
side_gain ArrayLike

Current left/right gain samples.

side_gain property

side_gain: ArrayLike

Current left/right gain samples.

randomize

randomize(env_ids=None, randomization: dict[str, tuple[float, float] | float] | None = None) -> None

Randomize selected actuator parameters as nominal-relative scales.

reset

reset(env_ids=None) -> None

Clear actuator command state for selected environments.

update

update(targets: ArrayLike, *, apply_yaw_compensation: bool = True) -> ArrayLike

Return the physical-side target for the current physics step.

GroundDriveActuatorConfig dataclass

GroundDriveActuatorConfig(yaw_allocation_scale: float = 1.0, left_gain: float = 1.0, right_gain: float = 1.0, left_delay_s: float = 0.0, right_delay_s: float = 0.0)

Nominal actuator response applied after differential allocation.

DifferentialDriveControlAction

DifferentialDriveControlAction(cfg: DifferentialDriveControlActionCfg, env: ManagerBasedRLEnv)

Bases: ActionTerm

Map selectable ground-control actions to drive-joint velocity targets.

Attributes:

Name Type Description
ideal_side_speed_targets Tensor

Controller output before Isaac-specific allocation and latency.

applied_side_speed_targets Tensor

Side targets after allocation/gain and before actuator latency.

sampled_actuator_parameters dict[str, Tensor]

Expose per-environment samples for episode diagnostics.

IO_descriptor GenericActionIODescriptor

Describe policy channels for the selected ground-control mode.

ideal_side_speed_targets property

ideal_side_speed_targets: Tensor

Controller output before Isaac-specific allocation and latency.

applied_side_speed_targets property

applied_side_speed_targets: Tensor

Side targets after allocation/gain and before actuator latency.

sampled_actuator_parameters property

sampled_actuator_parameters: dict[str, Tensor]

Expose per-environment samples for episode diagnostics.

IO_descriptor property

IO_descriptor: GenericActionIODescriptor

Describe policy channels for the selected ground-control mode.

DifferentialDriveControlActionCfg

Bases: ActionTermCfg

Configuration for selectable differential-drive control.

randomize_action_term_attr

randomize_action_term_attr(env: ManagerBasedEnv, env_ids: Tensor | None, action_term_name: str = 'flight_control_action', attr_name: str = '_flight_controller', **kwargs) -> None

Randomize a selected action-term attribute.

randomize_ground_actuator_params

randomize_ground_actuator_params(env: ManagerBasedRLEnv, env_ids, action_term_name: str = 'ground_control_action', actuator_attr: str = '_actuator_adapter', param_range: dict[str, tuple[float, float] | float] | None = None) -> None

Randomize the ground actuator adapter attached to an action term.

hold_joint_position_target

hold_joint_position_target(env: ManagerBasedRLEnv, env_ids, target_pos: float, joint_names: list[str], asset_cfg: SceneEntityCfg = SceneEntityCfg('robot')) -> None

Re-assert a fixed joint position target on reset.

ArticulationCfg.InitialStateCfg.joint_pos sets the initial joint state, not the actuator target. For joints driven by a stiff position actuator that are not policy-controlled — e.g. ATMO's base_to_arm[l,r] locked at 90 deg for the ground-mode modal transition — the drive target defaults to 0 and the actuator yanks the joint out of its init pose (arms snap back to the 0-deg flight pose, dropping the chassis onto the ground). This event writes the position target back to target_pos each reset so the actuator holds the configured pose for the episode; the target persists across steps because the action manager never commands these joints.

scale_body_inertia

scale_body_inertia(env: ManagerBasedRLEnv, env_ids, scale: float | tuple[float, float] | tuple[tuple[float, float], tuple[float, float], tuple[float, float]], asset_cfg: SceneEntityCfg = SceneEntityCfg('robot')) -> None

Apply scalar or per-axis Isaac inertia scales from the default tensor.

base_roll_pitch

base_roll_pitch(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg('robot')) -> torch.Tensor

Return roll and pitch without exposing task-irrelevant absolute yaw.

ground_velocity_commands

ground_velocity_commands(env: ManagerBasedRLEnv, command_name: str) -> torch.Tensor

Return the controllable nonholonomic command channels: forward speed and yaw rate.

track_lin_vel_x_exp

track_lin_vel_x_exp(env: ManagerBasedRLEnv, std: float, command_name: str, asset_cfg: SceneEntityCfg = SceneEntityCfg('robot')) -> torch.Tensor

Reward forward-speed tracking without treating lateral speed as a command.

lateral_velocity_l2

lateral_velocity_l2(env: ManagerBasedRLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg('robot')) -> torch.Tensor

Penalize nonholonomic lateral slip separately from command tracking.