MRPT
1.9.9
|
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 26 of file CActionCollection.h.
#include <mrpt/obs/CActionCollection.h>
Public Types | |
using | iterator = std::deque< mrpt::containers::deepcopy_poly_ptr< CAction::Ptr > >::iterator |
You can use CActionCollection::begin to get a iterator to the first element. More... | |
using | const_iterator = std::deque< mrpt::containers::deepcopy_poly_ptr< CAction::Ptr > >::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) noexcept |
void | operator delete[] (void *ptr) noexcept |
void | operator delete (void *memory, void *ptr) noexcept |
void * | operator new (size_t size, const std::nothrow_t &) noexcept |
void | operator delete (void *ptr, const std::nothrow_t &) noexcept |
CActionCollection ()=default | |
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... | |
CAction::Ptr | 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 nullptr 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... | |
CActionRobotMovement2D::Ptr | getBestMovementEstimation () const |
Returns the best pose increment estimator in the collection, based on the determinant of its pose change covariance matrix. More... | |
CActionRobotMovement2D::Ptr | 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... | |
RTTI classes and functions for polymorphic hierarchies | |
mrpt::rtti::CObject::Ptr | 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) |
Protected Member Functions | |
CSerializable virtual methods | |
uint8_t | serializeGetVersion () const override |
Must return the current versioning number of the object. More... | |
void | serializeTo (mrpt::serialization::CArchive &out) const override |
Pure virtual method for writing (serializing) to an abstract archive. More... | |
void | serializeFrom (mrpt::serialization::CArchive &in, uint8_t serial_version) override |
Pure virtual method for reading (deserializing) from an abstract archive. More... | |
Protected Attributes | |
std::deque< mrpt::containers::deepcopy_poly_ptr< CAction::Ptr > > | m_actions |
The robot "actionss". More... | |
RTTI stuff | |
using | Ptr = std::shared_ptr< CActionCollection > |
using | ConstPtr = std::shared_ptr< const CActionCollection > |
using | UniquePtr = std::unique_ptr< CActionCollection > |
using | ConstUniquePtr = std::unique_ptr< const CActionCollection > |
static mrpt::rtti::CLASSINIT | _init_CActionCollection |
static const mrpt::rtti::TRuntimeClassId | runtimeClassId |
static constexpr const char * | className = "CActionCollection" |
static const mrpt::rtti::TRuntimeClassId * | _GetBaseClass () |
static constexpr auto | getClassName () |
static const mrpt::rtti::TRuntimeClassId & | GetRuntimeClassIdStatic () |
static mrpt::rtti::CObject * | CreateObject () |
template<typename... Args> | |
static Ptr | Create (Args &&... args) |
template<typename... Args> | |
static UniquePtr | CreateUnique (Args &&... args) |
virtual const mrpt::rtti::TRuntimeClassId * | GetRuntimeClass () const override |
Returns information about the class of an object in runtime. More... | |
virtual mrpt::rtti::CObject * | clone () const override |
Returns a deep copy (clone) of the object, indepently of its class. More... | |
using mrpt::obs::CActionCollection::const_iterator = std::deque< mrpt::containers::deepcopy_poly_ptr<CAction::Ptr> >::const_iterator |
You can use CActionCollection::begin to get a iterator to the first element.
Definition at line 50 of file CActionCollection.h.
using mrpt::obs::CActionCollection::ConstPtr = std::shared_ptr<const CActionCollection > |
Definition at line 28 of file CActionCollection.h.
using mrpt::obs::CActionCollection::ConstUniquePtr = std::unique_ptr<const CActionCollection > |
Definition at line 28 of file CActionCollection.h.
using mrpt::obs::CActionCollection::iterator = std::deque<mrpt::containers::deepcopy_poly_ptr<CAction::Ptr> >::iterator |
You can use CActionCollection::begin to get a iterator to the first element.
Definition at line 44 of file CActionCollection.h.
A type for the associated smart pointer
Definition at line 28 of file CActionCollection.h.
using mrpt::obs::CActionCollection::UniquePtr = std::unique_ptr< CActionCollection > |
Definition at line 28 of file CActionCollection.h.
|
default |
ctor
CActionCollection::CActionCollection | ( | CAction & | a | ) |
Constructor from a single action.
Definition at line 25 of file CActionCollection.cpp.
|
staticprotected |
|
inline |
Returns a iterator to the first action: this is an example of usage:
Definition at line 63 of file CActionCollection.h.
References m_actions.
Referenced by getActionByClass().
|
inline |
Returns a iterator to the first action: this is an example of usage:
Definition at line 75 of file CActionCollection.h.
References m_actions.
void CActionCollection::clear | ( | ) |
Erase all actions from the list.
Definition at line 60 of file CActionCollection.cpp.
|
overridevirtual |
Returns a deep copy (clone) of the object, indepently of its class.
Implements mrpt::rtti::CObject.
|
inlinestatic |
Definition at line 28 of file CActionCollection.h.
|
static |
|
inlinestatic |
Definition at line 28 of file CActionCollection.h.
|
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 168 of file CObject.h.
References mrpt::rtti::CObject::clone().
Referenced by mrpt::obs::CRawlog::addActions(), 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 CActionCollection.h.
References m_actions.
Referenced by getActionByClass().
|
inline |
Returns a iterator pointing to the end of the list: this is an example of usage:
Definition at line 101 of file CActionCollection.h.
References m_actions.
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 171 of file CActionCollection.cpp.
References ASSERT_, 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 131 of file CActionCollection.cpp.
References THROW_EXCEPTION.
CAction::Ptr 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 64 of file CActionCollection.cpp.
References THROW_EXCEPTION.
const CAction & CActionCollection::get | ( | size_t | index | ) | const |
Definition at line 71 of file CActionCollection.cpp.
References THROW_EXCEPTION.
|
inline |
Access to the i'th action of a given class, or a nullptr 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 129 of file CActionCollection.h.
References begin(), end(), MRPT_END, and MRPT_START.
Referenced by mrpt::slam::PF_implementation< mrpt::math::TPose3D, CMonteCarloLocalization3D, mrpt::bayes::particle_storage_mode::VALUE >::PF_SLAM_implementation_gatherActionsCheckBothActObs(), mrpt::slam::PF_implementation< mrpt::math::TPose3D, CMonteCarloLocalization3D, mrpt::bayes::particle_storage_mode::VALUE >::PF_SLAM_implementation_pfStandardProposal(), mrpt::maps::CMultiMetricMapPDF::prediction_and_update_pfOptimalProposal(), and mrpt::slam::CMetricMapBuilderRBPF::processActionObservation().
CActionRobotMovement2D::Ptr 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 93 of file CActionCollection.cpp.
References begin(), CLASS_ID, det(), and mrpt::obs::CActionRobotMovement2D::emScan2DMatching.
Referenced by mrpt::slam::PF_implementation< mrpt::math::TPose3D, CMonteCarloLocalization3D, mrpt::bayes::particle_storage_mode::VALUE >::PF_SLAM_implementation_gatherActionsCheckBothActObs(), mrpt::slam::PF_implementation< mrpt::math::TPose3D, CMonteCarloLocalization3D, mrpt::bayes::particle_storage_mode::VALUE >::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().
|
inlinestatic |
Definition at line 28 of file CActionCollection.h.
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 206 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 183 of file CActionCollection.cpp.
CActionRobotMovement2D::Ptr CActionCollection::getMovementEstimationByType | ( | CActionRobotMovement2D::TEstimationMethod | method | ) |
Returns the pose increment estimator in the collection having the specified type.
Definition at line 142 of file CActionCollection.cpp.
|
overridevirtual |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::serialization::CSerializable.
|
static |
Add a new object to the list.
Definition at line 85 of file CActionCollection.cpp.
References mrpt::rtti::CObject::clone().
Referenced by mrpt::slam::CMetricMapBuilderRBPF::processActionObservation().
Definition at line 28 of file CActionCollection.h.
|
inlinenoexcept |
Definition at line 28 of file CActionCollection.h.
Definition at line 28 of file CActionCollection.h.
Definition at line 28 of file CActionCollection.h.
|
inlinenoexcept |
Definition at line 28 of file CActionCollection.h.
|
inline |
Definition at line 28 of file CActionCollection.h.
Definition at line 28 of file CActionCollection.h.
|
inline |
Definition at line 28 of file CActionCollection.h.
|
overrideprotectedvirtual |
Pure virtual method for reading (deserializing) from an abstract archive.
Users don't call this method directly. Instead, use stream >> object;
.
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 I/O error |
Implements mrpt::serialization::CSerializable.
Definition at line 37 of file CActionCollection.cpp.
References begin(), mrpt::containers::clear(), and MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION.
|
overrideprotectedvirtual |
Must return the current versioning number of the object.
Start in zero for new classes, and increments each time there is a change in the stored format.
Implements mrpt::serialization::CSerializable.
Definition at line 30 of file CActionCollection.cpp.
|
overrideprotectedvirtual |
Pure virtual method for writing (serializing) to an abstract archive.
Users don't call this method directly. Instead, use stream << object;
.
std::exception | On any I/O error |
Implements mrpt::serialization::CSerializable.
Definition at line 31 of file CActionCollection.cpp.
References mrpt::serialization::CArchive::WriteAs().
size_t CActionCollection::size | ( | ) |
Returns the actions count in the collection.
Definition at line 81 of file CActionCollection.cpp.
|
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 nullptr is class does not support conversion to MATLAB. Definition at line 68 of file CSerializable.h.
|
staticprotected |
Definition at line 28 of file CActionCollection.h.
|
static |
Definition at line 28 of file CActionCollection.h.
|
protected |
The robot "actionss".
Definition at line 32 of file CActionCollection.h.
|
staticprotected |
Definition at line 28 of file CActionCollection.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 |