inertialsim.symbolic
¶
Symbolic trajectories.
The symbolic module is optional. It provides exact symbolic/analytical
trajectories (attitude, position, and velocity as functions of time) along with
their derivatives. Symbolic pose, angular rate and specific force enable true
ground-truth comparisons for testing and analysis.
Singular configurations
Be aware of potential singularities in symbolic expressions, for example when converting between rotation representations near multiples of \(\pi\). These are well handled in the numeric inertialsim.geometry module but are not completely eliminated in these symbolic expressions.
The module requires one additional dependency:
Classes:
| Name | Description |
|---|---|
SO3 |
SO(3) Lie group. |
SE3 |
SE(3) Lie group. |
Trajectory |
Base class for symbolic trajectories. |
ConingRotation |
Coning rotation. |
EarthRotation |
Earth rotation. |
ZigZagTrajectory |
Zigzag trajectory. |
GroundVehiclePath |
Simulated ground vehicle path. |
Functions:
| Name | Description |
|---|---|
lambdify |
Create a lambda function from a symbolic expression. |
integral |
Integrate each matrix component from zero to the time symbol. |
double_integral |
Double integrate each matrix component from zero to the time symbol. |
power_series |
Compute the power series coefficients for a 3D rotation vector. |
Attributes:
| Name | Type | Description |
|---|---|---|
TIME_SYMBOL |
Symbol
|
|
SO3
¶
SO(3) Lie group.
Provides a minimal symbolic implementation of SO(3) methods.
Methods:
| Name | Description |
|---|---|
Rx |
Rotation around the x-axis. |
Ry |
Rotation around the y-axis. |
Rz |
Rotation around the z-axis. |
exp |
Exponential map. |
log |
Logarithm map. |
jacobian |
Left and right Jacobians. |
Rx
staticmethod
¶
Rotation around the x-axis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
roll
|
Expr
|
Rotation angle around the x-axis. |
required |
Returns:
| Type | Description |
|---|---|
Matrix
|
The corresponding rotation matrix in SO(3). |
Ry
staticmethod
¶
Rotation around the y-axis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pitch
|
Expr
|
Rotation angle around the y-axis. |
required |
Returns:
| Type | Description |
|---|---|
Matrix
|
The corresponding rotation matrix in SO(3). |
Rz
staticmethod
¶
Rotation around the z-axis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
yaw
|
Expr
|
Rotation angle around the z-axis. |
required |
Returns:
| Type | Description |
|---|---|
Matrix
|
The corresponding rotation matrix in SO(3). |
exp
staticmethod
¶
Exponential map.
Computes the exponential map from rotation vector in the Lie algebra, so(3), to the rotation matrix in the Lie group, SO(3).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
φ
|
Matrix
|
Rotation vector in so(3). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
R |
Matrix
|
The corresponding rotation matrix in SO(3). |
log
staticmethod
¶
Logarithm map.
Computes the logarithm map from the rotation matrix in the Lie group, SO(3), to the rotation vector in the Lie algebra, so(3).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
R
|
Matrix
|
Rotation matrix in SO(3). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
φ |
Matrix
|
The corresponding rotation vector in so(3). |
jacobian
staticmethod
¶
SE3
¶
SE(3) Lie group.
Provides convenience functions like the exponential and logarithmic maps for 3D rigid body transformations. This class does not contain a complete implementation of the SE(3) Lie group.
Methods:
| Name | Description |
|---|---|
exp |
Exponential map. |
log |
Logarithmic map. |
jacobian |
Left and right jacobians. |
exp
staticmethod
¶
exp(φ: Matrix, η: Matrix) -> tuple[Matrix, Matrix]
Exponential map.
Computes the exponential map from the Lie algebra se(3) to the Lie group SE(3). The algebra is represented by the rotation vector, φ, and the generalized translation/velocity vector, η. In many references, the translation vector is denoted as lower-case greek letter, rho. We use the η for generalized velocity from Savage. The output is the conventional rotation matrix and translation/velocity vector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
φ
|
Matrix
|
Rotation vector. |
required |
η
|
Matrix
|
Generalized translation or velocity vector. |
required |
Returns:
| Type | Description |
|---|---|
tuple[Matrix, Matrix]
|
A tuple containing the rotation matrix and the translation vector. |
log
staticmethod
¶
log(R: Matrix, v: Matrix) -> tuple[Matrix, Matrix]
Logarithmic map.
Computes the logarithmic map from the Lie group SE(3) to the Lie algebra se(3). The group is represented by the rotation matrix R and the translation/velocity vector v. We use the v for velocity for consistency with the exponential map. The output is the rotation vector and generalized translation/velocity vector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
R
|
Matrix
|
Rotation matrix. |
required |
v
|
Matrix
|
Translation/velocity vector. |
required |
Returns:
| Type | Description |
|---|---|
Matrix
|
A tuple containing the rotation vector, φ, and the generalized |
Matrix
|
translation/velocity vector, η. |
jacobian
classmethod
¶
Left and right jacobians.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
φ
|
Matrix
|
Rotation vector. |
required |
η
|
Matrix
|
Generalized translation or velocity vector. |
required |
side
|
str
|
Return the "left" or "right" Jacobian. |
'left'
|
inverse
|
bool
|
Return the inverse Jacobian. |
False
|
Returns:
| Type | Description |
|---|---|
Matrix
|
The 6x6 Jacobian matrix. |
Trajectory
¶
Base class for symbolic trajectories.
Define symbolic/analytical trajectories in attitude (orientation) and position. Velocity and IMU data (angular rate and specific force) are analytically derived. Additional useful intermediates (Jacobians, Lie algebra derivatives, etc.) are also analytically derived. Methods to efficiently sample numerical values are provided.
The suggested use is to subclass Trajectory and provide convenient methods
to define the symbolic expressions for attitude, position, and gravity in
the initializer.
Attitude can be a rotation vector or a rotation matrix. Position must be
a Cartesian vector. Inputs must use the symbol t for time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
attitude
|
Matrix
|
Attitude in rotation vector or rotation matrix form. |
required |
position
|
Matrix
|
Position in world coordinates. |
required |
gravity
|
Matrix
|
Gravity vector in world coordinates. |
required |
Methods:
| Name | Description |
|---|---|
compose |
Compose two trajectories. |
rotation_vector |
Return the attitude as a rotation vector. |
rotation_vector_rate |
Return the attitude rate as a rotation vector. |
rotation_matrix |
Return the attitude as a rotation matrix. |
angular_rate |
Return the angular rate. |
rotation |
Return the attitude as a Rotation instance. |
extended_pose |
Return the attitude, position, and velocity. |
velocity |
Return the velocity. |
position |
Return the position. |
acceleration |
Return the acceleration. |
specific_force |
Return the specific force. |
gravity |
Return the gravity vector. |
plot_attitude |
Plot attitude variables. |
plot_translation |
Plot translation variables. |
plot |
Plots trajectory variables. |
Attributes:
| Name | Type | Description |
|---|---|---|
time |
Symbol
|
|
compose
¶
compose(
other: Self,
gravity: Literal["self", "other"] | Matrix = "self",
) -> Trajectory
Compose two trajectories.
Composes the current (self) trajectory with the input (other) such that \(T_{composed} = T_{self} * T_{other}\). Gravity can be inherited from self (default), inherited from other (rotated by self), or can be a new input. Users must ensure that coordinate systems are respected when composing trajectories and that the same time symbol is used for both.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
Self
|
Trajectory object to compose with. |
required |
gravity
|
Literal['self', 'other'] | Matrix
|
Gravity source to use. Can be "self" (default), "other", or a SymPy Matrix. |
'self'
|
Returns:
| Type | Description |
|---|---|
Trajectory
|
New Trajectory instance. |
rotation_vector
¶
Return the attitude as a rotation vector.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Rotation vector. |
rotation_vector_rate
¶
Return the attitude rate as a rotation vector.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Rotation vector rate. |
rotation_matrix
¶
Return the attitude as a rotation matrix.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Rotation matrix. |
angular_rate
¶
Return the angular rate.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Angular rate. |
rotation
¶
Return the attitude as a Rotation instance.
Returns a geometry.Rotation instance with data sampled at the input times.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Array of sampling times. |
required |
Returns:
| Type | Description |
|---|---|
Rotation
|
Rotation instance. |
extended_pose
¶
extended_pose(time: ArrayLike) -> ExtendedPose
Return the attitude, position, and velocity.
Returns a geometry.ExtendedPose instance with data sampled at the input times.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Array of sampling times. |
required |
Returns:
| Type | Description |
|---|---|
ExtendedPose
|
ExtendedPose instance. |
velocity
¶
Return the velocity.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Velocity vector. |
position
¶
Return the position.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Position vector. |
acceleration
¶
Return the acceleration.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Acceleration vector in world/navigation coordinates. |
specific_force
¶
Return the specific force.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Specific force vector. |
gravity
¶
Return the gravity vector.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Gravity vector. |
plot_attitude
¶
plot_attitude(
time: ArrayLike, title_prefix: str = ""
) -> tuple[TimeSeries, TimeSeries, TimeSeries]
Plot attitude variables.
Plots the rotation vector, rotation vector rate, and angular rate sampled at the input times.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Sampling times. |
required |
title_prefix
|
str
|
Prefix for plot titles. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
plots |
tuple[TimeSeries, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
plot_translation
¶
plot_translation(
time: ArrayLike, title_prefix: str = ""
) -> tuple[Scatter, TimeSeries, TimeSeries]
Plot translation variables.
Plots the position, velocity, and specific force sampled at the input times. Position is plotted as a plan-view (x-axis v y-axis). Velocity and specific force are plotted as time series graphs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Sampling times. |
required |
title_prefix
|
str
|
Prefix for plot titles. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
plots |
tuple[Scatter, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
plot
¶
plot(
time: ArrayLike, title_prefix: str = ""
) -> tuple[
tuple[TimeSeries, TimeSeries, TimeSeries],
tuple[Scatter, TimeSeries, TimeSeries],
]
Plots trajectory variables.
Plots attitude and translation variables. See plot_attitude and plot_translation for details.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Sampling times. |
required |
title_prefix
|
str
|
Prefix for plot titles. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
attitude_plots |
tuple[TimeSeries, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
translation_plots |
tuple[Scatter, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
ConingRotation
¶
Bases: Trajectory
Coning rotation.
Coning motion is rotation of a fixed magnitude about a rotation vector that oscillates out-of-phase around two axes. See Reference [33] for further details.
The rotation vector inscribes a cone in the world frame. Coning motion results in an angular rate that has a constant component in the third axis. Naive integration schemes will rectify this fixed component into a linear drift. For this reason, it is a standard test case.
As a pure rotation, by default, gravity is set to zero.
Amplitude, \(\theta\), is the amplitude of the rotation in radians and is typically small resulting from vibration. Frequency, \(\omega\) should be the frequency in Hz, which is converted internally to angular frequency. If both or either are None, they are represented symbolically.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amplitude
|
float | None
|
Amplitude of coning rotation. |
None
|
frequency
|
float | None
|
Frequency of coning rotation. |
None
|
Methods:
| Name | Description |
|---|---|
compose |
Compose two trajectories. |
rotation_vector |
Return the attitude as a rotation vector. |
rotation_vector_rate |
Return the attitude rate as a rotation vector. |
rotation_matrix |
Return the attitude as a rotation matrix. |
angular_rate |
Return the angular rate. |
rotation |
Return the attitude as a Rotation instance. |
extended_pose |
Return the attitude, position, and velocity. |
velocity |
Return the velocity. |
position |
Return the position. |
acceleration |
Return the acceleration. |
specific_force |
Return the specific force. |
gravity |
Return the gravity vector. |
plot_attitude |
Plot attitude variables. |
plot_translation |
Plot translation variables. |
plot |
Plots trajectory variables. |
Attributes:
| Name | Type | Description |
|---|---|---|
time |
Symbol
|
|
compose
¶
compose(
other: Self,
gravity: Literal["self", "other"] | Matrix = "self",
) -> Trajectory
Compose two trajectories.
Composes the current (self) trajectory with the input (other) such that \(T_{composed} = T_{self} * T_{other}\). Gravity can be inherited from self (default), inherited from other (rotated by self), or can be a new input. Users must ensure that coordinate systems are respected when composing trajectories and that the same time symbol is used for both.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
Self
|
Trajectory object to compose with. |
required |
gravity
|
Literal['self', 'other'] | Matrix
|
Gravity source to use. Can be "self" (default), "other", or a SymPy Matrix. |
'self'
|
Returns:
| Type | Description |
|---|---|
Trajectory
|
New Trajectory instance. |
rotation_vector
¶
Return the attitude as a rotation vector.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Rotation vector. |
rotation_vector_rate
¶
Return the attitude rate as a rotation vector.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Rotation vector rate. |
rotation_matrix
¶
Return the attitude as a rotation matrix.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Rotation matrix. |
angular_rate
¶
Return the angular rate.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Angular rate. |
rotation
¶
Return the attitude as a Rotation instance.
Returns a geometry.Rotation instance with data sampled at the input times.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Array of sampling times. |
required |
Returns:
| Type | Description |
|---|---|
Rotation
|
Rotation instance. |
extended_pose
¶
extended_pose(time: ArrayLike) -> ExtendedPose
Return the attitude, position, and velocity.
Returns a geometry.ExtendedPose instance with data sampled at the input times.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Array of sampling times. |
required |
Returns:
| Type | Description |
|---|---|
ExtendedPose
|
ExtendedPose instance. |
velocity
¶
Return the velocity.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Velocity vector. |
position
¶
Return the position.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Position vector. |
acceleration
¶
Return the acceleration.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Acceleration vector in world/navigation coordinates. |
specific_force
¶
Return the specific force.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Specific force vector. |
gravity
¶
Return the gravity vector.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Gravity vector. |
plot_attitude
¶
plot_attitude(
time: ArrayLike, title_prefix: str = ""
) -> tuple[TimeSeries, TimeSeries, TimeSeries]
Plot attitude variables.
Plots the rotation vector, rotation vector rate, and angular rate sampled at the input times.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Sampling times. |
required |
title_prefix
|
str
|
Prefix for plot titles. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
plots |
tuple[TimeSeries, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
plot_translation
¶
plot_translation(
time: ArrayLike, title_prefix: str = ""
) -> tuple[Scatter, TimeSeries, TimeSeries]
Plot translation variables.
Plots the position, velocity, and specific force sampled at the input times. Position is plotted as a plan-view (x-axis v y-axis). Velocity and specific force are plotted as time series graphs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Sampling times. |
required |
title_prefix
|
str
|
Prefix for plot titles. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
plots |
tuple[Scatter, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
plot
¶
plot(
time: ArrayLike, title_prefix: str = ""
) -> tuple[
tuple[TimeSeries, TimeSeries, TimeSeries],
tuple[Scatter, TimeSeries, TimeSeries],
]
Plots trajectory variables.
Plots attitude and translation variables. See plot_attitude and plot_translation for details.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Sampling times. |
required |
title_prefix
|
str
|
Prefix for plot titles. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
attitude_plots |
tuple[TimeSeries, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
translation_plots |
tuple[Scatter, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
EarthRotation
¶
EarthRotation(angular_rate: ArrayLike | None = None)
Bases: Trajectory
Earth rotation.
Earth's rotation relative to inertial space. Earth rotates around a fixed axis at an approximately constant rate. See the geodesy.datums and geodesy.EarthRate modules for more details and to calculate standard rotation rates.
This trajectory defines a pure rotation with translation and gravity components set to zero. Since Earth is in gravitational freefall this is sufficient for the standard definition of an inertial frame in inertial navigation.
If the angular_rate input is not supplied it will be represented by
the symbolic values \(\omega_{x}\), \(\omega_{y}\), and \(\omega_{z}\) in the
world/navigation frame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
angular_rate
|
ArrayLike | None
|
Angular rate of Earth (rad/s) relative to inertial space. |
None
|
Methods:
| Name | Description |
|---|---|
compose |
Compose two trajectories. |
rotation_vector |
Return the attitude as a rotation vector. |
rotation_vector_rate |
Return the attitude rate as a rotation vector. |
rotation_matrix |
Return the attitude as a rotation matrix. |
angular_rate |
Return the angular rate. |
rotation |
Return the attitude as a Rotation instance. |
extended_pose |
Return the attitude, position, and velocity. |
velocity |
Return the velocity. |
position |
Return the position. |
acceleration |
Return the acceleration. |
specific_force |
Return the specific force. |
gravity |
Return the gravity vector. |
plot_attitude |
Plot attitude variables. |
plot_translation |
Plot translation variables. |
plot |
Plots trajectory variables. |
Attributes:
| Name | Type | Description |
|---|---|---|
time |
Symbol
|
|
compose
¶
compose(
other: Self,
gravity: Literal["self", "other"] | Matrix = "self",
) -> Trajectory
Compose two trajectories.
Composes the current (self) trajectory with the input (other) such that \(T_{composed} = T_{self} * T_{other}\). Gravity can be inherited from self (default), inherited from other (rotated by self), or can be a new input. Users must ensure that coordinate systems are respected when composing trajectories and that the same time symbol is used for both.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
Self
|
Trajectory object to compose with. |
required |
gravity
|
Literal['self', 'other'] | Matrix
|
Gravity source to use. Can be "self" (default), "other", or a SymPy Matrix. |
'self'
|
Returns:
| Type | Description |
|---|---|
Trajectory
|
New Trajectory instance. |
rotation_vector
¶
Return the attitude as a rotation vector.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Rotation vector. |
rotation_vector_rate
¶
Return the attitude rate as a rotation vector.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Rotation vector rate. |
rotation_matrix
¶
Return the attitude as a rotation matrix.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Rotation matrix. |
angular_rate
¶
Return the angular rate.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Angular rate. |
rotation
¶
Return the attitude as a Rotation instance.
Returns a geometry.Rotation instance with data sampled at the input times.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Array of sampling times. |
required |
Returns:
| Type | Description |
|---|---|
Rotation
|
Rotation instance. |
extended_pose
¶
extended_pose(time: ArrayLike) -> ExtendedPose
Return the attitude, position, and velocity.
Returns a geometry.ExtendedPose instance with data sampled at the input times.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Array of sampling times. |
required |
Returns:
| Type | Description |
|---|---|
ExtendedPose
|
ExtendedPose instance. |
velocity
¶
Return the velocity.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Velocity vector. |
position
¶
Return the position.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Position vector. |
acceleration
¶
Return the acceleration.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Acceleration vector in world/navigation coordinates. |
specific_force
¶
Return the specific force.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Specific force vector. |
gravity
¶
Return the gravity vector.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Gravity vector. |
plot_attitude
¶
plot_attitude(
time: ArrayLike, title_prefix: str = ""
) -> tuple[TimeSeries, TimeSeries, TimeSeries]
Plot attitude variables.
Plots the rotation vector, rotation vector rate, and angular rate sampled at the input times.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Sampling times. |
required |
title_prefix
|
str
|
Prefix for plot titles. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
plots |
tuple[TimeSeries, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
plot_translation
¶
plot_translation(
time: ArrayLike, title_prefix: str = ""
) -> tuple[Scatter, TimeSeries, TimeSeries]
Plot translation variables.
Plots the position, velocity, and specific force sampled at the input times. Position is plotted as a plan-view (x-axis v y-axis). Velocity and specific force are plotted as time series graphs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Sampling times. |
required |
title_prefix
|
str
|
Prefix for plot titles. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
plots |
tuple[Scatter, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
plot
¶
plot(
time: ArrayLike, title_prefix: str = ""
) -> tuple[
tuple[TimeSeries, TimeSeries, TimeSeries],
tuple[Scatter, TimeSeries, TimeSeries],
]
Plots trajectory variables.
Plots attitude and translation variables. See plot_attitude and plot_translation for details.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Sampling times. |
required |
title_prefix
|
str
|
Prefix for plot titles. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
attitude_plots |
tuple[TimeSeries, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
translation_plots |
tuple[Scatter, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
ZigZagTrajectory
¶
ZigZagTrajectory(
attitude_amplitudes: ArrayLike | None = None,
attitude_frequencies: ArrayLike | None = None,
position_amplitudes: ArrayLike | None = None,
position_frequencies: ArrayLike | None = None,
gravity: float = standard_magnitude,
)
Bases: Trajectory
Zigzag trajectory.
The attitude is defined by independent oscillations in roll, pitch, and yaw. The position is defined by a Figure-8 pattern in the x-y plane and oscillations in the z-axis. This approximates the motion of a holonomic vehicle, like a drone, translating and rotation in all axes independently. The effect of gravity is modeled by a constant vertical value.
Attitude amplitudes must be an array of values for the x, y, z axes in radians. Position amplitudes must be an array of values for the x, y, z axes in meters. Frequencies must be an array of values in Hz, which are converted internally to angular frequencies. If any amplitude or frequency inputs are None, they are represented symbolically.
By default, standard gravity (9.80665 m/s/s) is applied in the vertical axis.
Example
The following example results in an attitude with large changes in yaw angle at low frequency (± 70 degrees once every 50 seconds), with smaller, higher frequency changes in roll and pitch. The position follows a 100m long Figure-8 path in x, y and oscillates ± 5 meters in z.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
attitude_amplitudes
|
ArrayLike | None
|
Attitude (rotation) amplitudes. |
None
|
attitude_frequencies
|
ArrayLike | None
|
Attitude (rotation) frequencies. |
None
|
position_amplitudes
|
ArrayLike | None
|
Position amplitudes. |
None
|
position_frequencies
|
ArrayLike | None
|
Position frequencies. |
None
|
gravity
|
float
|
Magnitude of gravity. |
standard_magnitude
|
Methods:
| Name | Description |
|---|---|
compose |
Compose two trajectories. |
rotation_vector |
Return the attitude as a rotation vector. |
rotation_vector_rate |
Return the attitude rate as a rotation vector. |
rotation_matrix |
Return the attitude as a rotation matrix. |
angular_rate |
Return the angular rate. |
rotation |
Return the attitude as a Rotation instance. |
extended_pose |
Return the attitude, position, and velocity. |
velocity |
Return the velocity. |
position |
Return the position. |
acceleration |
Return the acceleration. |
specific_force |
Return the specific force. |
gravity |
Return the gravity vector. |
plot_attitude |
Plot attitude variables. |
plot_translation |
Plot translation variables. |
plot |
Plots trajectory variables. |
Attributes:
| Name | Type | Description |
|---|---|---|
time |
Symbol
|
|
compose
¶
compose(
other: Self,
gravity: Literal["self", "other"] | Matrix = "self",
) -> Trajectory
Compose two trajectories.
Composes the current (self) trajectory with the input (other) such that \(T_{composed} = T_{self} * T_{other}\). Gravity can be inherited from self (default), inherited from other (rotated by self), or can be a new input. Users must ensure that coordinate systems are respected when composing trajectories and that the same time symbol is used for both.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
Self
|
Trajectory object to compose with. |
required |
gravity
|
Literal['self', 'other'] | Matrix
|
Gravity source to use. Can be "self" (default), "other", or a SymPy Matrix. |
'self'
|
Returns:
| Type | Description |
|---|---|
Trajectory
|
New Trajectory instance. |
rotation_vector
¶
Return the attitude as a rotation vector.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Rotation vector. |
rotation_vector_rate
¶
Return the attitude rate as a rotation vector.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Rotation vector rate. |
rotation_matrix
¶
Return the attitude as a rotation matrix.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Rotation matrix. |
angular_rate
¶
Return the angular rate.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Angular rate. |
rotation
¶
Return the attitude as a Rotation instance.
Returns a geometry.Rotation instance with data sampled at the input times.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Array of sampling times. |
required |
Returns:
| Type | Description |
|---|---|
Rotation
|
Rotation instance. |
extended_pose
¶
extended_pose(time: ArrayLike) -> ExtendedPose
Return the attitude, position, and velocity.
Returns a geometry.ExtendedPose instance with data sampled at the input times.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Array of sampling times. |
required |
Returns:
| Type | Description |
|---|---|
ExtendedPose
|
ExtendedPose instance. |
velocity
¶
Return the velocity.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Velocity vector. |
position
¶
Return the position.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Position vector. |
acceleration
¶
Return the acceleration.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Acceleration vector in world/navigation coordinates. |
specific_force
¶
Return the specific force.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Specific force vector. |
gravity
¶
Return the gravity vector.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Gravity vector. |
plot_attitude
¶
plot_attitude(
time: ArrayLike, title_prefix: str = ""
) -> tuple[TimeSeries, TimeSeries, TimeSeries]
Plot attitude variables.
Plots the rotation vector, rotation vector rate, and angular rate sampled at the input times.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Sampling times. |
required |
title_prefix
|
str
|
Prefix for plot titles. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
plots |
tuple[TimeSeries, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
plot_translation
¶
plot_translation(
time: ArrayLike, title_prefix: str = ""
) -> tuple[Scatter, TimeSeries, TimeSeries]
Plot translation variables.
Plots the position, velocity, and specific force sampled at the input times. Position is plotted as a plan-view (x-axis v y-axis). Velocity and specific force are plotted as time series graphs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Sampling times. |
required |
title_prefix
|
str
|
Prefix for plot titles. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
plots |
tuple[Scatter, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
plot
¶
plot(
time: ArrayLike, title_prefix: str = ""
) -> tuple[
tuple[TimeSeries, TimeSeries, TimeSeries],
tuple[Scatter, TimeSeries, TimeSeries],
]
Plots trajectory variables.
Plots attitude and translation variables. See plot_attitude and plot_translation for details.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Sampling times. |
required |
title_prefix
|
str
|
Prefix for plot titles. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
attitude_plots |
tuple[TimeSeries, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
translation_plots |
tuple[Scatter, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
GroundVehiclePath
¶
GroundVehiclePath(
*,
north: float | None = None,
east: float | None = None,
speed: float | None = None,
altitude_amplitude: float | None = None,
altitude_frequency: float | None = None,
roll_amplitude: float | None = None,
roll_frequency: float | None = None,
pitch_amplitude: float | None = None,
pitch_frequency: float | None = None,
gravity: ArrayLike = _DEFAULT_GRAVITY,
)
Bases: Trajectory
Simulated ground vehicle path.
The position data traces a Lissajous curve in the horizontal plane and is defined by North & East magnitudes (meters) and average speed (meters/second). An independent oscillation can be added to the z-axis.
The North-relative heading is calculated as the tangent of the position curve. Independent oscillations can be added in roll & pitch.
Overall, the motion approximates a non-holonomic vehicle like a car driving smoothly in x, y, and heading while experiencing disturbances in roll, pitch, and vertical position.
Gravity is a constant vector in NED coordinates and defaults to 9.80665m/s/s
in the down direction. Earth rotation should be applied by composing this
trajectory with the EarthRotation class from inertialsim.symbolic.
\(\omega_{N}\) is 3, \(\omega_{E}\) is 2, and \(\delta\) is \(\pi/2\). Attitude rotates NED basis vectors into IMU basis vectors.
Attitude amplitudes must be an array of values for the x, y, z axes in radians. Position amplitudes must be an array of values for the x, y, z axes in meters. Frequencies must be an array of values in Hz, which are converted internally to angular frequencies. If any amplitude or frequency inputs are None, they are represented symbolically.
By default, standard gravity (9.80665 m/s/s) is applied in the vertical axis.
Example
The following example results in a trajectory 50m x 100m at an average speed of 8.0 m/s. Vertical position, roll, and pitch vibrations are simulated at small amplitudes (0.3m, 3.0°, 12.0° respectively) and moderate, unrelated frequencies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
north
|
float | None
|
North displacement in meters. |
None
|
east
|
float | None
|
East displacement in meters. |
None
|
speed
|
float | None
|
Average speed in m/s. |
None
|
altitude_amplitude
|
float | None
|
Amplitude of vertical position oscillation in meters. |
None
|
altitude_frequency
|
float | None
|
Frequency of vertical position oscillation in Hz. |
None
|
roll_amplitude
|
float | None
|
Amplitude of roll oscillation in degrees. |
None
|
roll_frequency
|
float | None
|
Frequency of roll oscillation in Hz. |
None
|
pitch_amplitude
|
float | None
|
Amplitude of pitch oscillation in degrees. |
None
|
pitch_frequency
|
float | None
|
Frequency of pitch oscillation in Hz. |
None
|
gravity
|
ArrayLike
|
Gravity vector. |
_DEFAULT_GRAVITY
|
Methods:
| Name | Description |
|---|---|
scale |
Scale path to average speed. |
compose |
Compose two trajectories. |
rotation_vector |
Return the attitude as a rotation vector. |
rotation_vector_rate |
Return the attitude rate as a rotation vector. |
rotation_matrix |
Return the attitude as a rotation matrix. |
angular_rate |
Return the angular rate. |
rotation |
Return the attitude as a Rotation instance. |
extended_pose |
Return the attitude, position, and velocity. |
velocity |
Return the velocity. |
position |
Return the position. |
acceleration |
Return the acceleration. |
specific_force |
Return the specific force. |
gravity |
Return the gravity vector. |
plot_attitude |
Plot attitude variables. |
plot_translation |
Plot translation variables. |
plot |
Plots trajectory variables. |
Attributes:
| Name | Type | Description |
|---|---|---|
a |
|
|
b |
|
|
δ |
Pi
|
|
time |
Symbol
|
|
scale
¶
Scale path to average speed.
Calculate a scale factor for the North and East position variables that will make the average speed equal to the input.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
north
|
float
|
Amplitude of the northward motion. |
required |
east
|
float
|
Amplitude of the eastward motion. |
required |
speed
|
float
|
Desired average speed. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Scale factor to apply to the North and East position variables. |
compose
¶
compose(
other: Self,
gravity: Literal["self", "other"] | Matrix = "self",
) -> Trajectory
Compose two trajectories.
Composes the current (self) trajectory with the input (other) such that \(T_{composed} = T_{self} * T_{other}\). Gravity can be inherited from self (default), inherited from other (rotated by self), or can be a new input. Users must ensure that coordinate systems are respected when composing trajectories and that the same time symbol is used for both.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
Self
|
Trajectory object to compose with. |
required |
gravity
|
Literal['self', 'other'] | Matrix
|
Gravity source to use. Can be "self" (default), "other", or a SymPy Matrix. |
'self'
|
Returns:
| Type | Description |
|---|---|
Trajectory
|
New Trajectory instance. |
rotation_vector
¶
Return the attitude as a rotation vector.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Rotation vector. |
rotation_vector_rate
¶
Return the attitude rate as a rotation vector.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Rotation vector rate. |
rotation_matrix
¶
Return the attitude as a rotation matrix.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Rotation matrix. |
angular_rate
¶
Return the angular rate.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Angular rate. |
rotation
¶
Return the attitude as a Rotation instance.
Returns a geometry.Rotation instance with data sampled at the input times.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Array of sampling times. |
required |
Returns:
| Type | Description |
|---|---|
Rotation
|
Rotation instance. |
extended_pose
¶
extended_pose(time: ArrayLike) -> ExtendedPose
Return the attitude, position, and velocity.
Returns a geometry.ExtendedPose instance with data sampled at the input times.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Array of sampling times. |
required |
Returns:
| Type | Description |
|---|---|
ExtendedPose
|
ExtendedPose instance. |
velocity
¶
Return the velocity.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Velocity vector. |
position
¶
Return the position.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Position vector. |
acceleration
¶
Return the acceleration.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Acceleration vector in world/navigation coordinates. |
specific_force
¶
Return the specific force.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Specific force vector. |
gravity
¶
Return the gravity vector.
Returns a symbolic representation if the time input is None (default)
or a numeric array sampled at the input times if supplied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike | None
|
Array of sampling times. |
None
|
Returns:
| Type | Description |
|---|---|
Matrix | NDArray
|
Gravity vector. |
plot_attitude
¶
plot_attitude(
time: ArrayLike, title_prefix: str = ""
) -> tuple[TimeSeries, TimeSeries, TimeSeries]
Plot attitude variables.
Plots the rotation vector, rotation vector rate, and angular rate sampled at the input times.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Sampling times. |
required |
title_prefix
|
str
|
Prefix for plot titles. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
plots |
tuple[TimeSeries, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
plot_translation
¶
plot_translation(
time: ArrayLike, title_prefix: str = ""
) -> tuple[Scatter, TimeSeries, TimeSeries]
Plot translation variables.
Plots the position, velocity, and specific force sampled at the input times. Position is plotted as a plan-view (x-axis v y-axis). Velocity and specific force are plotted as time series graphs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Sampling times. |
required |
title_prefix
|
str
|
Prefix for plot titles. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
plots |
tuple[Scatter, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
plot
¶
plot(
time: ArrayLike, title_prefix: str = ""
) -> tuple[
tuple[TimeSeries, TimeSeries, TimeSeries],
tuple[Scatter, TimeSeries, TimeSeries],
]
Plots trajectory variables.
Plots attitude and translation variables. See plot_attitude and plot_translation for details.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
ArrayLike
|
Sampling times. |
required |
title_prefix
|
str
|
Prefix for plot titles. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
attitude_plots |
tuple[TimeSeries, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
translation_plots |
tuple[Scatter, TimeSeries, TimeSeries]
|
Tuple containing three plot handles. |
lambdify
¶
lambdify(fn: Expr, time: Symbol) -> Callable
Create a lambda function from a symbolic expression.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fn
|
Expr
|
Symbolic expression to be converted into a lambda function. |
required |
time
|
Symbol
|
Symbolic variable representing time. |
required |
Returns:
| Type | Description |
|---|---|
Callable
|
A callable that evaluates the symbolic expression at input time values. |
integral
¶
Integrate each matrix component from zero to the time symbol.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
matrix
|
Matrix
|
Matrix whose components are integrated. |
required |
time
|
Symbol
|
Symbol used as the integration variable and upper bound. |
required |
Returns:
| Type | Description |
|---|---|
Matrix
|
Matrix containing the integrated components. |
double_integral
¶
Double integrate each matrix component from zero to the time symbol.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
matrix
|
Matrix
|
Matrix whose components are double integrated. |
required |
time
|
Symbol
|
Symbol used as the integration variable and upper bound. |
required |
Returns:
| Type | Description |
|---|---|
Matrix
|
Matrix containing the double integrated components. |
power_series
¶
power_series(
φ: Matrix,
) -> tuple[
Integer | Expr,
Rational | Expr,
Rational | Expr,
Rational | Expr,
Rational | Expr,
Rational | Expr,
]
Compute the power series coefficients for a 3D rotation vector.
This function computes the coefficients of the power series expansion used in the SO(3) and SE(3) Lie groups.
Returns:
| Type | Description |
|---|---|
Integer | Expr
|
A tuple containing six coefficients (f1, f2, f3, f4, f5, fn) used in the |
Rational | Expr
|
power series expansion. The types are sympy.Int (f1) or sympy.Rational |
Rational | Expr
|
(f2, ...) for exact values when the rotation vector is zero, and |
Rational | Expr
|
sympy.Expr otherwise. |