跳转至

trajectories

Trajectory implementations package for LAV2.

模块:

名称 描述
base

NumPy trajectory base classes.

helix

NumPy helix trajectory implementation.

hover_step

NumPy piecewise hover-step trajectory implementation.

lemniscate

NumPy lemniscate trajectory implementation.

lissajous

NumPy Lissajous trajectory implementation.

rectangle

NumPy rectangle trajectory implementation.

torch

Torch trajectory implementations for batched RL environments.

类:

名称 描述
BaseTrajectory

Abstract base class for time-parameterized NumPy reference trajectories.

SpatialTrajectory

Base class for trajectories centered around a world-frame anchor point.

HelixTrajectory

Helix trajectory with optional vertical oscillation.

HoverStepTrajectory

Piecewise-constant position and yaw trajectory.

LemniscateTrajectory

Bernoulli lemniscate trajectory with optional vertical oscillation.

LissajousTrajectory

Three-dimensional Lissajous trajectory.

RectangleTrajectory

Constant-speed rectangle trajectory in the horizontal plane.

BaseTrajectory dataclass

BaseTrajectory(yaw_from_velocity: bool = True, fixed_yaw: float = 0.0, attitude: tuple[float, float] = (0.0, 0.0), body_rate: tuple[float, float] = (0.0, 0.0))

Bases: ABC

Abstract base class for time-parameterized NumPy reference trajectories.

方法:

名称 描述
sample_heading

Sample yaw and yaw-rate references for time t and translation state.

build_target

Assemble a full 12D target from position, velocity, and acceleration.

sample

Sample the full 12D target at time t.

sample_batch

Sample a batch of timestamps and stack the resulting 12D targets.

sample_heading

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

Sample yaw and yaw-rate references for time t and translation state.

build_target

build_target(t: float, pos: ndarray, vel: ndarray, acc: ndarray) -> np.ndarray

Assemble a full 12D target from position, velocity, and acceleration.

sample abstractmethod

sample(t: float) -> np.ndarray

Sample the full 12D target at time t.

sample_batch

sample_batch(ts: ndarray) -> np.ndarray

Sample a batch of timestamps and stack the resulting 12D targets.

SpatialTrajectory dataclass

SpatialTrajectory(yaw_from_velocity: bool = True, fixed_yaw: float = 0.0, attitude: tuple[float, float] = (0.0, 0.0), body_rate: tuple[float, float] = (0.0, 0.0), center: tuple[float, float, float] = (0.0, 0.0, 1.0))

Bases: BaseTrajectory

Base class for trajectories centered around a world-frame anchor point.

方法:

名称 描述
sample_heading

Sample yaw and yaw-rate references for time t and translation state.

build_target

Assemble a full 12D target from position, velocity, and acceleration.

sample

Sample the full 12D target at time t.

sample_batch

Sample a batch of timestamps and stack the resulting 12D targets.

__post_init__

Cache the trajectory center as a float32 NumPy vector.

sample_heading

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

Sample yaw and yaw-rate references for time t and translation state.

build_target

build_target(t: float, pos: ndarray, vel: ndarray, acc: ndarray) -> np.ndarray

Assemble a full 12D target from position, velocity, and acceleration.

sample abstractmethod

sample(t: float) -> np.ndarray

Sample the full 12D target at time t.

sample_batch

sample_batch(ts: ndarray) -> np.ndarray

Sample a batch of timestamps and stack the resulting 12D targets.

__post_init__

__post_init__()

Cache the trajectory center as a float32 NumPy vector.

HelixTrajectory dataclass

HelixTrajectory(yaw_from_velocity: bool = True, fixed_yaw: float = 0.0, attitude: tuple[float, float] = (0.0, 0.0), body_rate: tuple[float, float] = (0.0, 0.0), center: tuple[float, float, float] = (0.0, 0.0, 1.0), radius: float = 1.0, omega: float = 0.5, z_amplitude: float = 0.0, z_frequency: float = 1.0, z_phase: float = 0.0)

Bases: SpatialTrajectory

Helix trajectory with optional vertical oscillation.

方法:

名称 描述
sample_heading

Sample yaw and yaw-rate references for time t and translation state.

build_target

Assemble a full 12D target from position, velocity, and acceleration.

sample_batch

Sample a batch of timestamps and stack the resulting 12D targets.

__post_init__

Cache the trajectory center as a float32 NumPy vector.

sample

Sample the helix trajectory at time t.

sample_heading

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

Sample yaw and yaw-rate references for time t and translation state.

build_target

build_target(t: float, pos: ndarray, vel: ndarray, acc: ndarray) -> np.ndarray

Assemble a full 12D target from position, velocity, and acceleration.

sample_batch

sample_batch(ts: ndarray) -> np.ndarray

Sample a batch of timestamps and stack the resulting 12D targets.

__post_init__

__post_init__()

Cache the trajectory center as a float32 NumPy vector.

sample

sample(t: float) -> np.ndarray

Sample the helix trajectory at time t.

HoverStepTrajectory dataclass

HoverStepTrajectory(yaw_from_velocity: bool = False, fixed_yaw: float = 0.0, attitude: tuple[float, float] = (0.0, 0.0), body_rate: tuple[float, float] = (0.0, 0.0), initial: tuple[float, float, float, float] = (0.0, 0.0, 1.0, 0.0), steps: tuple[tuple[float, tuple[float, float, float, float]], ...] = ((5.0, (1.0, 0.0, 1.0, 0.0)), (10.0, (1.0, 1.0, 1.5, np.pi / 2.0)), (15.0, (0.0, 1.0, 1.5, np.pi))))

Bases: BaseTrajectory

Piecewise-constant position and yaw trajectory.

方法:

名称 描述
sample_heading

Sample yaw and yaw-rate references for time t and translation state.

build_target

Assemble a full 12D target from position, velocity, and acceleration.

sample_batch

Sample a batch of timestamps and stack the resulting 12D targets.

sample

Sample the active hover target at time t.

sample_heading

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

Sample yaw and yaw-rate references for time t and translation state.

build_target

build_target(t: float, pos: ndarray, vel: ndarray, acc: ndarray) -> np.ndarray

Assemble a full 12D target from position, velocity, and acceleration.

sample_batch

sample_batch(ts: ndarray) -> np.ndarray

Sample a batch of timestamps and stack the resulting 12D targets.

sample

sample(t: float) -> np.ndarray

Sample the active hover target at time t.

LemniscateTrajectory dataclass

LemniscateTrajectory(yaw_from_velocity: bool = True, fixed_yaw: float = 0.0, attitude: tuple[float, float] = (0.0, 0.0), body_rate: tuple[float, float] = (0.0, 0.0), center: tuple[float, float, float] = (0.0, 0.0, 1.0), scale: float = 1.0, omega: float = 0.5, z_amplitude: float = 0.0, z_frequency: float = 1.0, z_phase: float = 0.0)

Bases: SpatialTrajectory

Bernoulli lemniscate trajectory with optional vertical oscillation.

方法:

名称 描述
sample_heading

Sample yaw and yaw-rate references for time t and translation state.

build_target

Assemble a full 12D target from position, velocity, and acceleration.

sample_batch

Sample a batch of timestamps and stack the resulting 12D targets.

__post_init__

Cache the trajectory center as a float32 NumPy vector.

sample

Sample the lemniscate trajectory at time t.

sample_heading

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

Sample yaw and yaw-rate references for time t and translation state.

build_target

build_target(t: float, pos: ndarray, vel: ndarray, acc: ndarray) -> np.ndarray

Assemble a full 12D target from position, velocity, and acceleration.

sample_batch

sample_batch(ts: ndarray) -> np.ndarray

Sample a batch of timestamps and stack the resulting 12D targets.

__post_init__

__post_init__()

Cache the trajectory center as a float32 NumPy vector.

sample

sample(t: float) -> np.ndarray

Sample the lemniscate trajectory at time t.

LissajousTrajectory dataclass

LissajousTrajectory(yaw_from_velocity: bool = True, fixed_yaw: float = 0.0, attitude: tuple[float, float] = (0.0, 0.0), body_rate: tuple[float, float] = (0.0, 0.0), center: tuple[float, float, float] = (0.0, 0.0, 1.0), amplitude: tuple[float, float, float] = (1.0, 1.0, 0.2), frequency: tuple[float, float, float] = (1.0, 2.0, 0.5), phase: tuple[float, float, float] = (0.0, np.pi / 2.0, 0.0), omega: float = 0.5)

Bases: SpatialTrajectory

Three-dimensional Lissajous trajectory.

方法:

名称 描述
sample_heading

Sample yaw and yaw-rate references for time t and translation state.

build_target

Assemble a full 12D target from position, velocity, and acceleration.

sample_batch

Sample a batch of timestamps and stack the resulting 12D targets.

__post_init__

Cache vector-valued parameters as float32 NumPy arrays.

sample

Sample the Lissajous trajectory at time t.

sample_heading

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

Sample yaw and yaw-rate references for time t and translation state.

build_target

build_target(t: float, pos: ndarray, vel: ndarray, acc: ndarray) -> np.ndarray

Assemble a full 12D target from position, velocity, and acceleration.

sample_batch

sample_batch(ts: ndarray) -> np.ndarray

Sample a batch of timestamps and stack the resulting 12D targets.

__post_init__

__post_init__()

Cache vector-valued parameters as float32 NumPy arrays.

sample

sample(t: float) -> np.ndarray

Sample the Lissajous trajectory at time t.

RectangleTrajectory dataclass

RectangleTrajectory(yaw_from_velocity: bool = True, fixed_yaw: float = 0.0, attitude: tuple[float, float] = (0.0, 0.0), body_rate: tuple[float, float] = (0.0, 0.0), center: tuple[float, float, float] = (0.0, 0.0, 1.0), size: tuple[float, float] = (2.0, 1.0), speed: float = 0.5)

Bases: SpatialTrajectory

Constant-speed rectangle trajectory in the horizontal plane.

方法:

名称 描述
sample_heading

Sample yaw and yaw-rate references for time t and translation state.

build_target

Assemble a full 12D target from position, velocity, and acceleration.

sample_batch

Sample a batch of timestamps and stack the resulting 12D targets.

__post_init__

Precompute rectangle corners and edge lengths.

sample

Sample the rectangle trajectory at time t.

sample_heading

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

Sample yaw and yaw-rate references for time t and translation state.

build_target

build_target(t: float, pos: ndarray, vel: ndarray, acc: ndarray) -> np.ndarray

Assemble a full 12D target from position, velocity, and acceleration.

sample_batch

sample_batch(ts: ndarray) -> np.ndarray

Sample a batch of timestamps and stack the resulting 12D targets.

__post_init__

__post_init__()

Precompute rectangle corners and edge lengths.

sample

sample(t: float) -> np.ndarray

Sample the rectangle trajectory at time t.