template class Eigen::Map<sophus::Sim2<TScalar>, kOptions>

Overview

Specialization of Eigen::Map for Sim2; derived from Sim2Base. More…

#include <sim2.h>

template <class TScalar, int kOptions>
class Map<sophus::Sim2<TScalar>, kOptions>: public sophus::Sim2Base {
public:
    // typedefs

    using Base = sophus::Sim2Base<Map<sophus::Sim2<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<sophus::RxSo2<Scalar>, kOptions>& rxso2();
    SOPHUS_FUNC Map<sophus::RxSo2<Scalar>, kOptions> const& rxso2() const;
    SOPHUS_FUNC Map<Eigen::Vector2<Scalar>, kOptions>& translation();
    SOPHUS_FUNC Map<Eigen::Vector2<Scalar>, kOptions> const& translation() const;

protected:
    // fields

    Map<sophus::RxSo2<Scalar>, kOptions> rxso2_;
    Map<Eigen::Vector2<Scalar>, kOptions> translation_;
};

Inherited Members

public:
    // typedefs

    using Scalar = typename Eigen::internal::traits<TDerived>::Scalar ;
    using TranslationType = typename Eigen::internal::traits<TDerived>::TranslationType ;
    using RxSo2Type = typename Eigen::internal::traits<TDerived>::RxSo2Type ;
    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 = Eigen::Vector<Scalar, kDoF> ;
    using Adjoint = Eigen::Matrix<Scalar, kDoF, kDoF> ;
    using ReturnScalar = typename Eigen::ScalarBinaryOpTraits<Scalar, typename TOtherDerived::Scalar>::ReturnType ;
    using Sim2Product = Sim2<ReturnScalar<TOtherDerived>> ;
    using PointProduct = Eigen::Vector2<ReturnScalar<TPointDerived>> ;
    using HomogeneousPointProduct = Eigen::Vector3<ReturnScalar<THPointDerived>> ;

    // fields

    static constexpr int kDoF = 4;
    static constexpr int kNumParameters = 4;
    static constexpr int kMatrixDim = 3;
    static constexpr int kPointDim = 2;

    // methods

    SOPHUS_FUNC Adjoint adj() const;

    template <class TNewScalarType>
    SOPHUS_FUNC Sim2<TNewScalarType> cast() const;

    SOPHUS_FUNC Sim2<Scalar> inverse() const;
    SOPHUS_FUNC Tangent log() const;
    SOPHUS_FUNC Transformation matrix() const;
    SOPHUS_FUNC Eigen::Matrix<Scalar, 2, 3> matrix2x3() const;

    template <class TOtherDerived>
    SOPHUS_FUNC Sim2Base<TDerived>& operator=(Sim2Base<TOtherDerived> const& other);

    template <class TOtherDerived>
    SOPHUS_FUNC Sim2Product<TOtherDerived> operator*(Sim2Base<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;
    SOPHUS_FUNC Eigen::Vector<Scalar, kNumParameters> params() const;

    template <
        typename TOtherDerived,
        typename = typename std::enable_if<std::is_same<Scalar, ReturnScalar<TOtherDerived>>::value>::type
        >
    SOPHUS_FUNC Sim2Base<TDerived>& operator*=(Sim2Base<TOtherDerived> const& other);

    SOPHUS_FUNC Eigen::Matrix<Scalar, kNumParameters, kDoF> dxThisMulExpXAt0() const;
    SOPHUS_FUNC Eigen::Matrix<Scalar, kDoF, kNumParameters> dxLogThisInvTimesXAtThis() const;
    SOPHUS_FUNC void setComplex(Eigen::Vector2<Scalar> const& z);
    SOPHUS_FUNC Eigen::internal::traits<TDerived>::RxSo2Type::ComplexType const& complex() const;
    SOPHUS_FUNC Eigen::Matrix2<Scalar> rotationMatrix() const;
    SOPHUS_FUNC RxSo2Type& rxso2();
    SOPHUS_FUNC RxSo2Type const& rxso2() const;
    SOPHUS_FUNC Scalar scale() const;
    SOPHUS_FUNC void setRotationMatrix(Eigen::Matrix2<Scalar>& mat_r);
    SOPHUS_FUNC void setScale(Scalar const& scale);
    SOPHUS_FUNC void setScaledRotationMatrix(Eigen::Matrix2<Scalar> const& mat_scaled_rot);
    SOPHUS_FUNC TranslationType& translation();
    SOPHUS_FUNC TranslationType const& translation() const;

Detailed Documentation

Specialization of Eigen::Map for Sim2; derived from Sim2Base.

Allows us to wrap Sim2 objects around POD array.

Methods

SOPHUS_FUNC Map<sophus::RxSo2<Scalar>, kOptions>& rxso2()

Mutator of RxSo2.

SOPHUS_FUNC Map<sophus::RxSo2<Scalar>, kOptions> const& rxso2() const

Accessor of RxSo2.

SOPHUS_FUNC Map<Eigen::Vector2<Scalar>, kOptions>& translation()

Mutator of translation vector.

SOPHUS_FUNC Map<Eigen::Vector2<Scalar>, kOptions> const& translation() const

Accessor of translation vector.