Go to the documentation of this file.
4 #ifndef SOPHUS_RXSO2_HPP
5 #define SOPHUS_RXSO2_HPP
10 template <
class Scalar_,
int Options = 0>
19 template <
class Scalar_,
int Options>
20 struct traits<
Sophus::RxSO2<Scalar_, Options>> {
25 template <
class Scalar_,
int Options>
26 struct traits<Map<
Sophus::RxSO2<Scalar_>, Options>>
27 : traits<Sophus::RxSO2<Scalar_, Options>> {
32 template <
class Scalar_,
int Options>
33 struct traits<Map<
Sophus::RxSO2<Scalar_> const, Options>>
34 : traits<Sophus::RxSO2<Scalar_, Options> const> {
36 using ComplexType = Map<Sophus::Vector2<Scalar>
const, Options>;
75 template <
class Derived>
78 using Scalar =
typename Eigen::internal::traits<Derived>::Scalar;
79 using ComplexType =
typename Eigen::internal::traits<Derived>::ComplexType;
83 static int constexpr
DoF = 2;
87 static int constexpr
N = 2;
99 template <
typename OtherDerived>
100 using ReturnScalar =
typename Eigen::ScalarBinaryOpTraits<
101 Scalar,
typename OtherDerived::Scalar>::ReturnType;
103 template <
typename OtherDerived>
106 template <
typename Po
intDerived>
109 template <
typename HPo
intDerived>
128 template <
class NewScalarType>
152 -
complex().y() / squared_scale);
194 template <
class OtherDerived>
207 template <
typename OtherDerived>
214 typename OtherDerived::Scalar
const& rhs_real = other.
complex().x();
215 typename OtherDerived::Scalar
const& rhs_imag = other.
complex().y();
218 lhs_real * rhs_real - lhs_imag * rhs_imag,
219 lhs_real * rhs_imag + lhs_imag * rhs_real);
221 const ResultT squared_scale = result_complex.squaredNorm();
226 result_complex.normalize();
239 template <
typename PointDerived,
240 typename =
typename std::enable_if<
243 Eigen::MatrixBase<PointDerived>
const& p)
const {
249 template <
typename HPointDerived,
250 typename =
typename std::enable_if<
253 Eigen::MatrixBase<HPointDerived>
const& p)
const {
254 const auto rsp = *
this * p.template head<2>();
267 return Line((*
this) * l.origin(), (*
this) * l.direction() /
scale());
276 template <
typename OtherDerived,
277 typename =
typename std::enable_if<
278 std::is_same<Scalar, ReturnScalar<OtherDerived>>::value>::type>
281 *
static_cast<Derived*
>(
this) = *
this * other;
299 "Scale factor must be greater-equal epsilon.");
306 return static_cast<Derived const*
>(
this)->
complex();
313 norm_quad.normalize();
349 "sR must be scaled orthogonal:\n %", sR);
373 template <
class Scalar_,
int Options>
374 class RxSO2 :
public RxSO2Base<RxSO2<Scalar_, Options>> {
388 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
401 template <
class OtherDerived>
411 this->setScaledRotationMatrix(sR);
427 :
RxSO2((scale * so2.unit_complex()).eval()) {}
436 "Scale factor must be greater-equal epsilon: % vs %",
470 Scalar const theta = a[0];
471 Scalar const sigma = a[1];
543 template <
class UniformRandomBitGenerator>
545 std::uniform_real_distribution<Scalar> uniform(
Scalar(-1),
Scalar(1));
565 return Tangent(Omega(1, 0), Omega(0, 0));
582 template <
class Scalar_,
int Options>
583 class Map<
Sophus::RxSO2<Scalar_>, Options>
599 EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Map);
601 using Base::operator*=;
602 using Base::operator*;
609 Map<Sophus::Vector2<Scalar>, Options>
const&
complex()
const {
625 template <
class Scalar_,
int Options>
626 class Map<
Sophus::RxSO2<Scalar_> const, Options>
637 using Base::operator*=;
638 using Base::operator*;
646 Map<Sophus::Vector2<Scalar>
const, Options>
const&
complex()
const {
651 Map<Sophus::Vector2<Scalar>
const, Options>
const complex_;
SOPHUS_FUNC RxSO2Product< OtherDerived > operator*(RxSO2Base< OtherDerived > const &other) const
EIGEN_MAKE_ALIGNED_OPERATOR_NEW SOPHUS_FUNC RxSO2()
Eigen::Matrix< Scalar, 2, 1, Options > ComplexMember
SOPHUS_FUNC Scalar const * data() const
Vector3< Scalar > HomogeneousPoint
SO2 using default storage; derived from SO2Base.
Vector2< ReturnScalar< PointDerived > > PointProduct
Sophus::Vector2< Scalar, Options > ComplexType
typename Eigen::internal::traits< Map< Sophus::RxSO2< Scalar_ > const, Options > >::Scalar Scalar
static constexpr int N
Group transformations are 2x2 matrices.
SOPHUS_FUNC Scalar * data()
SOPHUS_FUNC RxSO2< NewScalarType > cast() const
SOPHUS_FUNC RxSO2Base & operator=(RxSO2Base const &other)=default
SOPHUS_FUNC RxSO2Base< Derived > & operator*=(RxSO2Base< OtherDerived > const &other)
SOPHUS_FUNC Transformation matrix() const
SOPHUS_FUNC void setScale(Scalar const &scale)
Vector< Scalar, 3, Options > Vector3
typename Base::HomogeneousPoint HomogeneousPoint
static SOPHUS_FUNC SO2< Scalar > exp(Tangent const &theta)
typename Eigen::internal::traits< Map< Sophus::RxSO2< Scalar_ > const, Options > >::ComplexType ComplexType
SOPHUS_FUNC void setComplex(Vector2< Scalar > const &z)
typename Base::Transformation Transformation
#define SOPHUS_ENSURE(expr,...)
SOPHUS_FUNC RxSO2(Transformation const &sR)
SOPHUS_FUNC ComplexType const & complex() const
static RxSO2 sampleUniform(UniformRandomBitGenerator &generator)
SOPHUS_FUNC Adjoint Adj() const
Vector< Scalar, 2, Options > Vector2
typename Base::Point Point
SOPHUS_FUNC RxSO2(Scalar const &scale, Transformation const &R)
typename Base::Tangent Tangent
ParametrizedLine2< Scalar > Line
typename Base::Tangent Tangent
SOPHUS_FUNC RxSO2(Scalar const &real, Scalar const &imag)
SOPHUS_FUNC RxSO2(Scalar const &scale, SO2< Scalar > const &so2)
static SOPHUS_FUNC RxSO2< Scalar > exp(Tangent const &a)
SOPHUS_FUNC Scalar scale() const
Map< Sophus::Vector2< Scalar > const, Options > ComplexType
static SOPHUS_FUNC Tangent lieBracket(Tangent const &, Tangent const &)
static SOPHUS_FUNC Scalar epsilon()
Eigen::Matrix< Scalar, M, N > Matrix
SOPHUS_FUNC RxSO2< Scalar > inverse() const
Vector3< ReturnScalar< HPointDerived > > HomogeneousPointProduct
typename Base::HomogeneousPoint HomogeneousPoint
static constexpr int num_parameters
Number of internal parameters used (complex number is a tuple).
static SOPHUS_FUNC Tangent vee(Transformation const &Omega)
SOPHUS_FUNC Map< Sophus::Vector2< Scalar >, Options > const & complex() const
SOPHUS_FUNC Map< Sophus::Vector2< Scalar > const, Options > const & complex() const
SOPHUS_FUNC RxSO2(RxSO2Base< OtherDerived > const &other)
SOPHUS_FUNC Scalar angle() const
SOPHUS_FUNC void setScaledRotationMatrix(Transformation const &sR)
SOPHUS_FUNC SO2< Scalar > so2() const
SOPHUS_FUNC ComplexMember const & complex() const
SOPHUS_FUNC Map< Sophus::Vector2< Scalar >, Options > & complex_nonconst()
Vector< Scalar, DoF > Tangent
static SOPHUS_FUNC Transformation generator(int i)
typename Eigen::ScalarBinaryOpTraits< Scalar, typename OtherDerived::Scalar >::ReturnType ReturnScalar
SOPHUS_FUNC Sophus::Vector< Scalar, num_parameters > params() const
SOPHUS_FUNC RxSO2(Vector2< Scalar > const &z)
RxSO2 using storage; derived from RxSO2Base.
SOPHUS_FUNC Line operator*(Line const &l) const
SOPHUS_FUNC PointProduct< PointDerived > operator*(Eigen::MatrixBase< PointDerived > const &p) const
Map< Sophus::Vector2< Scalar >, Options > complex_
Matrix< Scalar, N, N > Transformation
SOPHUS_FUNC void setRotationMatrix(Transformation const &R)
SOPHUS_FUNC Transformation rotationMatrix() const
typename Base::Adjoint Adjoint
Eigen::Matrix< Scalar, M, 1, Options > Vector
const Map< Sophus::Vector2< Scalar > const, Options > complex_
SOPHUS_FUNC RxSO2Base< Derived > & operator=(RxSO2Base< OtherDerived > const &other)
SOPHUS_FUNC ComplexMember & complex_nonconst()
typename Base::Adjoint Adjoint
SOPHUS_FUNC Tangent log() const
static SOPHUS_FUNC Transformation hat(Tangent const &a)
typename Base::Point Point
ParametrizedLine< Scalar, 2, Options > ParametrizedLine2
SOPHUS_FUNC ComplexType & complex_nonconst()
SOPHUS_FUNC HomogeneousPointProduct< HPointDerived > operator*(Eigen::MatrixBase< HPointDerived > const &p) const
typename Base::Transformation Transformation
SOPHUS_FUNC bool isScaledOrthogonalAndPositive(Eigen::MatrixBase< D > const &sR)
static SOPHUS_FUNC Transformation Dxi_exp_x_matrix_at_0(int i)
SOPHUS_FUNC void setAngle(Scalar const &theta)
Matrix< Scalar, DoF, DoF > Adjoint
SOPHUS_FUNC Map(Scalar const *coeffs)
SOPHUS_FUNC void setSO2(SO2< Scalar > const &so2)
sophus
Author(s): Hauke Strasdat
autogenerated on Wed Mar 2 2022 01:01:47