Template Class Sample

Inheritance Relationships

Base Type

  • public T

Class Documentation

template<class T>
class Sample : public T

Class to describe a particle used in the particle filter localization

Public Functions

inline Sample()

index (for debugging)

inline Sample(const Sample<T> &s)

copy constructor

Parameters:

s

inline Sample(const T &o, double weight = 0)

constructor

Parameters:
  • o

  • weight

inline void set(const T &o, double weight = 0)

set sample

Parameters:
  • p

  • weight

inline void set(const T &s)

set sample

Parameters:

s

inline void set(const SamplePtr<T> &s)

set sample

Parameters:

s

inline const T &get() const

get

Returns:

object

inline T &get()

get

Returns:

object

inline const unsigned int &idx() const
Returns:

idx

inline unsigned int &idx()
Returns:

idx

inline const double &weight() const
Returns:

weight

inline double &weight()
Returns:

weight

Public Static Functions

static inline bool greater(const SamplePtr<T> &a, const SamplePtr<T> &b)
static inline bool smaller(const SamplePtr<T> &a, const SamplePtr<T> &b)

Friends

inline friend std::ostream &operator<<(std::ostream &os, const Sample<T> &o)

Stream extraction

Parameters:
  • os – outputstream

  • o – object

Returns:

stream