30 return (u.x << 1) > 0xff000000u;
47inline T
sqr(
const T& x) {
52template <
typename T =
float>
54 return (std::abs(l - r) < eps);
330 const Eigen::Vector3<T>& o1,
331 const Eigen::Vector3<T>& d1,
332 const Eigen::Vector3<T>& o2,
333 const Eigen::Vector3<T>& d2,
334 T maxDist = std::numeric_limits<T>::max());
344 Eigen::Matrix<T, 3, 3> result;
345 result << T(0), -v.z(), v.y(), v.z(), T(0), -v.x(), -v.y(), v.x(), T(0);
Eigen::Matrix< T, 3, 3 > crossProductMatrix(const Eigen::Vector3< T > &v)
Creates a skew-symmetric matrix for computing cross products.
Quaternionf quaternionAverage(momentum::span< const Quaternionf > q, momentum::span< const float > w)
Computes the weighted average of multiple quaternions.
constexpr T Eps(T FloatEps=T(1e-7), T DoubleEps=T(1e-16))
Returns a type-appropriate tolerance/epsilon value.
T rotationMatrixToOneAxisEuler(const Matrix3< T > &m, int axis0)
Fits a single-axis Euler rotation to a rotation matrix.
Vector3< T > rotationMatrixToEuler(const Matrix3< T > &m, int axis0, int axis1, int axis2, EulerConvention convention)
Converts rotation matrix to Euler angles.
Quaternion< float > Quaternionf
Vector3< T > rotationMatrixToEulerXYZ(const Matrix3< T > &m, EulerConvention convention)
An optimized version of rotationMatrixToEuler(m, 0, 1, 2, convention) or rotationMatrixToEuler(m,...
Matrix3< T > eulerXYZToRotationMatrix(const Vector3< T > &angles, EulerConvention convention)
An optimized version of eulerToRotationMatrix(angles, 0, 1, 2, convention) or eulerToRotationMatrix(a...
ParameterSet allParams()
Creates a ParameterSet with all parameters set to active.
bool IsNanNoOpt(float f)
NaN check function that isn't optimized away by fastmath.
Vector3< T > quaternionToEuler(const Quaternion< T > &q)
Converts a quaternion to Euler angles using the Extrinsic XYZ convention.
Eigen::Matrix< T, 3, 3 > Matrix3
Vector3< T > rotationMatrixToEulerZYX(const Matrix3< T > &m, EulerConvention convention)
An optimized version of rotationMatrixToEuler(m, 2, 1, 0, convention) or rotationMatrixToEuler(m,...
Vector3< T > quaternionLogMap(const Quaternion< T > &q)
Computes the logarithmic map from a quaternion to a rotation vector (axis-angle in R^3).
EulerConvention
The Euler angles convention.
@ Extrinsic
The extrinsic convention.
@ Intrinsic
The intrinsic convention.
Vector2< T > rotationMatrixToTwoAxisEuler(const Matrix3< T > &m, int axis0, int axis1)
Fits a two-axis Euler rotation to a rotation matrix.
MatrixX< T > pseudoInverse(const MatrixX< T > &mat)
Calculates the pseudo-inverse of a matrix.
Eigen::Quaternion< T > Quaternion
Unit quaternion representing a 3D rotation.
bool isApprox(T l, T r, T eps=Eps< T >(1e-4, 1e-6)) noexcept
Determines if two values are approximately equal within a given tolerance.
Eigen::Matrix< T, Dynamic, Dynamic > MatrixX
Dynamic-size, column-major dense matrix.
Eigen::SparseMatrix< T > SparseMatrix
Column-major sparse matrix.
T sqr(const T &x)
Computes the square of a value.
std::tuple< bool, T, Eigen::Vector2< T > > closestPointsOnSegments(const Eigen::Vector3< T > &o1, const Eigen::Vector3< T > &d1, const Eigen::Vector3< T > &o2, const Eigen::Vector3< T > &d2, const T maxDist)
Returns the closest points on two line segments where the line segments are represented in origin and...
Matrix3< T > eulerToRotationMatrix(const Vector3< T > &angles, int axis0, int axis1, int axis2, EulerConvention convention)
Converts Euler angles to rotation matrix.
Matrix3< T > eulerZYXToRotationMatrix(const Vector3< T > &angles, EulerConvention convention)
An optimized version of eulerToRotationMatrix(angles, 2, 1, 0, convention) or eulerToRotationMatrix(a...
Quaternion< T > eulerToQuaternion(const Vector3< T > &angles, int axis0, int axis1, int axis2, EulerConvention convention)
Converts Euler angles to quaternion.
gsl::span< T > span
Span type alias using gsl::span (C++17 fallback).
Eigen::Matrix< T, 3, 4 > quaternionLogMapDerivative(const Quaternion< T > &q)
Computes the derivative of the logarithmic map with respect to quaternion components.
Quaternion< T > quaternionExpMap(const Vector3< T > &v)
Computes the exponential map from a rotation vector (axis-angle in R^3) to a quaternion.
std::bitset< kMaxModelParams > ParameterSet
Bitset for model parameter enablement.