Main MRPT website > C++ reference for MRPT 1.4.0
List of all members | Public Types | Public Member Functions | Protected Attributes
mrpt::obs::CActionCollection Class Reference

Detailed Description

Declares a class for storing a collection of robot actions.

It is used in mrpt::obs::CRawlog, for logs storage and particle filter based simulations.

See also
CAction, CRawlog

Definition at line 30 of file obs/CActionCollection.h.

#include <mrpt/obs/CActionCollection.h>

Inheritance diagram for mrpt::obs::CActionCollection:
Inheritance graph

Public Types

typedef std::deque< CActionPtr >::iterator iterator
 You can use CActionCollection::begin to get a iterator to the first element.
 
typedef std::deque< CActionPtr >::const_iterator const_iterator
 You can use CActionCollection::begin to get a iterator to the first element.
 

Public Member Functions

 CActionCollection ()
 Constructor.
 
 CActionCollection (CAction &a)
 Constructor from a single action.
 
 CActionCollection (const CActionCollection &o)
 Copy Constructor.
 
CActionCollectionoperator= (const CActionCollection &o)
 Copy operator.
 
virtual ~CActionCollection ()
 Destructor.
 
const_iterator begin () const
 Returns a iterator to the first action: this is an example of usage:
 
iterator begin ()
 Returns a iterator to the first action: this is an example of usage:
 
const_iterator end () const
 Returns a iterator pointing to the end of the list: this is an example of usage:
 
iterator end ()
 Returns a iterator pointing to the end of the list: this is an example of usage:
 
iterator erase (const iterator &it)
 Removes the given action in the list, and return an iterator to the next element (or this->end() if it was the last one).
 
void clear ()
 Erase all actions from the list.
 
CActionPtr get (size_t index)
 Access the i'th action.DO NOT MODIFY the returned object, make a copy of ir with "CSerializable::duplicate" if desired.
 
template<typename T >
T::SmartPtr getActionByClass (const size_t &ith=0) const
 Access to the i'th action of a given class, or a NULL smart pointer if there is no action of that class in the list.
 
void insert (CAction &action)
 Add a new object to the list.
 
size_t size ()
 Returns the actions count in the collection.
 
CActionRobotMovement2DPtr getBestMovementEstimation () const
 Returns the best pose increment estimator in the collection, based on the determinant of its pose change covariance matrix.
 
CActionRobotMovement2DPtr getMovementEstimationByType (CActionRobotMovement2D::TEstimationMethod method)
 Returns the pose increment estimator in the collection having the specified type.
 
bool getFirstMovementEstimationMean (mrpt::poses::CPose3D &out_pose_increment) const
 Look for the first 2D or 3D "odometry" found in this collection of actions, and return the "mean" increment of the robot according to it.
 
bool getFirstMovementEstimation (mrpt::poses::CPose3DPDFGaussian &out_pose_increment) const
 Look for the first 2D or 3D "odometry" found in this collection of actions, and return the "mean" increment of the robot and its covariance according to it.
 
void eraseByIndex (const size_t &index)
 Remove an action from the list by its index.
 

Protected Member Functions

CSerializable virtual methods
void writeToStream (mrpt::utils::CStream &out, int *getVersion) const MRPT_OVERRIDE
 
void readFromStream (mrpt::utils::CStream &in, int version) MRPT_OVERRIDE
 

Protected Attributes

std::deque< CActionPtrm_actions
 The actions:
 

RTTI stuff <br>

typedef CActionCollectionPtr SmartPtr
 
static mrpt::utils::CLASSINIT _init_CActionCollection
 
static mrpt::utils::TRuntimeClassId classCActionCollection
 
static const mrpt::utils::TRuntimeClassIdclassinfo
 
static const mrpt::utils::TRuntimeClassId_GetBaseClass ()
 
virtual const mrpt::utils::TRuntimeClassIdGetRuntimeClass () const MRPT_OVERRIDE
 
virtual mrpt::utils::CObjectduplicate () const MRPT_OVERRIDE
 
static mrpt::utils::CObjectCreateObject ()
 
static CActionCollectionPtr Create ()
 

Member Typedef Documentation

◆ const_iterator

You can use CActionCollection::begin to get a iterator to the first element.

Definition at line 67 of file obs/CActionCollection.h.

◆ iterator

You can use CActionCollection::begin to get a iterator to the first element.

Definition at line 63 of file obs/CActionCollection.h.

◆ SmartPtr

A typedef for the associated smart pointer

Definition at line 33 of file obs/CActionCollection.h.

Constructor & Destructor Documentation

◆ CActionCollection() [1/3]

mrpt::obs::CActionCollection::CActionCollection ( )

Constructor.

◆ CActionCollection() [2/3]

mrpt::obs::CActionCollection::CActionCollection ( CAction a)

Constructor from a single action.

◆ CActionCollection() [3/3]

mrpt::obs::CActionCollection::CActionCollection ( const CActionCollection o)

Copy Constructor.

◆ ~CActionCollection()

virtual mrpt::obs::CActionCollection::~CActionCollection ( )
virtual

Destructor.

Member Function Documentation

◆ _GetBaseClass()

static const mrpt::utils::TRuntimeClassId * mrpt::obs::CActionCollection::_GetBaseClass ( )
staticprotected

◆ begin() [1/2]

iterator mrpt::obs::CActionCollection::begin ( )
inline

Returns a iterator to the first action: this is an example of usage:

...
for (CActionCollection::iterator it=acts.begin();it!=acts.end();++it)
{
(*it)->... // (*it) is a "CActionPtr"
}
Declares a class for storing a collection of robot actions.
const_iterator end() const
Returns a iterator pointing to the end of the list: this is an example of usage:
const_iterator begin() const
Returns a iterator to the first action: this is an example of usage:
std::deque< CActionPtr >::iterator iterator
You can use CActionCollection::begin to get a iterator to the first element.

Definition at line 93 of file obs/CActionCollection.h.

◆ begin() [2/2]

const_iterator mrpt::obs::CActionCollection::begin ( ) const
inline

Returns a iterator to the first action: this is an example of usage:

...
for (CActionCollection::iterator it=acts.begin();it!=acts.end();++it)
{
(*it)->... // (*it) is a "CActionPtr"
}

Definition at line 80 of file obs/CActionCollection.h.

◆ clear()

void mrpt::obs::CActionCollection::clear ( )

Erase all actions from the list.

◆ Create()

static CActionCollectionPtr mrpt::obs::CActionCollection::Create ( )
static

◆ CreateObject()

static mrpt::utils::CObject * mrpt::obs::CActionCollection::CreateObject ( )
static

◆ duplicate()

virtual mrpt::utils::CObject * mrpt::obs::CActionCollection::duplicate ( ) const
virtual

◆ end() [1/2]

iterator mrpt::obs::CActionCollection::end ( )
inline

Returns a iterator pointing to the end of the list: this is an example of usage:

...
for (CActionCollection::iterator it=acts.begin();it!=acts.end();++it)
{
(*it)->... // (*it) is a "CActionPtr"
}

Definition at line 119 of file obs/CActionCollection.h.

◆ end() [2/2]

const_iterator mrpt::obs::CActionCollection::end ( ) const
inline

Returns a iterator pointing to the end of the list: this is an example of usage:

...
for (CActionCollection::iterator it=acts.begin();it!=acts.end();++it)
{
(*it)->... // (*it) is a "CActionPtr"
}

Definition at line 106 of file obs/CActionCollection.h.

◆ erase()

iterator mrpt::obs::CActionCollection::erase ( const iterator it)

Removes the given action in the list, and return an iterator to the next element (or this->end() if it was the last one).

◆ eraseByIndex()

void mrpt::obs::CActionCollection::eraseByIndex ( const size_t &  index)

Remove an action from the list by its index.

Exceptions
std::exceptionOn index out of bounds.

◆ get()

CActionPtr mrpt::obs::CActionCollection::get ( size_t  index)

Access the i'th action.DO NOT MODIFY the returned object, make a copy of ir with "CSerializable::duplicate" if desired.

First element is 0.

Exceptions
std::exceptionOn index out of bounds.

◆ getActionByClass()

template<typename T >
T::SmartPtr mrpt::obs::CActionCollection::getActionByClass ( const size_t &  ith = 0) const
inline

Access to the i'th action of a given class, or a NULL smart pointer if there is no action of that class in the list.

Example:

CActionRobotMovement2DPtr obs = acts->getActionByClass<CActionRobotMovement2D>();
Represents a probabilistic 2D movement of the robot mobile base.
struct OBS_IMPEXP CActionRobotMovement2DPtr

By default (ith=0), the first one is returned.

Definition at line 144 of file obs/CActionCollection.h.

References begin(), end(), MRPT_END, and MRPT_START.

Referenced by mrpt::slam::PF_implementation< PARTICLE_TYPE, MYSELF >::PF_SLAM_implementation_pfStandardProposal().

◆ getBestMovementEstimation()

CActionRobotMovement2DPtr mrpt::obs::CActionCollection::getBestMovementEstimation ( ) const

Returns the best pose increment estimator in the collection, based on the determinant of its pose change covariance matrix.

Returns
The estimation, or NULL if none is available.

Referenced by mrpt::slam::PF_implementation< PARTICLE_TYPE, MYSELF >::PF_SLAM_implementation_gatherActionsCheckBothActObs(), and mrpt::slam::PF_implementation< PARTICLE_TYPE, MYSELF >::PF_SLAM_implementation_pfStandardProposal().

◆ getFirstMovementEstimation()

bool mrpt::obs::CActionCollection::getFirstMovementEstimation ( mrpt::poses::CPose3DPDFGaussian out_pose_increment) const

Look for the first 2D or 3D "odometry" found in this collection of actions, and return the "mean" increment of the robot and its covariance according to it.

Returns
true on success,false on no odometry found.

◆ getFirstMovementEstimationMean()

bool mrpt::obs::CActionCollection::getFirstMovementEstimationMean ( mrpt::poses::CPose3D out_pose_increment) const

Look for the first 2D or 3D "odometry" found in this collection of actions, and return the "mean" increment of the robot according to it.

Returns
true on success,false on no odometry found.

◆ getMovementEstimationByType()

CActionRobotMovement2DPtr mrpt::obs::CActionCollection::getMovementEstimationByType ( CActionRobotMovement2D::TEstimationMethod  method)

Returns the pose increment estimator in the collection having the specified type.

Returns
The estimation, or NULL if none is available.

◆ GetRuntimeClass()

virtual const mrpt::utils::TRuntimeClassId * mrpt::obs::CActionCollection::GetRuntimeClass ( ) const
virtual

◆ insert()

void mrpt::obs::CActionCollection::insert ( CAction action)

Add a new object to the list.

◆ operator=()

CActionCollection & mrpt::obs::CActionCollection::operator= ( const CActionCollection o)

Copy operator.

◆ readFromStream()

void mrpt::obs::CActionCollection::readFromStream ( mrpt::utils::CStream in,
int  version 
)
protected

◆ size()

size_t mrpt::obs::CActionCollection::size ( )

Returns the actions count in the collection.

◆ writeToStream()

void mrpt::obs::CActionCollection::writeToStream ( mrpt::utils::CStream out,
int *  getVersion 
) const
protected

Member Data Documentation

◆ _init_CActionCollection

mrpt::utils::CLASSINIT mrpt::obs::CActionCollection::_init_CActionCollection
staticprotected

Definition at line 33 of file obs/CActionCollection.h.

◆ classCActionCollection

mrpt::utils::TRuntimeClassId mrpt::obs::CActionCollection::classCActionCollection
static

Definition at line 33 of file obs/CActionCollection.h.

◆ classinfo

const mrpt::utils::TRuntimeClassId* mrpt::obs::CActionCollection::classinfo
static

Definition at line 33 of file obs/CActionCollection.h.

◆ m_actions

std::deque<CActionPtr> mrpt::obs::CActionCollection::m_actions
protected

The actions:

Definition at line 38 of file obs/CActionCollection.h.




Page generated by Doxygen 1.9.7 for MRPT 1.4.0 SVN: at Tue Jun 13 14:27:49 UTC 2023