template class mrpt::poses::SE_average<2>
Overview
Computes weighted and un-weighted averages of SE(2) 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<2> 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<2> { public: // fields bool enable_exception_on_undeterminate {false}; // construction SE_average(); // methods void clear(); void append(const mrpt::poses::CPose2D& p); void append(const mrpt::poses::CPose2D& p, const double weight); void append( const mrpt::math::TPose2D& p, const double weight ); void get_average(mrpt::poses::CPose2D& 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.
Construction
SE_average()
Constructor.
Methods
void clear()
Resets the accumulator.
void append(const mrpt::poses::CPose2D& p)
Adds a new pose to the computation.
See also:
void append(const mrpt::poses::CPose2D& p, const double weight)
Adds a new pose to the weighted-average computation.
See also:
void get_average(mrpt::poses::CPose2D& 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: