MRPT  1.9.9
mrpt::poses::SO_average< 2 > Class Template Reference

Detailed Description

template<>
class mrpt::poses::SO_average< 2 >

Computes weighted and un-weighted averages of SO(2) orientations.

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: Average on SO(2) manifolds is computed by averaging the corresponding 2D points, then projecting the result back to the closest-point in the manifold. Shortly explained in these slides

Note
Class introduced in MRPT 1.3.1
See also
SE_traits

Definition at line 42 of file SO_SE_average.h.

#include <mrpt/poses/SO_SE_average.h>

Public Member Functions

 SO_average ()
 Constructor. More...
 
void clear ()
 Resets the accumulator. More...
 
void append (const double orientation_rad)
 Adds a new orientation (radians) to the computation. More...
 
void append (const double orientation_rad, const double weight)
 Adds a new orientation (radians) to the weighted-average computation. More...
 
double get_average () const
 Returns the average orientation (radians). More...
 

Public Attributes

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

Private Attributes

double m_count
 
double m_accum_x
 
double m_accum_y
 

Constructor & Destructor Documentation

◆ SO_average()

Constructor.

Member Function Documentation

◆ append() [1/2]

void mrpt::poses::SO_average< 2 >::append ( const double  orientation_rad)

Adds a new orientation (radians) to the computation.

See also
get_average

Referenced by run_test_so2_avrg().

◆ append() [2/2]

void mrpt::poses::SO_average< 2 >::append ( const double  orientation_rad,
const double  weight 
)

Adds a new orientation (radians) to the weighted-average computation.

See also
get_average

◆ clear()

void mrpt::poses::SO_average< 2 >::clear ( )

Resets the accumulator.

◆ get_average()

double mrpt::poses::SO_average< 2 >::get_average ( ) const

Returns the average orientation (radians).

Exceptions
std::logic_errorIf no data point were inserted.
std::runtime_errorUpon 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

Referenced by run_test_so2_avrg().

Member Data Documentation

◆ enable_exception_on_undeterminate

bool mrpt::poses::SO_average< 2 >::enable_exception_on_undeterminate

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

Definition at line 64 of file SO_SE_average.h.

◆ m_accum_x

double mrpt::poses::SO_average< 2 >::m_accum_x
private

Definition at line 68 of file SO_SE_average.h.

◆ m_accum_y

double mrpt::poses::SO_average< 2 >::m_accum_y
private

Definition at line 68 of file SO_SE_average.h.

◆ m_count

double mrpt::poses::SO_average< 2 >::m_count
private

Definition at line 67 of file SO_SE_average.h.




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020