template class mrpt::poses::SE_average<3>

Computes weighted and un-weighted averages of SE(3) poses.

Add values to average with append(), when done call get_average(). Use clear() to reset the accumulator and start a new average computation. Theoretical base: See SO_average<3> for the rotation part. The translation is a simple arithmetic mean in Euclidean space. Class introduced in MRPT 1.3.1

See also:

SE_traits

#include <mrpt/poses/SO_SE_average.h>

template <>
class SE_average<3>
{
public:
    //
fields

    bool enable_exception_on_undeterminate {false};

    //
methods

    void clear();
    void append(const mrpt::poses::CPose3D& p);
    void append(const mrpt::poses::CPose3D& p, const double weight);

    void append(
        const mrpt::math::TPose3D& p,
        const double weight
        );

    void get_average(mrpt::poses::CPose3D& out_mean) const;
};

Fields

bool enable_exception_on_undeterminate {false}

(Default=false) Set to true if you want to raise an exception on undetermined average values.

Methods

void clear()

Resets the accumulator.

void append(const mrpt::poses::CPose3D& p)

Adds a new pose to the computation.

See also:

get_average

void append(const mrpt::poses::CPose3D& p, const double weight)

Adds a new pose to the weighted-average computation.

See also:

get_average

void get_average(mrpt::poses::CPose3D& out_mean) const

Returns the average pose.

Parameters:

std::logic_error

If no data point were inserted.

std::runtime_error

Upon undeterminate average value (ie the average lays exactly on the origin point) and enable_exception_on_undeterminate is set to true (otherwise, the 0 orientation would be returned)

See also:

append