AttitudeTrajectory¶
AttitudeTrajectory is a chronologically sorted collection of AttitudeState samples (a unit quaternion plus an optional body angular velocity) relating two ReferenceFrame endpoints, with slerp, linear, and Lagrange interpolation.
AttitudeTrajectory has the same API as Trajectory, plus quaternion-aware interpolation and the OrientationProvider accessors (quaternion, angular_velocity, euler_angle, euler_axis, rotation_matrix) documented below.
AttitudeTrajectory ¶
AttitudeTrajectory(frame_a: ReferenceFrame, frame_b: ReferenceFrame)
A chronologically sorted collection of AttitudeState samples relating two ReferenceFrame endpoints.
Every stored quaternion represents the attitude of frame_b relative to frame_a. All states in a trajectory must uniformly carry angular velocity or uniformly omit it; add rejects a state that would mix the two.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frame_a | ReferenceFrame | Frame endpoint A | required |
frame_b | ReferenceFrame | Frame endpoint B (stored quaternions rotate from frame_a to frame_b) | required |
Example
Initialize instance.
end_epoch property ¶
end_epoch: Any
Epoch | None: Last epoch if the trajectory is not empty, None otherwise
frame_b property ¶
frame_b: Any
ReferenceFrame: Frame endpoint B (stored quaternions rotate from frame_a to frame_b)
has_rates property ¶
has_rates: Any
bool: True if the trajectory is non-empty and its states carry angular velocity
interpolation_degree property ¶
interpolation_degree: Any
int | None: Polynomial degree for Lagrange interpolation, or None unless interpolation_method is "LAGRANGE"
interpolation_method property ¶
interpolation_method: Any
str: Current interpolation method - "SLERP", "LINEAR", or "LAGRANGE"
start_epoch property ¶
start_epoch: Any
Epoch | None: First epoch if the trajectory is not empty, None otherwise
add method descriptor ¶
add(epoch: Epoch, quaternion: Quaternion, angular_velocity: ndarray | None = None) -> Any
Add an attitude state at the given epoch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
epoch | Epoch | Epoch of the new state | required |
quaternion | Quaternion | Unit quaternion attitude, frame A to frame B | required |
angular_velocity | ndarray | None | Angular velocity of frame B relative to frame A, expressed in frame B. Units: rad/s. Must be uniformly present or uniformly absent across every state added to this trajectory. | None |
Raises:
| Type | Description |
|---|---|
BraheError | If the new state's angular-velocity presence does not match the trajectory's existing states. |
angular_velocity method descriptor ¶
Return the body angular velocity at the given epoch.
Returns None when the trajectory carries no rate data (see has_rates); that is not an error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
epoch | Epoch | Target epoch | required |
Returns:
| Type | Description |
|---|---|
Any | numpy.ndarray | None: Angular velocity of frame B relative to frame A, expressed |
Any | in frame B, in rad/s, or None if the trajectory carries no rate data |
Raises:
| Type | Description |
|---|---|
BraheError | If the epoch lies outside the trajectory's coverage, or the trajectory is empty |
euler_angle method descriptor ¶
euler_angle(epoch: Epoch, order: EulerAngleOrder) -> EulerAngle
Return the attitude at the given epoch as Euler angles in the requested sequence.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
epoch | Epoch | Target epoch | required |
order | EulerAngleOrder | Euler angle rotation sequence | required |
Returns:
| Name | Type | Description |
|---|---|---|
EulerAngle | EulerAngle | Euler angles (radians) at epoch in the requested sequence |
Raises:
| Type | Description |
|---|---|
BraheError | If the epoch lies outside the trajectory's coverage, or the trajectory is empty |
euler_axis method descriptor ¶
Return the attitude at the given epoch as an Euler axis (axis-angle).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
epoch | Epoch | Target epoch | required |
Returns:
| Name | Type | Description |
|---|---|---|
EulerAxis | EulerAxis | Unit rotation axis and angle (radians) at epoch |
Raises:
| Type | Description |
|---|---|
BraheError | If the epoch lies outside the trajectory's coverage, or the trajectory is empty |
quaternion method descriptor ¶
quaternion(epoch: Epoch) -> Quaternion
Return the attitude quaternion at the given epoch using the configured interpolation method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
epoch | Epoch | Target epoch | required |
Returns:
| Name | Type | Description |
|---|---|---|
Quaternion | Quaternion | Unit quaternion attitude, frame A to frame B, at epoch |
Raises:
| Type | Description |
|---|---|
BraheError | If the epoch lies outside the trajectory's coverage, or the trajectory is empty |
rotation_matrix method descriptor ¶
rotation_matrix(epoch: Epoch) -> RotationMatrix
Return the attitude at the given epoch as a rotation matrix (DCM).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
epoch | Epoch | Target epoch | required |
Returns:
| Name | Type | Description |
|---|---|---|
RotationMatrix | RotationMatrix | 3x3 direction cosine matrix at epoch |
Raises:
| Type | Description |
|---|---|
BraheError | If the epoch lies outside the trajectory's coverage, or the trajectory is empty |
set_interpolation_method method descriptor ¶
Set the interpolation method used for state retrieval at arbitrary epochs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method | str | Interpolation method - "SLERP" (default), "LINEAR", or "LAGRANGE" (case-insensitive) | required |
degree | int | None | Polynomial degree, required iff method is "LAGRANGE" | None |
Raises:
| Type | Description |
|---|---|
ValueError | If method is not recognized, or degree is missing for "LAGRANGE" |
AttitudeState ¶
AttitudeState(quaternion: Quaternion, angular_velocity: ndarray | None = None)
A single attitude sample: a unit quaternion and an optional body rate.
The quaternion represents the attitude of frame B relative to frame A (see AttitudeTrajectory). When present, angular_velocity is the angular velocity of frame B relative to frame A, expressed in frame B, in rad/s.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quaternion | Quaternion | Unit quaternion attitude, frame A to frame B | required |
angular_velocity | ndarray | None | Angular velocity of frame B relative to frame A, expressed in frame B. Units: rad/s | None |
Example
Initialize instance.
See Also¶
- AttitudeTrajectory Guide — Canonical state and interpolation methods
- Trajectory — Dynamic-dimension trajectory
- AEM API Reference — Converting AEM segments to
AttitudeTrajectory - ReferenceFrame — Frame endpoint specifications