跳转至

mdp

模块:

名称 描述
rewards

类:

名称 描述
HelixTrajectory

Batched helix trajectory.

LemniscateTrajectory

Batched Bernoulli lemniscate trajectory.

LissajousTrajectory

Batched three-dimensional Lissajous trajectory.

RectangleTrajectory

Batched constant-speed rectangle trajectory in the horizontal plane.

RandomTrajectoryCommand

Trajectory command generator with randomized type and parameters per environment.

RandomTrajectoryCommandCfg

Configuration for randomized trajectory commands.

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.

DifferentialDriveControlAction

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

DifferentialDriveControlActionCfg

Configuration for selectable differential-drive control.

函数:

名称 描述
root_euler_w

Euler angles of the root in world frame.

planar_pos_error_tanh

Reward XY position tracking without constraining ground-contact height.

track_trajectory_ang_vel_z_exp

Reward yaw-rate tracking for trajectory commands with yaw at index three.

属性:

名称 类型 描述
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.

HelixTrajectory dataclass

HelixTrajectory(*, num_envs: int = 1, device: str | None = None, backend: BackendName | None = None, xp: ModuleType | None = None, initialize: bool = True, yaw_from_velocity: bool = True, fixed_yaw: ArrayLike | float = 0.0, attitude: ArrayLike | tuple[float, float] = (0.0, 0.0), body_rate: ArrayLike | tuple[float, float] = (0.0, 0.0), center: ArrayLike | tuple[float, float, float] = (0.0, 0.0, 1.0), radius: ArrayLike | float = 1.0, omega: ArrayLike | float = 0.5, z_amplitude: ArrayLike | float = 0.0, z_frequency: ArrayLike | float = 1.0, z_phase: ArrayLike | float = 0.0)

Bases: SpatialTrajectory

Batched helix trajectory.

方法:

名称 描述
sample_heading

Sample batched yaw and yaw-rate references for time values t.

build_target

Assemble a batched dict target from motion primitives.

__post_init__

Initialize HelixTrajectory.

sample

Sample the helix at time t.

sample_heading

sample_heading(t: ArrayLike, pos: ArrayLike, vel: ArrayLike, acc: ArrayLike) -> tuple[ArrayLike, ArrayLike]

Sample batched yaw and yaw-rate references for time values t.

build_target

build_target(t: ArrayLike, pos: ArrayLike, vel: ArrayLike, acc: ArrayLike) -> ControllerTarget

Assemble a batched dict target from motion primitives.

__post_init__

__post_init__()

Initialize HelixTrajectory.

sample

sample(t: ArrayLike) -> ControllerTarget

Sample the helix at time t.

LemniscateTrajectory dataclass

LemniscateTrajectory(*, num_envs: int = 1, device: str | None = None, backend: BackendName | None = None, xp: ModuleType | None = None, initialize: bool = True, yaw_from_velocity: bool = True, fixed_yaw: ArrayLike | float = 0.0, attitude: ArrayLike | tuple[float, float] = (0.0, 0.0), body_rate: ArrayLike | tuple[float, float] = (0.0, 0.0), center: ArrayLike | tuple[float, float, float] = (0.0, 0.0, 1.0), scale: ArrayLike | float = 1.0, omega: ArrayLike | float = 0.5, z_amplitude: ArrayLike | float = 0.0, z_frequency: ArrayLike | float = 1.0, z_phase: ArrayLike | float = 0.0)

Bases: SpatialTrajectory

Batched Bernoulli lemniscate trajectory.

方法:

名称 描述
sample_heading

Sample batched yaw and yaw-rate references for time values t.

build_target

Assemble a batched dict target from motion primitives.

__post_init__

Initialize LemniscateTrajectory.

sample

Sample the lemniscate at time t.

sample_heading

sample_heading(t: ArrayLike, pos: ArrayLike, vel: ArrayLike, acc: ArrayLike) -> tuple[ArrayLike, ArrayLike]

Sample batched yaw and yaw-rate references for time values t.

build_target

build_target(t: ArrayLike, pos: ArrayLike, vel: ArrayLike, acc: ArrayLike) -> ControllerTarget

Assemble a batched dict target from motion primitives.

__post_init__

__post_init__()

Initialize LemniscateTrajectory.

sample

sample(t: ArrayLike) -> ControllerTarget

Sample the lemniscate at time t.

LissajousTrajectory dataclass

LissajousTrajectory(*, num_envs: int = 1, device: str | None = None, backend: BackendName | None = None, xp: ModuleType | None = None, initialize: bool = True, yaw_from_velocity: bool = True, fixed_yaw: ArrayLike | float = 0.0, attitude: ArrayLike | tuple[float, float] = (0.0, 0.0), body_rate: ArrayLike | tuple[float, float] = (0.0, 0.0), center: ArrayLike | tuple[float, float, float] = (0.0, 0.0, 1.0), amplitude: ArrayLike | tuple[float, float, float] = (1.0, 1.0, 0.2), frequency: ArrayLike | tuple[float, float, float] = (1.0, 2.0, 0.5), phase: ArrayLike | tuple[float, float, float] = (0.0, 0.0, 0.0), omega: ArrayLike | float = 0.5)

Bases: SpatialTrajectory

Batched three-dimensional Lissajous trajectory.

方法:

名称 描述
sample_heading

Sample batched yaw and yaw-rate references for time values t.

build_target

Assemble a batched dict target from motion primitives.

__post_init__

Initialize LissajousTrajectory.

sample

Sample the Lissajous trajectory at time t.

sample_heading

sample_heading(t: ArrayLike, pos: ArrayLike, vel: ArrayLike, acc: ArrayLike) -> tuple[ArrayLike, ArrayLike]

Sample batched yaw and yaw-rate references for time values t.

build_target

build_target(t: ArrayLike, pos: ArrayLike, vel: ArrayLike, acc: ArrayLike) -> ControllerTarget

Assemble a batched dict target from motion primitives.

__post_init__

__post_init__()

Initialize LissajousTrajectory.

sample

sample(t: ArrayLike) -> ControllerTarget

Sample the Lissajous trajectory at time t.

RectangleTrajectory dataclass

RectangleTrajectory(*, num_envs: int = 1, device: str | None = None, backend: BackendName | None = None, xp: ModuleType | None = None, initialize: bool = True, yaw_from_velocity: bool = True, fixed_yaw: ArrayLike | float = 0.0, attitude: ArrayLike | tuple[float, float] = (0.0, 0.0), body_rate: ArrayLike | tuple[float, float] = (0.0, 0.0), center: ArrayLike | tuple[float, float, float] = (0.0, 0.0, 1.0), size: ArrayLike | tuple[float, float] = (2.0, 1.0), speed: ArrayLike | float = 0.5)

Bases: SpatialTrajectory

Batched constant-speed rectangle trajectory in the horizontal plane.

方法:

名称 描述
sample_heading

Sample batched yaw and yaw-rate references for time values t.

build_target

Assemble a batched dict target from motion primitives.

__post_init__

Initialize RectangleTrajectory.

sample

Sample the rectangle trajectory at time t.

sample_heading

sample_heading(t: ArrayLike, pos: ArrayLike, vel: ArrayLike, acc: ArrayLike) -> tuple[ArrayLike, ArrayLike]

Sample batched yaw and yaw-rate references for time values t.

build_target

build_target(t: ArrayLike, pos: ArrayLike, vel: ArrayLike, acc: ArrayLike) -> ControllerTarget

Assemble a batched dict target from motion primitives.

__post_init__

__post_init__()

Initialize RectangleTrajectory.

sample

sample(t: ArrayLike) -> ControllerTarget

Sample the rectangle trajectory at time t.

RandomTrajectoryCommand

RandomTrajectoryCommand(cfg: RandomTrajectoryCommandCfg, env: ManagerBasedEnv)

Bases: CommandTerm

Trajectory command generator with randomized type and parameters per environment.

RandomTrajectoryCommandCfg

Bases: CommandTermCfg

Configuration for randomized trajectory commands.

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.

方法:

名称 描述
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.

属性:

名称 类型 描述
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.

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.

方法:

名称 描述
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.

属性:

名称 类型 描述
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.

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.

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.

方法:

名称 描述
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.

resolve

resolve(params: VehicleParams) -> DifferentialDriveMappingConfig

Resolve explicit overrides against platform-derived defaults.

DifferentialDriveControlAction

DifferentialDriveControlAction(cfg: DifferentialDriveControlActionCfg, env: ManagerBasedRLEnv)

Bases: ActionTerm

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

属性:

名称 类型 描述
IO_descriptor GenericActionIODescriptor

Describe policy channels for the selected ground-control mode.

IO_descriptor property

IO_descriptor: GenericActionIODescriptor

Describe policy channels for the selected ground-control mode.

DifferentialDriveControlActionCfg

Bases: ActionTermCfg

Configuration for selectable differential-drive control.

root_euler_w

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

Euler angles of the root in world frame.

planar_pos_error_tanh

planar_pos_error_tanh(env: ManagerBasedRLEnv, std: float, command_name: str) -> torch.Tensor

Reward XY position tracking without constraining ground-contact height.

track_trajectory_ang_vel_z_exp

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

Reward yaw-rate tracking for trajectory commands with yaw at index three.