25 #ifndef INCLUDED_EigenExtras_h_GUID_7AE6CABA_333B_408A_C898_A2CBBE5BCE5D 26 #define INCLUDED_EigenExtras_h_GUID_7AE6CABA_333B_408A_C898_A2CBBE5BCE5D 35 #include <type_traits> 40 using ColMatrix44d = Eigen::Matrix4d;
41 using ColVector3d = Eigen::Vector3d;
42 using ColVector4d = Eigen::Vector4d;
44 using Eigen::RowVector3d;
45 using Eigen::RowVector4d;
47 template <
typename Scalar>
49 template <
typename Scalar>
53 template <
int Size,
typename PrototypeVector>
54 using SameLayoutVector =
56 PrototypeVector::IsRowMajor ? Size : 1,
57 PrototypeVector::IsRowMajor ? 1 : Size>;
62 template <
typename Derived>
63 inline detail::SameLayoutVector<4, Derived>
65 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Derived, 3);
71 template <
typename Derived>
74 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Derived, 3);
80 template <
typename Derived>
83 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Derived, 4);
84 return homogenous[3] == 0
85 ? homogenous.template head<3>().eval()
86 : (homogenous.template head<3>() / homogenous[3]).eval();
91 template <
typename Derived1,
typename Derived2>
95 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Derived1, 3);
99 "Translation and rotation do not have the same scalar type.");
107 if (refQ.
dot(q) < 0) {
117 #endif // INCLUDED_EigenExtras_h_GUID_7AE6CABA_333B_408A_C898_A2CBBE5BCE5D Definition: RunLoopManager.h:42
const Coefficients & coeffs() const
Definition: Quaternion.h:93
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
Scalar dot(const QuaternionBase< OtherDerived > &other) const
Definition: Quaternion.h:133
Header wrapping include of <Eigen/Core> and <Eigen/Geometry> for warning quieting.
Definition: ForwardDeclarations.h:236
detail::SameLayoutVector< 3, Derived > extractPoint(Eigen::MatrixBase< Derived > const &homogenous)
Pulls the 3D point or vector from a 4D vec, performing division by w if it is nonzero.
Definition: EigenExtras.h:82
Definition: newuoa.h:1888
Common base class for compact rotation representations.
Definition: ForwardDeclarations.h:231
Definition: Quaternion.h:47
Isometry3< typename Derived1::Scalar > makeIsometry(Eigen::MatrixBase< Derived1 > const &translation, Eigen::RotationBase< Derived2, 3 > const &rotation)
A simpler, functional-style alternative to .fromPositionOrientationScale when no scaling is performed...
Definition: EigenExtras.h:93
detail::SameLayoutVector< 4, Derived > makeHomogeneousPoint(Eigen::MatrixBase< Derived > const &vec)
Makes a 3D vector into a 4D homogeneous point, with the same options (scalar, row vs col vector) as t...
Definition: EigenExtras.h:64
detail::SameLayoutVector< 4, Derived > makeHomogeneousVector(Eigen::MatrixBase< Derived > const &vec)
Makes a 3D vector into a 4D homogeneous vector, with the same options (scalar, row vs col vector) as ...
Definition: EigenExtras.h:73
Quaternion< double > Quaterniond
double precision quaternion type
Definition: Quaternion.h:211
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:127
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
double Scalar
Common scalar type.
Definition: FlexibleKalmanBase.h:48