Namespace inertialsim::geometry¶
Namespace List > inertialsim > geometry
Namespaces¶
| Type | Name |
|---|---|
| namespace | axis_angle |
| namespace | cartesian |
| namespace | euler_angles |
| namespace | legendre |
| namespace | matrix |
| namespace | power_series |
| namespace | quaternion |
| namespace | random |
| namespace | rotation_vector |
| namespace | spherical |
Classes¶
| Type | Name |
|---|---|
| class | CoordinateRotation 3-dimensional coordinate frame rotations (passive convention). |
| class | CoordinateTransform 3-dimensional coordinate frame transforms (passive convention). |
| class | CoordinateTranslation 3-dimensional coordinate frame translations (passive convention). |
| class | ExtendedPose Extended pose (attitude, position, and velocity). |
| class | FloatingPointTolerances Singleton class for managing floating point tolerance settings. |
| class | MatrixLieGroup <typename Derived, GroupDimension, AlgebraDimension> Abstract base class for matrix Lie groups using CRTP. |
| class | Pose Pose (position and orientation). |
| class | RigidTransform 3-dimensional rigid body transforms (SE(3)). |
| class | RigidTransformBase <typename Derived> CRTP base for 3-dimensional rigid body transform types. |
| class | Rotation 3-dimensional rotations of rigid bodies. |
| class | RotationBase <typename Derived> CRTP base for 3-dimensional rotation types. |
| class | Translation 3-dimensional translations. |
| class | Vector 3-dimensional vectors. |
| class | VectorBase <typename Derived> CRTP base for 3-dimensional vector types. |
Public Types¶
| Type | Name |
|---|---|
| enum | Integrator Integration methods. |
| enum | Interpolator |
Public Attributes¶
| Type | Name |
|---|---|
| const std::map< char, int > | kAxisIndex Map from axis character ('X','Y','Z') to index. |
| const std::map< char, Vector3D > | kCartesianBasis Map from axis character ('X','Y','Z') to basis vector. |
| constexpr double | kDefaultFpTolerance = 100.0 \* std::numeric\_limits<double>::epsilon()Standard tolerance for floating point equivalence checks. |
| constexpr double | kMetersPerInternationalFoot = 0.3048Common unit conversions. |
| constexpr int | kNumCartesianAxes = 3Standard number of Cartesian axes. |
| constexpr double | kPi = 3.14159265358979323846Mathematical constant Pi. |
| const Vector3D | kXBasis Standard Cartesian basis vectors. |
| const Vector3D | kYBasis |
| const Vector3D | kZBasis |
Public Functions¶
| Type | Name |
|---|---|
| Vector3D | CrossProduct (const Vector3D & a, const Vector3D & b) Compute the column-wise cross product of 3D vectors. |
| Array | CumulativeIntegral (const Array & array, const Timestamps & time, Integrator method=Integrator::TRAPEZOID, const std::optional< Array > initial_value=std::nullopt) Compute column-wise cumulative integral of an array. |
| Array | CumulativeSum (const Array & array) Compute column-wise cumulative sum of an array. |
| double | Deg2Rad (double degrees) Converts degrees to radians (scalar version). |
| Array | Deg2Rad (const Array & degrees) Converts degrees to radians (array version). |
| Scalar1D | DotProduct (const Vector3D & a, const Vector3D & b) Compute the column-wise dot (inner) product of 3D vectors. |
| std::vector< Scalar1D > | FiniteDifferenceWeights (const Timestamps & time, int order, int accuracy) Compute finite difference weights. |
| bool | IsOrthonormal (const RotationMatrix & matrix, std::optional< double > orthogonal_threshold=std::nullopt, std::optional< double > normal_threshold=std::nullopt) Check if a 3x3 matrix is orthonormal. |
| BooleanArray | IsOrthonormal (const RotationMatrixArray & matrices, std::optional< double > orthogonal_threshold=std::nullopt, std::optional< double > normal_threshold=std::nullopt) Check if an array of 3x3 matrices are orthonormal. |
| bool | IsSorted (const Scalar1D & array) Checks if an array is sorted. |
| bool | IsStrictlySorted (const Scalar1D & array) Checks if an array is strictly sorted. |
| bool | IsUnit (double value) Check if input is close to one. |
| BooleanArray | IsUnit (const Array & array) Check if elements of an array are close to one. |
| bool | IsZero (double value) Check if input is close to zero. |
| BooleanArray | IsZero (const Array & array) Check if elements of an array are close to zero. |
| int | LeviCivita (int i, int j, int k) Levi-Civita symbol. |
| std::pair< Matrix, Scalar1D > | NormalizeVector (const Matrix & vectors) Normalize an array of vectors. |
| double | Rad2Deg (double radians) Converts radians to degrees (scalar version). |
| Array | Rad2Deg (const Array & radians) Converts radians to degrees (array version). |
| int | Sign (double value) Element-wise sign function. |
| RotationMatrix | SkewMatrix (const Eigen::Vector3d & vector) Create a skew-symmetric matrix from a single 3D vector. |
| RotationMatrixArray | SkewMatrix (const Vector3D & vector) Create skew-symmetric matrices from multiple 3D vectors. |
| std::vector< Array > | SlidingWindow (const Array & array, int window_size) Column-wise sliding windows over an array. |
| IntegerArray | VectorArgmax (const Matrix & vectors) Find the argmax for each vector in an array. |
| Array | WrapTo2Pi (const Array & angle) Wraps the input angles such that 0 <= angle < 2*pi . |
| Array | WrapToPi (const Array & angle) Wraps the input angles such that -pi < angle <= pi . |
Public Types Documentation¶
enum Integrator¶
Integration methods.
enum Interpolator¶
Public Attributes Documentation¶
variable kAxisIndex¶
Map from axis character ('X','Y','Z') to index.
variable kCartesianBasis¶
Map from axis character ('X','Y','Z') to basis vector.
variable kDefaultFpTolerance¶
Standard tolerance for floating point equivalence checks.
variable kMetersPerInternationalFoot¶
Common unit conversions.
Conversion factor from international feet to meters.
Note:
This is the international foot and not the U.S. survey foot. Some older inertial navigation references use the latter. As of 1/1/2023, NIST recommends avoiding any use of the survey foot. The value of the international foot is defined in Standard [01]. See: https://www.nist.gov/pml/us-surveyfoot
variable kNumCartesianAxes¶
Standard number of Cartesian axes.
variable kPi¶
Mathematical constant Pi.
variable kXBasis¶
Standard Cartesian basis vectors.
variable kYBasis¶
variable kZBasis¶
Public Functions Documentation¶
function CrossProduct¶
Compute the column-wise cross product of 3D vectors.
Parameters:
aFirst vector.bSecond vector.
Returns:
The cross product vector.
function CumulativeIntegral¶
Compute column-wise cumulative integral of an array.
Array inertialsim::geometry::CumulativeIntegral (
const Array & array,
const Timestamps & time,
Integrator method=Integrator::TRAPEZOID,
const std::optional< Array > initial_value=std::nullopt
)
Parameters:
arrayThe array to integrate (rows are independent axes, columns are time samples).timeThe time array.methodIntegration method.initial_valueOptional initial value.
Returns:
The cumulative integral.
function CumulativeSum¶
Compute column-wise cumulative sum of an array.
Parameters:
arrayThe array to sum (rows are independent axes, columns are time samples).
Returns:
The cumulative sum.
function Deg2Rad¶
Converts degrees to radians (scalar version).
Parameters:
degreesAngle in degrees.
Returns:
Angle in radians.
function Deg2Rad¶
Converts degrees to radians (array version).
Parameters:
degreesAngle(s) in degrees.
Returns:
Angle(s) in radians.
function DotProduct¶
Compute the column-wise dot (inner) product of 3D vectors.
Parameters:
aFirst vector.bSecond vector.
Returns:
The dot product.
function FiniteDifferenceWeights¶
Compute finite difference weights.
std::vector< Scalar1D > inertialsim::geometry::FiniteDifferenceWeights (
const Timestamps & time,
int order,
int accuracy
)
Parameters:
timeTime array.orderDerivative order.accuracyAccuracy order.
Returns:
Vector of weight arrays, one per timestamp. Each element is a Scalar1D of length window_size containing the weights for that timestamp.
function IsOrthonormal¶
Check if a 3x3 matrix is orthonormal.
bool inertialsim::geometry::IsOrthonormal (
const RotationMatrix & matrix,
std::optional< double > orthogonal_threshold=std::nullopt,
std::optional< double > normal_threshold=std::nullopt
)
A matrix is orthonormal if its columns (or rows) are orthogonal unit vectors. This is equivalent to checking that \(M^T M = I\).
Parameters:
matrixThe 3x3 matrix to check.orthogonal_thresholdThreshold for orthogonality check (default from tolerances). Columns must be orthogonal within this tolerance.normal_thresholdThreshold for normality check (default from tolerances). Column norms must be 1.0 within this tolerance.
Returns:
True if the matrix is orthonormal within the specified thresholds.
function IsOrthonormal¶
Check if an array of 3x3 matrices are orthonormal.
BooleanArray inertialsim::geometry::IsOrthonormal (
const RotationMatrixArray & matrices,
std::optional< double > orthogonal_threshold=std::nullopt,
std::optional< double > normal_threshold=std::nullopt
)
Parameters:
matricesVector of matrices.orthogonal_thresholdThreshold for orthogonality check.normal_thresholdThreshold for normality check.
Returns:
Array of booleans indicating orthonormality.
function IsSorted¶
Checks if an array is sorted.
Parameters:
arrayThe array to check.
Returns:
True if the array is sorted, false otherwise.
function IsStrictlySorted¶
Checks if an array is strictly sorted.
Parameters:
arrayThe array to check.
Returns:
True if the array is strictly sorted, false otherwise.
function IsUnit¶
Check if input is close to one.
Parameters:
valueThe value to check.
Returns:
True if the value is "close" to one.
function IsUnit¶
Check if elements of an array are close to one.
Parameters:
arrayThe array to check.
Returns:
Boolean array indicating which elements are close to one.
function IsZero¶
Check if input is close to zero.
Checks if the value is within the default floating point tolerance of zero. This is crucial for avoiding numerical precision issues with small divisors and for robust algorithm implementation.
Parameters:
valueThe value to check.
Returns:
True if the value is "close" to zero within tolerance.
function IsZero¶
Check if elements of an array are close to zero.
Parameters:
arrayThe array to check.
Returns:
Boolean array indicating which elements are close to zero.
function LeviCivita¶
Levi-Civita symbol.
Parameters:
iFirst index.jSecond index.kThird index.
Returns:
+1 for even permutations of (0,1,2), -1 for odd, 0 otherwise.
function NormalizeVector¶
Normalize an array of vectors.
Normalizes vectors to unit length. Handles divide-by-zero gracefully by detecting zero-length vectors.
Parameters:
vectorsMatrix where each column is a vector to normalize (½/3xN).
Returns:
A tuple containing: * normalized vectors (same shape as input) * original norms (1 x N array)
function Rad2Deg¶
Converts radians to degrees (scalar version).
Parameters:
radiansAngle in radians.
Returns:
Angle in degrees.
function Rad2Deg¶
Converts radians to degrees (array version).
Parameters:
radiansAngle(s) in radians.
Returns:
Angle(s) in degrees.
function Sign¶
Element-wise sign function.
Parameters:
valueThe input value.
Returns:
-1 if value < 0, 1 if value >= 0.
function SkewMatrix¶
Create a skew-symmetric matrix from a single 3D vector.
Parameters:
vectorA 3D vector.
Returns:
The 3x3 skew-symmetric matrix.
function SkewMatrix¶
Create skew-symmetric matrices from multiple 3D vectors.
Parameters:
vectorsMatrix where each column is a 3D vector (3xN).
Returns:
Vector of 3x3 skew-symmetric matrices, one per column.
function SlidingWindow¶
Column-wise sliding windows over an array.
Parameters:
arrayThe input array.window_sizeSize of each window.
Returns:
Vector of windows.
function VectorArgmax¶
Find the argmax for each vector in an array.
For each column vector, finds the index of the maximum component.
Example: For vector [0.1, 0.5, 0.3]^T, returns 1 (the index of 0.5).
Parameters:
vectorsMatrix where each column is a vector (3xN).
Returns:
Array of indices (0, 1, or 2 for 3D vectors) of the largest elements in each column.
function WrapTo2Pi¶
Wraps the input angles such that 0 <= angle < 2*pi .
Parameters:
angleArray of angles. The operation is element-wise.
Returns:
Array of angles wrapped between [0, 2*pi).
function WrapToPi¶
Wraps the input angles such that -pi < angle <= pi .
Parameters:
angleArray of angles. The operation is element-wise.
Returns:
Array of angles wrapped between (-pi, pi].
The documentation for this class was generated from the following file cpp/include/inertialsim/geometry/angle.h