template class Eigen::Map<sophus::So2<TScalar>, kOptions>¶
Overview¶
Specialization of Eigen::Map for So2
; derived from So2Base. More…
#include <so2.h> template <class TScalar, int kOptions> class Map<sophus::So2<TScalar>, kOptions>: public sophus::So2Base { public: // typedefs using Base = sophus::So2Base<Map<sophus::So2<TScalar>, kOptions>> ; using Scalar = TScalar ; using Transformation = typename Base::Transformation ; using Point = typename Base::Point ; using HomogeneousPoint = typename Base::HomogeneousPoint ; using Tangent = typename Base::Tangent ; using Adjoint = typename Base::Adjoint ; // construction Map(Scalar* coeffs); // methods SOPHUS_FUNC Map<Eigen::Vector2<Scalar>, kOptions> const& unitComplex() const; template <class TOtherDerived> SOPHUS_FUNC So2Base<TDerived>& operator=(So2Base<TOtherDerived> const& other); template < typename TOtherDerived, typename = typename std::enable_if<std::is_same<Scalar, ReturnScalar<TOtherDerived>>::value>::type > SOPHUS_FUNC So2Base<TDerived> operator*=(So2Base<TOtherDerived> const& other); template <class TOtherDerived> SOPHUS_FUNC So2Product<TOtherDerived> operator*(So2Base<TOtherDerived> const& other); template < typename TPointDerived, typename = typename std::enable_if<IsFixedSizeVector<TPointDerived, 2>::value>::type > SOPHUS_FUNC PointProduct<TPointDerived> operator*(Eigen::MatrixBase<TPointDerived> const& p); template < typename THPointDerived, typename = typename std::enable_if<IsFixedSizeVector<THPointDerived, 3>::value>::type > SOPHUS_FUNC HomogeneousPointProduct<THPointDerived> operator*(Eigen::MatrixBase<THPointDerived> const& p); SOPHUS_FUNC Line operator*(Line const& l); SOPHUS_FUNC Hyperplane operator*(Hyperplane const& p); protected: // fields Map<Eigen::Matrix<Scalar, 2, 1>, kOptions> unit_complex_; // methods SOPHUS_FUNC Map<Eigen::Vector2<Scalar>, kOptions>& mutUnitComplex(); };
Inherited Members¶
public: // typedefs using Scalar = typename Eigen::internal::traits<TDerived>::Scalar ; using ComplexT = typename Eigen::internal::traits<TDerived>::ComplexType ; using ComplexTemporaryType = Eigen::Matrix<Scalar, 2, 1, kOptions> ; using Transformation = Eigen::Matrix<Scalar, kMatrixDim, kMatrixDim> ; using Point = Eigen::Vector2<Scalar> ; using HomogeneousPoint = Eigen::Vector3<Scalar> ; using Line = Eigen::ParametrizedLine<Scalar, 2> ; using Hyperplane = Eigen::Hyperplane<Scalar, 2> ; using Tangent = Scalar ; using Adjoint = Scalar ; using ReturnScalar = typename Eigen::ScalarBinaryOpTraits<Scalar, typename TOtherDerived::Scalar>::ReturnType ; using So2Product = So2<ReturnScalar<TOtherDerived>> ; using PointProduct = Eigen::Vector2<ReturnScalar<TPointDerived>> ; using HomogeneousPointProduct = Eigen::Vector3<ReturnScalar<THPointDerived>> ; // fields static constexpr int kOptions = Eigen::internal::traits<TDerived>::kOptions; static constexpr int kDoF = 1; static constexpr int kNumParameters = 2; static constexpr int kMatrixDim = 2; static constexpr int kPointDim = 2; // methods SOPHUS_FUNC Adjoint adj() const; template <class TNewScalarType> SOPHUS_FUNC So2<TNewScalarType> cast() const; SOPHUS_FUNC Scalar* data(); SOPHUS_FUNC Scalar const* data() const; SOPHUS_FUNC So2<Scalar> inverse() const; SOPHUS_FUNC Scalar log() const; SOPHUS_FUNC void normalize(); SOPHUS_FUNC Transformation matrix() const; template <class TOtherDerived> SOPHUS_FUNC So2Base<TDerived>& operator=(So2Base<TOtherDerived> const& other); template <class TOtherDerived> SOPHUS_FUNC So2Product<TOtherDerived> operator*(So2Base<TOtherDerived> const& other) const; template < typename TPointDerived, typename = typename std::enable_if<IsFixedSizeVector<TPointDerived, 2>::value>::type > SOPHUS_FUNC PointProduct<TPointDerived> operator*(Eigen::MatrixBase<TPointDerived> const& p) const; template < typename THPointDerived, typename = typename std::enable_if<IsFixedSizeVector<THPointDerived, 3>::value>::type > SOPHUS_FUNC HomogeneousPointProduct<THPointDerived> operator*(Eigen::MatrixBase<THPointDerived> const& p) const; SOPHUS_FUNC Line operator*(Line const& l) const; SOPHUS_FUNC Hyperplane operator*(Hyperplane const& p) const; template < typename TOtherDerived, typename = typename std::enable_if<std::is_same<Scalar, ReturnScalar<TOtherDerived>>::value>::type > SOPHUS_FUNC So2Base<TDerived> operator*=(So2Base<TOtherDerived> const& other); SOPHUS_FUNC Eigen::Matrix<Scalar, kNumParameters, kDoF> dxThisMulExpXAt0() const; SOPHUS_FUNC Eigen::Vector<Scalar, kNumParameters> params() const; SOPHUS_FUNC Eigen::Matrix<Scalar, kDoF, kNumParameters> dxLogThisInvTimesXAtThis() const; SOPHUS_FUNC void setComplex(Point const& complex); SOPHUS_FUNC ComplexT const& unitComplex() const;
Detailed Documentation¶
Specialization of Eigen::Map for So2
; derived from So2Base.
Allows us to wrap So2 objects around POD array (e.g. external c style complex number / tuple).
Methods¶
SOPHUS_FUNC Map<Eigen::Vector2<Scalar>, kOptions> const& unitComplex() const
Accessor of unit complex number.
template <class TOtherDerived> SOPHUS_FUNC So2Base<TDerived>& operator=(So2Base<TOtherDerived> const& other)
Assignment-like operator from OtherDerived.
template < typename TOtherDerived, typename = typename std::enable_if<std::is_same<Scalar, ReturnScalar<TOtherDerived>>::value>::type > SOPHUS_FUNC So2Base<TDerived> operator*=(So2Base<TOtherDerived> const& other)
In-place group multiplication. This method is only valid if the return type of the multiplication is compatible with this So2’s Scalar type.
template <class TOtherDerived> SOPHUS_FUNC So2Product<TOtherDerived> operator*(So2Base<TOtherDerived> const& other)
Group multiplication, which is rotation concatenation.
template < typename TPointDerived, typename = typename std::enable_if<IsFixedSizeVector<TPointDerived, 2>::value>::type > SOPHUS_FUNC PointProduct<TPointDerived> operator*(Eigen::MatrixBase<TPointDerived> const& p)
Group action on 2-points.
This function rotates a 2 dimensional point p
by the So2 element bar_R_foo
(= rotation matrix): p_bar = bar_R_foo * p_foo
.
template < typename THPointDerived, typename = typename std::enable_if<IsFixedSizeVector<THPointDerived, 3>::value>::type > SOPHUS_FUNC HomogeneousPointProduct<THPointDerived> operator*(Eigen::MatrixBase<THPointDerived> const& p)
Group action on homogeneous 2-points.
This function rotates a homogeneous 2 dimensional point p
by the So2 element bar_R_foo
(= rotation matrix): p_bar = bar_R_foo * p_foo
.
SOPHUS_FUNC Line operator*(Line const& l)
Group action on lines.
This function rotates a parametrized line l(t) = o + t * d
by the So2 element:
Both direction d
and origin o
are rotated as a 2 dimensional point
SOPHUS_FUNC Hyperplane operator*(Hyperplane const& p)
Group action on hyper-planes.
This function rotates a hyper-plane n.x + d = 0
by the So2 element:
Normal vector n
is rotated Offset d
is left unchanged
Note that in 2d-case hyper-planes are just another parametrization of lines
SOPHUS_FUNC Map<Eigen::Vector2<Scalar>, kOptions>& mutUnitComplex()
Mutator of unit_complex is protected to ensure class invariant.