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.
Definition at line 31 of file obs/CActionCollection.h.
#include <mrpt/obs/CActionCollection.h>
Public Types | |
typedef std::deque< mrpt::utils::poly_ptr_ptr< CActionPtr > >::iterator | iterator |
You can use CActionCollection::begin to get a iterator to the first element. More... | |
typedef std::deque< mrpt::utils::poly_ptr_ptr< CActionPtr > >::const_iterator | const_iterator |
You can use CActionCollection::begin to get a iterator to the first element. More... | |
Public Member Functions | |
void * | operator new (size_t size) |
void * | operator new[] (size_t size) |
void | operator delete (void *ptr) throw () |
void | operator delete[] (void *ptr) throw () |
void | operator delete (void *memory, void *ptr) throw () |
void * | operator new (size_t size, const std::nothrow_t &) throw () |
void | operator delete (void *ptr, const std::nothrow_t &) throw () |
CActionCollection () | |
ctor More... | |
CActionCollection (CAction &a) | |
Constructor from a single action. More... | |
const_iterator | begin () const |
Returns a iterator to the first action: this is an example of usage: More... | |
iterator | begin () |
Returns a iterator to the first action: this is an example of usage: More... | |
const_iterator | end () const |
Returns a iterator pointing to the end of the list: this is an example of usage: More... | |
iterator | end () |
Returns a iterator pointing to the end of the list: this is an example of usage: More... | |
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). More... | |
void | clear () |
Erase all actions from the list. More... | |
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. More... | |
const CAction & | get (size_t index) const |
template<typename T > | |
T::Ptr | 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. More... | |
void | insert (CAction &action) |
Add a new object to the list. More... | |
size_t | size () |
Returns the actions count in the collection. More... | |
CActionRobotMovement2DPtr | getBestMovementEstimation () const |
Returns the best pose increment estimator in the collection, based on the determinant of its pose change covariance matrix. More... | |
CActionRobotMovement2DPtr | getMovementEstimationByType (CActionRobotMovement2D::TEstimationMethod method) |
Returns the pose increment estimator in the collection having the specified type. More... | |
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. More... | |
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. More... | |
void | eraseByIndex (const size_t &index) |
Remove an action from the list by its index. More... | |
virtual mxArray * | writeToMatlab () const |
Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class. More... | |
CObject * | clone () const |
Cloning interface for smart pointers. More... | |
RTTI classes and functions | |
mrpt::utils::CObjectPtr | duplicateGetSmartPtr () const |
Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer). More... | |
Static Public Member Functions | |
static void * | operator new (size_t size, void *ptr) |
Static Public Attributes | |
static const mrpt::utils::TRuntimeClassId | classCObject |
RTTI stuff | |
static const mrpt::utils::TRuntimeClassId | classCSerializable |
Protected Member Functions | |
CSerializable virtual methods | |
void | writeToStream (mrpt::utils::CStream &out, int *getVersion) const |
Introduces a pure virtual method responsible for writing to a CStream. More... | |
void | readFromStream (mrpt::utils::CStream &in, int version) |
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori. More... | |
Protected Attributes | |
std::deque< mrpt::utils::poly_ptr_ptr< CActionPtr > > | m_actions |
The robot "actionss". More... | |
RTTI stuff | |
typedef CActionCollectionPtr | Ptr |
typedef CActionCollectionPtr | ConstPtr |
static mrpt::utils::CLASSINIT | _init_CActionCollection |
static mrpt::utils::TRuntimeClassId | classCActionCollection |
static const mrpt::utils::TRuntimeClassId * | classinfo |
static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const |
Returns information about the class of an object in runtime. More... | |
virtual mrpt::utils::CObject * | duplicate () const |
Returns a copy of the object, indepently of its class. More... | |
static mrpt::utils::CObject * | CreateObject () |
static CActionCollectionPtr | Create () |
typedef std::deque<mrpt::utils::poly_ptr_ptr<CActionPtr> >::const_iterator mrpt::obs::CActionCollection::const_iterator |
You can use CActionCollection::begin to get a iterator to the first element.
Definition at line 49 of file obs/CActionCollection.h.
typedef CActionCollectionPtr mrpt::obs::CActionCollection::ConstPtr |
Definition at line 34 of file obs/CActionCollection.h.
typedef std::deque<mrpt::utils::poly_ptr_ptr<CActionPtr> >::iterator mrpt::obs::CActionCollection::iterator |
You can use CActionCollection::begin to get a iterator to the first element.
Definition at line 45 of file obs/CActionCollection.h.
typedef CActionCollectionPtr mrpt::obs::CActionCollection::Ptr |
A typedef for the associated smart pointer
Definition at line 34 of file obs/CActionCollection.h.
CActionCollection::CActionCollection | ( | ) |
ctor
Definition at line 32 of file CActionCollection.cpp.
CActionCollection::CActionCollection | ( | CAction & | a | ) |
Constructor from a single action.
Definition at line 39 of file CActionCollection.cpp.
References m_actions.
|
staticprotected |
|
inline |
Returns a iterator to the first action: this is an example of usage:
Definition at line 62 of file obs/CActionCollection.h.
Referenced by getBestMovementEstimation(), getMovementEstimationByType(), readFromStream(), and writeToStream().
|
inline |
Returns a iterator to the first action: this is an example of usage:
Definition at line 75 of file obs/CActionCollection.h.
void CActionCollection::clear | ( | ) |
Erase all actions from the list.
Definition at line 88 of file CActionCollection.cpp.
References m_actions.
Referenced by readFromStream().
|
inlineinherited |
|
static |
Referenced by mrpt::obs::CRawlog::addAction().
|
static |
|
virtual |
Returns a copy of the object, indepently of its class.
Implements mrpt::utils::CObject.
|
inlineinherited |
Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).
Definition at line 162 of file CObject.h.
References mrpt::utils::CObjectPtr.
Referenced by mrpt::obs::CRawlog::addActions(), mrpt::slam::CIncrementalMapPartitioner::addMapFrame(), and mrpt::obs::CRawlog::addObservations().
|
inline |
Returns a iterator pointing to the end of the list: this is an example of usage:
Definition at line 88 of file obs/CActionCollection.h.
Referenced by erase(), getBestMovementEstimation(), getMovementEstimationByType(), readFromStream(), and writeToStream().
|
inline |
Returns a iterator pointing to the end of the list: this is an example of usage:
Definition at line 101 of file obs/CActionCollection.h.
CActionCollection::iterator 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).
Definition at line 205 of file CActionCollection.cpp.
References ASSERT_, end(), m_actions, MRPT_END, and MRPT_START.
void CActionCollection::eraseByIndex | ( | const size_t & | index | ) |
Remove an action from the list by its index.
std::exception | On index out of bounds. |
Definition at line 168 of file CActionCollection.cpp.
References m_actions, and THROW_EXCEPTION.
CActionPtr 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.
std::exception | On index out of bounds. |
Definition at line 96 of file CActionCollection.cpp.
References m_actions, and THROW_EXCEPTION.
const CAction & CActionCollection::get | ( | size_t | index | ) | const |
Definition at line 104 of file CActionCollection.cpp.
References m_actions, and THROW_EXCEPTION.
|
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:
By default (ith=0), the first one is returned.
Definition at line 127 of file obs/CActionCollection.h.
References begin(), MRPT_END, and MRPT_START.
Referenced by mrpt::slam::PF_implementation< mrpt::poses::CPose3D, CMonteCarloLocalization3D >::PF_SLAM_implementation_gatherActionsCheckBothActObs(), mrpt::slam::PF_implementation< mrpt::poses::CPose3D, CMonteCarloLocalization3D >::PF_SLAM_implementation_pfStandardProposal(), mrpt::maps::CMultiMetricMapPDF::prediction_and_update_pfOptimalProposal(), and mrpt::slam::CMetricMapBuilderRBPF::processActionObservation().
CActionRobotMovement2DPtr CActionCollection::getBestMovementEstimation | ( | ) | const |
Returns the best pose increment estimator in the collection, based on the determinant of its pose change covariance matrix.
Definition at line 133 of file CActionCollection.cpp.
References begin(), CLASS_ID, det(), mrpt::obs::CActionRobotMovement2D::emScan2DMatching, and end().
Referenced by mrpt::slam::PF_implementation< mrpt::poses::CPose3D, CMonteCarloLocalization3D >::PF_SLAM_implementation_gatherActionsCheckBothActObs(), mrpt::slam::PF_implementation< mrpt::poses::CPose3D, CMonteCarloLocalization3D >::PF_SLAM_implementation_pfStandardProposal(), mrpt::hmtslam::CLSLAM_RBPF_2DLASER::prediction_and_update_pfAuxiliaryPFOptimal(), mrpt::maps::CMultiMetricMapPDF::prediction_and_update_pfOptimalProposal(), mrpt::hmtslam::CLSLAM_RBPF_2DLASER::prediction_and_update_pfOptimalProposal(), and mrpt::slam::CMetricMapBuilderICP::processActionObservation().
bool 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.
Definition at line 238 of file CActionCollection.cpp.
References mrpt::poses::CPose3DPDFGaussian::copyFrom().
bool 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.
Definition at line 218 of file CActionCollection.cpp.
CActionRobotMovement2DPtr CActionCollection::getMovementEstimationByType | ( | CActionRobotMovement2D::TEstimationMethod | method | ) |
Returns the pose increment estimator in the collection having the specified type.
Definition at line 180 of file CActionCollection.cpp.
|
virtual |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::utils::CSerializable.
Add a new object to the list.
Definition at line 124 of file CActionCollection.cpp.
References mrpt::utils::CObject::duplicate(), and m_actions.
Referenced by mrpt::slam::CMetricMapBuilderRBPF::processActionObservation().
Definition at line 34 of file obs/CActionCollection.h.
Definition at line 34 of file obs/CActionCollection.h.
|
inline |
Definition at line 34 of file obs/CActionCollection.h.
Definition at line 34 of file obs/CActionCollection.h.
|
inline |
Definition at line 34 of file obs/CActionCollection.h.
Definition at line 34 of file obs/CActionCollection.h.
|
inline |
Definition at line 34 of file obs/CActionCollection.h.
|
inline |
Definition at line 34 of file obs/CActionCollection.h.
|
protectedvirtual |
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori.
in | The input binary stream where the object data must read from. |
version | The version of the object stored in the stream: use this version number in your code to know how to read the incoming data. |
std::exception | On any error, see CStream::ReadBuffer |
Implements mrpt::utils::CSerializable.
Definition at line 65 of file CActionCollection.cpp.
References begin(), clear(), end(), m_actions, MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION, and version.
size_t CActionCollection::size | ( | ) |
Returns the actions count in the collection.
Definition at line 116 of file CActionCollection.cpp.
References m_actions.
|
inlinevirtualinherited |
Introduces a pure virtual method responsible for writing to a mxArray
Matlab object, typically a MATLAB struct
whose contents are documented in each derived class.
mxArray
(caller is responsible of memory freeing) or NULL is class does not support conversion to MATLAB. Definition at line 79 of file CSerializable.h.
|
protectedvirtual |
Introduces a pure virtual method responsible for writing to a CStream.
This can not be used directly be users, instead use "stream << object;" for writing it to a stream.
out | The output binary stream where object must be dumped. |
getVersion | If NULL, the object must be dumped. If not, only the version of the object dump must be returned in this pointer. This enables the versioning of objects dumping and backward compatibility with previously stored data. |
std::exception | On any error, see CStream::WriteBuffer |
Implements mrpt::utils::CSerializable.
Definition at line 47 of file CActionCollection.cpp.
|
staticprotected |
Definition at line 34 of file obs/CActionCollection.h.
|
static |
Definition at line 34 of file obs/CActionCollection.h.
|
staticinherited |
|
staticinherited |
Definition at line 42 of file CSerializable.h.
|
static |
Definition at line 34 of file obs/CActionCollection.h.
|
protected |
The robot "actionss".
Definition at line 37 of file obs/CActionCollection.h.
Referenced by CActionCollection(), clear(), erase(), eraseByIndex(), get(), insert(), readFromStream(), size(), and writeToStream().
Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020 |