Go to the documentation of this file.
18 template <
class Scalar_,
int Options = 0>
27 template <
class Scalar_,
int Options>
28 struct traits<
Sophus::SO2<Scalar_, Options>> {
33 template <
class Scalar_,
int Options>
34 struct traits<Map<
Sophus::SO2<Scalar_>, Options>>
35 : traits<Sophus::SO2<Scalar_, Options>> {
40 template <
class Scalar_,
int Options>
41 struct traits<Map<
Sophus::SO2<Scalar_> const, Options>>
42 : traits<Sophus::SO2<Scalar_, Options> const> {
44 using ComplexType = Map<Sophus::Vector2<Scalar>
const, Options>;
76 template <
class Derived>
79 using Scalar =
typename Eigen::internal::traits<Derived>::Scalar;
80 using ComplexT =
typename Eigen::internal::traits<Derived>::ComplexType;
84 static int constexpr
DoF = 1;
88 static int constexpr
N = 2;
100 template <
typename OtherDerived>
101 using ReturnScalar =
typename Eigen::ScalarBinaryOpTraits<
102 Scalar,
typename OtherDerived::Scalar>::ReturnType;
104 template <
typename OtherDerived>
107 template <
typename Po
intDerived>
110 template <
typename HPo
intDerived>
125 template <
class NewScalarType>
172 "Complex number should not be close to zero!");
200 template <
class OtherDerived>
208 template <
typename OtherDerived>
214 typename OtherDerived::Scalar
const& rhs_real = other.
unit_complex().x();
215 typename OtherDerived::Scalar
const& rhs_imag = other.
unit_complex().y();
217 ResultT
const result_real = lhs_real * rhs_real - lhs_imag * rhs_imag;
218 ResultT
const result_imag = lhs_real * rhs_imag + lhs_imag * rhs_real;
221 result_real * result_real + result_imag * result_imag;
230 ResultT
const scale = ResultT(2.0) / (ResultT(1.0) +
squared_norm);
241 template <
typename PointDerived,
242 typename =
typename std::enable_if<
245 Eigen::MatrixBase<PointDerived>
const& p)
const {
249 imag * p[0] + real * p[1]);
257 template <
typename HPointDerived,
258 typename =
typename std::enable_if<
261 Eigen::MatrixBase<HPointDerived>
const& p)
const {
265 real * p[0] - imag * p[1], imag * p[0] + real * p[1], p[2]);
276 return Line((*
this) * l.origin(), (*
this) * l.direction());
282 template <
typename OtherDerived,
283 typename =
typename std::enable_if<
284 std::is_same<Scalar, ReturnScalar<OtherDerived>>::value>::type>
286 *
static_cast<Derived*
>(
this) = *
this * other;
319 return static_cast<Derived const*
>(
this)->
unit_complex();
333 template <
class Scalar_,
int Options>
334 class SO2 :
public SO2Base<SO2<Scalar_, Options>> {
351 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
363 template <
class OtherDerived>
373 Scalar(0.5) * (R(1, 0) - R(0, 1))) {
395 static_assert(std::is_same<typename D::Scalar, Scalar>::value,
396 "must be same Scalar type");
483 template <
class S = Scalar>
500 template <
class UniformRandomBitGenerator>
503 "generator must meet the UniformRandomBitGenerator concept");
542 template <
class Scalar_,
int Options>
559 EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Map);
562 using Base::operator*=;
563 using Base::operator*;
566 Map(Scalar* coeffs) : unit_complex_(coeffs) {}
572 return unit_complex_;
580 return unit_complex_;
590 template <
class Scalar_,
int Options>
591 class Map<
Sophus::SO2<Scalar_> const, Options>
602 using Base::operator*=;
603 using Base::operator*;
611 return unit_complex_;
621 #endif // SOPHUS_SO2_HPP
typename Base::Transformation Transformation
typename Base::HomogeneousPoint HomogeneousPoint
SOPHUS_FUNC Scalar const * data() const
typename Base::Transformation Transformation
SO2 using default storage; derived from SO2Base.
SOPHUS_FUNC Scalar * data()
SOPHUS_FUNC Line operator*(Line const &l) const
typename Base::Tangent Tangent
Vector< Scalar, 3, Options > Vector3
SOPHUS_FUNC ComplexMember & unit_complex_nonconst()
static SOPHUS_FUNC Transformation Dxi_exp_x_matrix_at_0(int)
static SOPHUS_FUNC SO2< Scalar > exp(Tangent const &theta)
SOPHUS_FUNC Adjoint Adj() const
typename Base::Tangent Tangent
const Map< Matrix< Scalar, 2, 1 > const, Options > unit_complex_
typename std::enable_if< B, T >::type enable_if_t
#define SOPHUS_ENSURE(expr,...)
SOPHUS_FUNC SO2< NewScalarType > cast() const
SOPHUS_FUNC Map< Sophus::Vector2< Scalar > const, Options > const & unit_complex() const
Matrix< Scalar, N, N > Transformation
SOPHUS_FUNC Map< Sophus::Vector2< Scalar >, Options > & unit_complex_nonconst()
SOPHUS_FUNC SO2(Scalar const &real, Scalar const &imag)
SOPHUS_FUNC SO2(Eigen::MatrixBase< D > const &complex)
Vector< Scalar, 2, Options > Vector2
SOPHUS_FUNC Transformation matrix() const
SOPHUS_FUNC ComplexT & unit_complex_nonconst()
static constexpr int num_parameters
typename Base::HomogeneousPoint HomogeneousPoint
SOPHUS_FUNC SO2Product< OtherDerived > operator*(SO2Base< OtherDerived > const &other) const
typename Eigen::ScalarBinaryOpTraits< Scalar, typename OtherDerived::Scalar >::ReturnType ReturnScalar
SOPHUS_FUNC SO2(Transformation const &R)
SOPHUS_FUNC SO2< Scalar > inverse() const
SOPHUS_FUNC ComplexT const & unit_complex() const
ParametrizedLine2< Scalar > Line
Eigen::Matrix< Scalar, M, N > Matrix
static constexpr int num_parameters
Number of internal parameters used (complex numbers are a tuples).
static SOPHUS_FUNC Tangent lieBracket(Tangent const &, Tangent const &)
SOPHUS_FUNC Matrix< Scalar, num_parameters, DoF > Dx_this_mul_exp_x_at_0() const
SOPHUS_FUNC HomogeneousPointProduct< HPointDerived > operator*(Eigen::MatrixBase< HPointDerived > const &p) const
SOPHUS_FUNC bool isOrthogonal(Eigen::MatrixBase< D > const &R)
ComplexMember unit_complex_
Vector2< Scalar, Options > ComplexMember
SOPHUS_FUNC SO2Base< Derived > operator*=(SO2Base< OtherDerived > const &other)
SOPHUS_FUNC Sophus::Vector< Scalar, num_parameters > params() const
SOPHUS_FUNC void setComplex(Point const &complex)
static SOPHUS_FUNC Sophus::Matrix< Scalar, num_parameters, DoF > Dx_exp_x_at_0()
static SOPHUS_FUNC enable_if_t< std::is_floating_point< S >::value, SO2 > fitToSO2(Transformation const &R)
static constexpr int N
Group transformations are 2x2 matrices.
SOPHUS_FUNC enable_if_t< std::is_floating_point< typename D::Scalar >::value, Matrix< typename D::Scalar, D::RowsAtCompileTime, D::RowsAtCompileTime > > makeRotationMatrix(Eigen::MatrixBase< D > const &R)
EIGEN_MAKE_ALIGNED_OPERATOR_NEW SOPHUS_FUNC SO2()
SOPHUS_FUNC Scalar log() const
Vector2< ReturnScalar< PointDerived > > PointProduct
typename Eigen::internal::traits< Map< Sophus::SO2< Scalar_ > const, Options > >::ComplexType ComplexT
typename Eigen::internal::traits< Map< Sophus::SO2< Scalar_ > const, Options > >::Scalar Scalar
SOPHUS_FUNC SO2(SO2Base< OtherDerived > const &other)
static SOPHUS_FUNC Transformation generator()
static SOPHUS_FUNC Transformation hat(Tangent const &theta)
Map< Sophus::Vector2< Scalar > const, Options > ComplexType
typename Base::Adjoint Adjoint
Vector3< Scalar > HomogeneousPoint
SOPHUS_FUNC SO2Base< Derived > & operator=(SO2Base< OtherDerived > const &other)
typename Base::Adjoint Adjoint
SOPHUS_FUNC void normalize()
SOPHUS_FUNC SO2(Scalar theta)
typename Base::Tangent Tangent
Map< Matrix< Scalar, 2, 1 >, Options > unit_complex_
SOPHUS_FUNC PointProduct< PointDerived > operator*(Eigen::MatrixBase< PointDerived > const &p) const
typename Base::Adjoint Adjoint
static SO2 sampleUniform(UniformRandomBitGenerator &generator)
Eigen::Matrix< Scalar, M, 1, Options > Vector
Vector3< ReturnScalar< HPointDerived > > HomogeneousPointProduct
typename Base::HomogeneousPoint HomogeneousPoint
typename Base::Point Point
SOPHUS_FUNC Map< Sophus::Vector2< Scalar >, Options > const & unit_complex() const
typename Base::Transformation Transformation
ParametrizedLine< Scalar, 2, Options > ParametrizedLine2
Sophus::Vector2< Scalar, Options > ComplexType
static SOPHUS_FUNC Sophus::Matrix< Scalar, num_parameters, DoF > Dx_exp_x(Tangent const &theta)
SOPHUS_FUNC SO2Base & operator=(SO2Base const &other)=default
SOPHUS_FUNC Map(Scalar const *coeffs)
typename Base::Point Point
static SOPHUS_FUNC Tangent vee(Transformation const &Omega)
typename Base::Point Point
SOPHUS_FUNC ComplexMember const & unit_complex() const
sophus
Author(s): Hauke Strasdat
autogenerated on Wed Mar 2 2022 01:01:48