Go to the documentation of this file.
4 #ifndef SOPHUS_RXSO3_HPP
5 #define SOPHUS_RXSO3_HPP
10 template <
class Scalar_,
int Options = 0>
19 template <
class Scalar_,
int Options>
20 struct traits<
Sophus::RxSO3<Scalar_, Options>> {
25 template <
class Scalar_,
int Options>
26 struct traits<Map<
Sophus::RxSO3<Scalar_>, Options>>
27 : traits<Sophus::RxSO3<Scalar_, Options>> {
32 template <
class Scalar_,
int Options>
33 struct traits<Map<
Sophus::RxSO3<Scalar_> const, Options>>
34 : traits<Sophus::RxSO3<Scalar_, Options> const> {
66 template <
class Derived>
69 using Scalar =
typename Eigen::internal::traits<Derived>::Scalar;
71 typename Eigen::internal::traits<Derived>::QuaternionType;
75 static int constexpr
DoF = 4;
79 static int constexpr
N = 3;
88 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
98 template <
typename OtherDerived>
99 using ReturnScalar =
typename Eigen::ScalarBinaryOpTraits<
100 Scalar,
typename OtherDerived::Scalar>::ReturnType;
102 template <
typename OtherDerived>
105 template <
typename Po
intDerived>
108 template <
typename HPo
intDerived>
128 template <
class NewScalarType>
176 result.tangent.template head<3>() = omega_and_theta.tangent;
177 result.theta = omega_and_theta.theta;
203 sR(0, 0) = vx_sq - vy_sq - vz_sq + w_sq;
204 sR(1, 0) = two_vx_vy + two_vz_w;
205 sR(2, 0) = two_vx_vz - two_vy_w;
207 sR(0, 1) = two_vx_vy - two_vz_w;
208 sR(1, 1) = -vx_sq + vy_sq - vz_sq + w_sq;
209 sR(2, 1) = two_vx_w + two_vy_vz;
211 sR(0, 2) = two_vx_vz + two_vy_w;
212 sR(1, 2) = -two_vx_w + two_vy_vz;
213 sR(2, 2) = -vx_sq - vy_sq + vz_sq + w_sq;
223 template <
class OtherDerived>
236 template <
typename OtherDerived>
243 ResultT
scale = result_quaternion.squaredNorm();
247 result_quaternion.normalize();
261 template <
typename PointDerived,
262 typename =
typename std::enable_if<
265 Eigen::MatrixBase<PointDerived>
const& p)
const {
269 two_vec_cross_p += two_vec_cross_p;
276 template <
typename HPointDerived,
277 typename =
typename std::enable_if<
280 Eigen::MatrixBase<HPointDerived>
const& p)
const {
281 const auto rsp = *
this * p.template head<3>();
294 return Line((*
this) * l.origin(),
304 template <
typename OtherDerived,
305 typename =
typename std::enable_if<
306 std::is_same<Scalar, ReturnScalar<OtherDerived>>::value>::type>
309 *
static_cast<Derived*
>(
this) = *
this * other;
328 "Scale factor must be greater-equal epsilon.");
335 return static_cast<Derived const*
>(
this)->
quaternion();
342 norm_quad.normalize();
343 return norm_quad.toRotationMatrix();
381 (squared_sR(0, 0) + squared_sR(1, 1) + squared_sR(2, 2));
384 "Scale factor must be greater-equal epsilon.");
410 template <
class Scalar_,
int Options>
411 class RxSO3 :
public RxSO3Base<RxSO3<Scalar_, Options>> {
425 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
439 template <
class OtherDerived>
449 this->setScaledRotationMatrix(sR);
460 "Scale factor must be greater-equal epsilon.");
472 "Scale factor must be greater-equal epsilon.");
484 static_assert(std::is_same<typename D::Scalar, Scalar>::value,
485 "must be same Scalar type.");
487 "Scale factor must be greater-equal epsilon.");
527 Eigen::Quaternion<Scalar> quat =
529 quat.coeffs() *= sqrt_scale;
558 SOPHUS_ENSURE(i >= 0 && i <= 3,
"i should be in range [0,3].");
582 A << a(3), -a(2), a(1),
602 res.template head<3>() = omega1.cross(omega2);
612 template <
class UniformRandomBitGenerator>
614 std::uniform_real_distribution<Scalar> uniform(
Scalar(-1),
Scalar(1));
635 return Tangent(Omega(2, 1), Omega(0, 2), Omega(1, 0), Omega(0, 0));
652 template <
class Scalar_,
int Options>
653 class Map<
Sophus::RxSO3<Scalar_>, Options>
668 EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Map);
671 using Base::operator*=;
672 using Base::operator*;
679 Map<Eigen::Quaternion<Scalar>, Options>
const&
quaternion()
const {
695 template <
class Scalar_,
int Options>
696 class Map<
Sophus::RxSO3<Scalar_> const, Options>
707 using Base::operator*=;
708 using Base::operator*;
716 Map<Eigen::Quaternion<Scalar>
const, Options>
const&
quaternion()
const {
SOPHUS_FUNC QuaternionMember const & quaternion() const
SOPHUS_FUNC RxSO3< NewScalarType > cast() const
SOPHUS_FUNC RxSO3Base< Derived > & operator=(RxSO3Base< OtherDerived > const &other)
Matrix< Scalar, DoF, DoF > Adjoint
SOPHUS_FUNC RxSO3Base< Derived > & operator*=(RxSO3Base< OtherDerived > const &other)
static SOPHUS_FUNC RxSO3< Scalar > exp(Tangent const &a)
SOPHUS_FUNC RxSO3< Scalar > inverse() const
SO3 using default storage; derived from SO3Base.
static RxSO3 sampleUniform(UniformRandomBitGenerator &generator)
typename Base::Adjoint Adjoint
SOPHUS_FUNC void setScale(Scalar const &scale)
SOPHUS_FUNC RxSO3Base & operator=(RxSO3Base const &other)=default
typename Base::HomogeneousPoint HomogeneousPoint
Vector< Scalar, 3, Options > Vector3
Map< Eigen::Quaternion< Scalar >, Options > quaternion_
Matrix< Scalar, N, N > Transformation
Vector4< ReturnScalar< HPointDerived > > HomogeneousPointProduct
typename Eigen::internal::traits< Map< Sophus::RxSO3< Scalar_ > const, Options > >::QuaternionType QuaternionType
#define SOPHUS_ENSURE(expr,...)
static SOPHUS_FUNC Tangent lieBracket(Tangent const &a, Tangent const &b)
static constexpr int num_parameters
Number of internal parameters used (quaternion is a 4-tuple).
Vector< Scalar, DoF > Tangent
SOPHUS_FUNC Sophus::Vector< Scalar, num_parameters > params() const
QuaternionMember quaternion_
SOPHUS_FUNC TangentAndTheta logAndTheta() const
SOPHUS_FUNC Map(Scalar const *coeffs)
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Tangent tangent
const Map< Eigen::Quaternion< Scalar > const, Options > quaternion_
SOPHUS_FUNC void setScaledRotationMatrix(Transformation const &sR)
Eigen::Quaternion< Scalar, Options > QuaternionType
typename Base::Point Point
typename Base::Transformation Transformation
typename Eigen::ScalarBinaryOpTraits< Scalar, typename OtherDerived::Scalar >::ReturnType ReturnScalar
typename Base::HomogeneousPoint HomogeneousPoint
ParametrizedLine< Scalar, 3, Options > ParametrizedLine3
SOPHUS_FUNC SO3< Scalar > so3() const
static SOPHUS_FUNC RxSO3< Scalar > expAndTheta(Tangent const &a, Scalar *theta)
SOPHUS_FUNC RxSO3(Scalar const &scale, Transformation const &R)
Vector3< ReturnScalar< PointDerived > > PointProduct
SOPHUS_FUNC void setRotationMatrix(Transformation const &R)
SOPHUS_FUNC PointProduct< PointDerived > operator*(Eigen::MatrixBase< PointDerived > const &p) const
typename Base::Adjoint Adjoint
SOPHUS_FUNC HomogeneousPointProduct< HPointDerived > operator*(Eigen::MatrixBase< HPointDerived > const &p) const
SOPHUS_FUNC RxSO3(Eigen::QuaternionBase< D > const &quat)
Eigen::Matrix< Scalar, M, N > Matrix
SOPHUS_FUNC Map< Eigen::Quaternion< Scalar >, Options > & quaternion_nonconst()
static SOPHUS_FUNC Transformation hat(Tangent const &a)
typename Base::Tangent Tangent
SOPHUS_FUNC void setQuaternion(Eigen::Quaternion< Scalar > const &quat)
SOPHUS_FUNC QuaternionType & quaternion_nonconst()
SOPHUS_FUNC Scalar * data()
typename Base::HomogeneousPoint HomogeneousPoint
SOPHUS_FUNC Map< Eigen::Quaternion< Scalar >, Options > const & quaternion() const
typename Base::Point Point
SOPHUS_FUNC Line operator*(Line const &l) const
static SOPHUS_FUNC Transformation Dxi_exp_x_matrix_at_0(int i)
typename Base::Transformation Transformation
SOPHUS_FUNC QuaternionMember & quaternion_nonconst()
SOPHUS_FUNC Transformation rotationMatrix() const
static SOPHUS_FUNC Transformation generator(int i)
Eigen::Quaternion< Scalar, Options > QuaternionMember
auto squaredNorm(T const &p) -> decltype(details::SquaredNorm< T >::impl(p))
SOPHUS_FUNC Adjoint Adj() const
SOPHUS_FUNC Tangent log() const
Vector< Scalar, 4 > Vector4
typename Base::Point Point
static constexpr int N
Group transformations are 3x3 matrices.
Map< Eigen::Quaternion< Scalar > const, Options > QuaternionType
static SOPHUS_FUNC Tangent vee(Transformation const &Omega)
Eigen::Matrix< Scalar, M, 1, Options > Vector
SOPHUS_FUNC RxSO3Product< OtherDerived > operator*(RxSO3Base< OtherDerived > const &other) const
typename Base::Adjoint Adjoint
SOPHUS_FUNC Transformation matrix() const
typename Base::Transformation Transformation
static SOPHUS_FUNC SO3< Scalar > expAndTheta(Tangent const &omega, Scalar *theta)
SOPHUS_FUNC RxSO3(Transformation const &sR)
SOPHUS_FUNC RxSO3(RxSO3Base< OtherDerived > const &other)
SOPHUS_FUNC Scalar const * data() const
SOPHUS_FUNC Scalar scale() const
Vector4< Scalar > HomogeneousPoint
RxSO3 using storage; derived from RxSO3Base.
SOPHUS_FUNC QuaternionType const & quaternion() const
EIGEN_MAKE_ALIGNED_OPERATOR_NEW SOPHUS_FUNC RxSO3()
SOPHUS_FUNC RxSO3(Scalar const &scale, SO3< Scalar > const &so3)
ParametrizedLine3< Scalar > Line
SOPHUS_FUNC void setSO3(SO3< Scalar > const &so3)
typename Eigen::internal::traits< Map< Sophus::RxSO3< Scalar_ > const, Options > >::Scalar Scalar
SOPHUS_FUNC Map< Eigen::Quaternion< Scalar > const, Options > const & quaternion() const
typename Base::Tangent Tangent
typename Base::Tangent Tangent
sophus
Author(s): Hauke Strasdat
autogenerated on Wed Mar 2 2022 01:01:47