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.

cfg instance-attribute

cfg: FlightControlActionCfg = cfg

The configuration of the action term.

FlightControlActionCfg dataclass

FlightControlActionCfg(*, class_type: type[ActionTerm] = FlightControlAction, entity_name: str = 'robot', actuator_names: tuple[str, ...] = ('thrust0', 'thrust1', 'thrust2', 'thrust3', 'torque0', 'torque1', 'torque2', 'torque3'), params: VehicleParams = VehicleParams(), gains: dict | None = None, limits: dict | None = None, controller: str = 'FlightController', control_mode: str = 'cmd_motor_speeds', mapping: FlightMappingConfig = FlightMappingConfig())

Bases: ActionTermCfg

See :class:FlightControlAction for more details.

Attributes:

Name Type Description
class_type type[ActionTerm]

Class of the action term.

entity_name str

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

actuator_names tuple[str, ...]

Ordered rotor wrench actuator names matching RotorDynamics.update() output.

params VehicleParams

Vehicle parameters.

gains dict | None

Optional gains configuration for the flight controller. See FlightController for details.

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

entity_name class-attribute instance-attribute

entity_name: str = 'robot'

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

actuator_names class-attribute instance-attribute

actuator_names: tuple[str, ...] = ('thrust0', 'thrust1', 'thrust2', 'thrust3', 'torque0', 'torque1', 'torque2', 'torque3')

Ordered rotor wrench actuator names matching RotorDynamics.update() output.

params class-attribute instance-attribute

params: VehicleParams = field(default_factory=VehicleParams)

Vehicle parameters.

gains class-attribute instance-attribute

gains: dict | None = None

Optional gains configuration for the flight controller. See FlightController for details.

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

mapping class-attribute instance-attribute

mapping: FlightMappingConfig = field(default_factory=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.