template class Eigen::Map<sophus::Sim3<TScalar> const, kOptions>

Overview

Specialization of Eigen::Map for Sim3 const; derived from Sim3Base. More…

#include <sim3.h>

template <class TScalar, int kOptions>
class Map<sophus::Sim3<TScalar> const, kOptions>: public sophus::Sim3Base {
public:
    // typedefs

    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 const* coeffs);

    // methods

    SOPHUS_FUNC Map<sophus::RxSo3<Scalar> const, kOptions> const& rxso3() const;
    SOPHUS_FUNC Map<Eigen::Vector3<Scalar> const, kOptions> const& translation() const;

protected:
    // fields

    Map<sophus::RxSo3<Scalar> const, kOptions> rxso3_;
    Map<Eigen::Vector3<Scalar> const, kOptions> translation_;
};

Inherited Members

public:
    // typedefs

    using Scalar = typename Eigen::internal::traits<TDerived>::Scalar ;
    using TranslationType = typename Eigen::internal::traits<TDerived>::TranslationType ;
    using RxSo3Type = typename Eigen::internal::traits<TDerived>::RxSo3Type ;
    using QuaternionType = typename RxSo3Type::QuaternionType ;
    using Transformation = Eigen::Matrix<Scalar, kMatrixDim, kMatrixDim> ;
    using Point = Eigen::Vector3<Scalar> ;
    using HomogeneousPoint = Eigen::Vector4<Scalar> ;
    using Line = Eigen::ParametrizedLine<Scalar, 3> ;
    using Hyperplane = Eigen::Hyperplane<Scalar, 3> ;
    using Tangent = Eigen::Vector<Scalar, kDoF> ;
    using Adjoint = Eigen::Matrix<Scalar, kDoF, kDoF> ;
    using ReturnScalar = typename Eigen::ScalarBinaryOpTraits<Scalar, typename TOtherDerived::Scalar>::ReturnType ;
    using Sim3Product = Sim3<ReturnScalar<TOtherDerived>> ;
    using PointProduct = Eigen::Vector3<ReturnScalar<TPointDerived>> ;
    using HomogeneousPointProduct = Eigen::Vector4<ReturnScalar<THPointDerived>> ;

    // fields

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

    // methods

    SOPHUS_FUNC Adjoint adj() const;

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

    SOPHUS_FUNC Sim3<Scalar> inverse() const;
    SOPHUS_FUNC Tangent log() const;
    SOPHUS_FUNC Transformation matrix() const;
    SOPHUS_FUNC Eigen::Matrix<Scalar, 3, 4> matrix3x4() const;

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

    template <class TOtherDerived>
    SOPHUS_FUNC Sim3Product<TOtherDerived> operator*(Sim3Base<TOtherDerived> const& other) const;

    template <
        typename TPointDerived,
        typename = typename std::enable_if<IsFixedSizeVector<TPointDerived, 3>::value>::type
        >
    SOPHUS_FUNC PointProduct<TPointDerived> operator*(Eigen::MatrixBase<TPointDerived> const& p) const;

    template <
        typename THPointDerived,
        typename = typename std::enable_if<IsFixedSizeVector<THPointDerived, 4>::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 Sim3Base<TDerived>& operator*=(Sim3Base<TOtherDerived> const& other);

    SOPHUS_FUNC Eigen::Matrix<Scalar, kNumParameters, kDoF> dxThisMulExpXAt0() const;
    SOPHUS_FUNC Eigen::Matrix<Scalar, kDoF, kNumParameters> dxLogThisInvTimesXAtThis() const;
    SOPHUS_FUNC Eigen::Vector<Scalar, kNumParameters> params() const;
    SOPHUS_FUNC void setQuaternion(Eigen::Quaternion<Scalar> const& quat);
    SOPHUS_FUNC QuaternionType const& quaternion() const;
    SOPHUS_FUNC Eigen::Matrix3<Scalar> rotationMatrix() const;
    SOPHUS_FUNC RxSo3Type& rxso3();
    SOPHUS_FUNC RxSo3Type const& rxso3() const;
    SOPHUS_FUNC Scalar scale() const;
    SOPHUS_FUNC void setRotationMatrix(Eigen::Matrix3<Scalar>& r);
    SOPHUS_FUNC void setScale(Scalar const& scale);
    SOPHUS_FUNC void setScaledRotationMatrix(Eigen::Matrix3<Scalar> const& s_r);
    SOPHUS_FUNC TranslationType& translation();
    SOPHUS_FUNC TranslationType const& translation() const;

Detailed Documentation

Specialization of Eigen::Map for Sim3 const; derived from Sim3Base.

Allows us to wrap RxSo3 objects around POD array.

Methods

SOPHUS_FUNC Map<sophus::RxSo3<Scalar> const, kOptions> const& rxso3() const

Accessor of RxSo3.

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

Accessor of translation vector.