Skip to content

actions

Classes:

Name Description
FlightControlAction

Body torque control action term.

FlightControlActionCfg

See :class:FlightControlAction for more details.

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.

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.

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.

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_pos.

mapping FlightMappingConfig

Action-mapping range overrides resolved against params.

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.

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_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.