struct mrpt::math::TPose3DQuat

Overview

Lightweight 3D pose (three spatial coordinates, plus a quaternion ).

Allows coordinate access using [] operator.

See also:

mrpt::poses::CPose3DQuat

#include <mrpt/math/TPose3DQuat.h>

struct TPose3DQuat:
    public mrpt::math::TPoseOrPoint,
    public mrpt::math::internal::ProvideStaticResize
{
    // enums

    enum
    {
        static_size = 7,
    };

    // fields

    double x {.0};
    double y {.0};
    double z {.0};
    double qr {1.};
    double qx {.0};
    double qy {.0};
    double qz {.0};

    // construction

    TPose3DQuat(
        double _x,
        double _y,
        double _z,
        double _qr,
        double _qx,
        double _qy,
        double _qz
        );

    TPose3DQuat();

    // methods

    double& operator [] (size_t i);
    constexpr double operator [] (size_t i) const;
    double norm() const;
    void asVector(std::vector<double>& v) const;
    void asString(std::string& s) const;
    std::string asString() const;
    void fromString(const std::string& s);
    static TPose3DQuat FromString(const std::string& s);
};

Inherited Members

public:
    // methods

    void resize(std::size_t n);

Fields

double x {.0}

Translation in x,y,z.

double qr {1.}

Unit quaternion part, qr,qx,qy,qz.

Construction

TPose3DQuat(
    double _x,
    double _y,
    double _z,
    double _qr,
    double _qx,
    double _qy,
    double _qz
    )

Constructor from coordinates.

TPose3DQuat()

Default fast constructor.

Initializes to identity transformation.

Methods

double& operator [] (size_t i)

Coordinate access using operator[].

Order: x,y,z,qr,qx,qy,qz

constexpr double operator [] (size_t i) const

Coordinate access using operator[].

Order: x,y,z,qr,qx,qy,qz

double norm() const

Pose’s spatial coordinates (x,y,z) norm.

void asVector(std::vector<double>& v) const

Gets the pose as a vector of doubles.

void asString(std::string& s) const

Returns a human-readable textual representation of the object as “[x y z qr qx qy qz]”.

See also:

fromString

void fromString(const std::string& s)

Set the current object value from a string generated by ‘asString’ (eg: “[0.02 1.04 -0.8 1.0 0.0 0.0 0.0]” )

Parameters:

std::exception

On invalid format

See also:

asString