Skip to content

rectangle

NumPy rectangle trajectory implementation.

Classes:

Name Description
RectangleTrajectory

Constant-speed rectangle trajectory in the horizontal plane.

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.

Methods:

Name Description
__post_init__

Precompute rectangle corners and edge lengths.

sample

Sample the rectangle trajectory at time t.

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__

__post_init__()

Precompute rectangle corners and edge lengths.

sample

sample(t: float) -> np.ndarray

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.