Main MRPT website > C++ reference
MRPT logo
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes
mrpt::slam::CActionRobotMovement2D Class Reference

Detailed Description

Represents a probabilistic 2D movement of the robot mobile base.

See the tutorial on probabilistic motion models.

See Also
CAction

Definition at line 34 of file CActionRobotMovement2D.h.

#include <mrpt/slam/CActionRobotMovement2D.h>

Inheritance diagram for mrpt::slam::CActionRobotMovement2D:
Inheritance graph
[legend]

Classes

struct  TMotionModelOptions
 The parameter to be passed to "computeFromOdometry". More...
 

Public Types

enum  TEstimationMethod { emOdometry = 0, emScan2DMatching }
 A list of posible ways for estimating the content of a CActionRobotMovement2D object. More...
 
enum  TDrawSampleMotionModel { mmGaussian = 0, mmThrun }
 

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 ()
 
 CActionRobotMovement2D ()
 Constructor. More...
 
 CActionRobotMovement2D (const CActionRobotMovement2D &o)
 Copy constructor. More...
 
CActionRobotMovement2Doperator= (const CActionRobotMovement2D &o)
 Copy operator. More...
 
 ~CActionRobotMovement2D ()
 Destructor. More...
 
void computeFromOdometry (const CPose2D &odometryIncrement, const TMotionModelOptions &options)
 Computes the PDF of the pose increment from an odometry reading and according to the given motion model (speed and encoder ticks information is not modified). More...
 
void computeFromEncoders (double K_left, double K_right, double D)
 If "hasEncodersInfo"=true, this method updates the pose estimation according to the ticks from both encoders and the passed parameters, which is passed internally to the method "computeFromOdometry" with the last used PDF options (or the defualt ones if not explicitly called by the user). More...
 
void drawSingleSample (CPose2D &outSample) const
 Using this method instead of "poseChange->drawSingleSample()" may be more efficient in most situations. More...
 
void prepareFastDrawSingleSamples () const
 Call this before calling a high number of times "fastDrawSingleSample", which is much faster than "drawSingleSample". More...
 
void fastDrawSingleSample (CPose2D &outSample) const
 Faster version than "drawSingleSample", but requires a previous call to "prepareFastDrawSingleSamples". More...
 
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...
 
CObjectclone () const
 Cloning interface for smart pointers. More...
 

Static Public Member Functions

static void * operator new (size_t size, void *ptr)
 

Public Attributes

CPosePDFPtr poseChange
 The 2D pose change probabilistic estimation. More...
 
CPose2D rawOdometryIncrementReading
 This is the raw odometry reading, and only is used when "estimationMethod" is "TEstimationMethod::emOdometry". More...
 
TEstimationMethod estimationMethod
 This fields indicates the way this estimation was obtained. More...
 
bool hasEncodersInfo
 If "true" means that "encoderLeftTicks" and "encoderRightTicks" contain valid values. More...
 
int32_t encoderLeftTicks
 For odometry only: the ticks count for each wheel FROM the last reading (positive means FORWARD, for both wheels);. More...
 
int32_t encoderRightTicks
 
bool hasVelocities
 If "true" means that "velocityLin" and "velocityAng" contain valid values. More...
 
float velocityLin
 The velocity of the robot, linear in meters/sec and angular in rad/sec. More...
 
float velocityAng
 
struct OBS_IMPEXP
mrpt::slam::CActionRobotMovement2D::TMotionModelOptions 
motionModelConfiguration
 
mrpt::system::TTimeStamp timestamp
 The associated time-stamp. More...
 

Static Public Attributes

static const
mrpt::utils::TRuntimeClassId 
classCObject
 
RTTI stuff
static const
mrpt::utils::TRuntimeClassId 
classCAction
 
RTTI stuff
static const
mrpt::utils::TRuntimeClassId 
classCSerializable
 

Protected Member Functions

void computeFromOdometry_modelGaussian (const CPose2D &odometryIncrement, const TMotionModelOptions &o)
 Computes the PDF of the pose increment from an odometry reading, using a Gaussian approximation as the motion model. More...
 
void computeFromOdometry_modelThrun (const CPose2D &odometryIncrement, const TMotionModelOptions &o)
 Computes the PDF of the pose increment from an odometry reading, using the motion model from Thrun's book. More...
 
void drawSingleSample_modelGaussian (CPose2D &outSample) const
 The sample generator for the model "computeFromOdometry_modelGaussian", internally called when the user invokes "drawSingleSample". More...
 
void drawSingleSample_modelThrun (CPose2D &outSample) const
 The sample generator for the model "computeFromOdometry_modelThrun", internally called when the user invokes "drawSingleSample". More...
 
void prepareFastDrawSingleSample_modelGaussian () const
 Internal use. More...
 
void prepareFastDrawSingleSample_modelThrun () const
 Internal use. More...
 
void fastDrawSingleSample_modelGaussian (CPose2D &outSample) const
 Internal use. More...
 
void fastDrawSingleSample_modelThrun (CPose2D &outSample) const
 Internal use. More...
 
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

CMatrixDouble33 m_fastDrawGauss_Z
 Auxiliary matrix. More...
 
CPose2D m_fastDrawGauss_M
 

RTTI stuff

typedef CActionRobotMovement2DPtr SmartPtr
 
static mrpt::utils::CLASSINIT _init_CActionRobotMovement2D
 
static mrpt::utils::TRuntimeClassId classCActionRobotMovement2D
 
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::CObjectduplicate () const
 Returns a copy of the object, indepently of its class. More...
 
static mrpt::utils::CObjectCreateObject ()
 
static CActionRobotMovement2DPtr Create ()
 

Member Typedef Documentation

A typedef for the associated smart pointer

Definition at line 37 of file CActionRobotMovement2D.h.

Member Enumeration Documentation

Enumerator
mmGaussian 
mmThrun 

Definition at line 93 of file CActionRobotMovement2D.h.

A list of posible ways for estimating the content of a CActionRobotMovement2D object.

Enumerator
emOdometry 
emScan2DMatching 

Definition at line 42 of file CActionRobotMovement2D.h.

Constructor & Destructor Documentation

mrpt::slam::CActionRobotMovement2D::CActionRobotMovement2D ( )

Constructor.

mrpt::slam::CActionRobotMovement2D::CActionRobotMovement2D ( const CActionRobotMovement2D o)

Copy constructor.

mrpt::slam::CActionRobotMovement2D::~CActionRobotMovement2D ( )

Destructor.

Member Function Documentation

static const mrpt::utils::TRuntimeClassId* mrpt::slam::CActionRobotMovement2D::_GetBaseClass ( )
staticprotected
CObject* mrpt::utils::CObject::clone ( ) const
inlineinherited

Cloning interface for smart pointers.

Definition at line 139 of file CObject.h.

void mrpt::slam::CActionRobotMovement2D::computeFromEncoders ( double  K_left,
double  K_right,
double  D 
)

If "hasEncodersInfo"=true, this method updates the pose estimation according to the ticks from both encoders and the passed parameters, which is passed internally to the method "computeFromOdometry" with the last used PDF options (or the defualt ones if not explicitly called by the user).

Parameters
K_leftThe meters / tick ratio for the left encoder.
K_rightThe meters / tick ratio for the right encoder.
DThe distance between both wheels, in meters.
void mrpt::slam::CActionRobotMovement2D::computeFromOdometry ( const CPose2D odometryIncrement,
const TMotionModelOptions options 
)

Computes the PDF of the pose increment from an odometry reading and according to the given motion model (speed and encoder ticks information is not modified).

According to the parameters in the passed struct, it will be called one the private sampling functions (see "see also" next).

See Also
computeFromOdometry_modelGaussian, computeFromOdometry_modelThrun

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

void mrpt::slam::CActionRobotMovement2D::computeFromOdometry_modelGaussian ( const CPose2D odometryIncrement,
const TMotionModelOptions o 
)
protected

Computes the PDF of the pose increment from an odometry reading, using a Gaussian approximation as the motion model.

See Also
computeFromOdometry
void mrpt::slam::CActionRobotMovement2D::computeFromOdometry_modelThrun ( const CPose2D odometryIncrement,
const TMotionModelOptions o 
)
protected

Computes the PDF of the pose increment from an odometry reading, using the motion model from Thrun's book.

This model is discussed in "Probabilistic Robotics", Thrun, Burgard, and Fox, 2006, pp.136.

See Also
computeFromOdometry
static CActionRobotMovement2DPtr mrpt::slam::CActionRobotMovement2D::Create ( )
static
static mrpt::utils::CObject* mrpt::slam::CActionRobotMovement2D::CreateObject ( )
static
void mrpt::slam::CActionRobotMovement2D::drawSingleSample ( CPose2D outSample) const

Using this method instead of "poseChange->drawSingleSample()" may be more efficient in most situations.

See Also
CPosePDF::drawSingleSample
void mrpt::slam::CActionRobotMovement2D::drawSingleSample_modelGaussian ( CPose2D outSample) const
protected

The sample generator for the model "computeFromOdometry_modelGaussian", internally called when the user invokes "drawSingleSample".

void mrpt::slam::CActionRobotMovement2D::drawSingleSample_modelThrun ( CPose2D outSample) const
protected

The sample generator for the model "computeFromOdometry_modelThrun", internally called when the user invokes "drawSingleSample".

virtual mrpt::utils::CObject* mrpt::slam::CActionRobotMovement2D::duplicate ( ) const
virtual

Returns a copy of the object, indepently of its class.

Implements mrpt::utils::CObject.

mrpt::utils::CObjectPtr mrpt::utils::CObject::duplicateGetSmartPtr ( ) const
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 136 of file CObject.h.

void mrpt::slam::CActionRobotMovement2D::fastDrawSingleSample ( CPose2D outSample) const

Faster version than "drawSingleSample", but requires a previous call to "prepareFastDrawSingleSamples".

void mrpt::slam::CActionRobotMovement2D::fastDrawSingleSample_modelGaussian ( CPose2D outSample) const
protected

Internal use.

void mrpt::slam::CActionRobotMovement2D::fastDrawSingleSample_modelThrun ( CPose2D outSample) const
protected

Internal use.

virtual const mrpt::utils::TRuntimeClassId* mrpt::slam::CActionRobotMovement2D::GetRuntimeClass ( ) const
virtual

Returns information about the class of an object in runtime.

Reimplemented from mrpt::slam::CAction.

void mrpt::slam::CActionRobotMovement2D::operator delete ( void *  ptr)
throw (
)
inline

Definition at line 37 of file CActionRobotMovement2D.h.

void mrpt::slam::CActionRobotMovement2D::operator delete ( void *  memory,
void *  ptr 
)
throw (
)
inline

Definition at line 37 of file CActionRobotMovement2D.h.

void mrpt::slam::CActionRobotMovement2D::operator delete ( void *  ptr,
const std::nothrow_t &   
)
throw (
)
inline

Definition at line 37 of file CActionRobotMovement2D.h.

void mrpt::slam::CActionRobotMovement2D::operator delete[] ( void *  ptr)
throw (
)
inline

Definition at line 37 of file CActionRobotMovement2D.h.

void* mrpt::slam::CActionRobotMovement2D::operator new ( size_t  size,
const std::nothrow_t &   
)
throw (
)
inline

Definition at line 37 of file CActionRobotMovement2D.h.

static void* mrpt::slam::CActionRobotMovement2D::operator new ( size_t  size,
void *  ptr 
)
inlinestatic

Definition at line 37 of file CActionRobotMovement2D.h.

void* mrpt::slam::CActionRobotMovement2D::operator new ( size_t  size)
inline

Definition at line 37 of file CActionRobotMovement2D.h.

void* mrpt::slam::CActionRobotMovement2D::operator new[] ( size_t  size)
inline

Definition at line 37 of file CActionRobotMovement2D.h.

CActionRobotMovement2D& mrpt::slam::CActionRobotMovement2D::operator= ( const CActionRobotMovement2D o)

Copy operator.

void mrpt::slam::CActionRobotMovement2D::prepareFastDrawSingleSample_modelGaussian ( ) const
protected

Internal use.

void mrpt::slam::CActionRobotMovement2D::prepareFastDrawSingleSample_modelThrun ( ) const
protected

Internal use.

void mrpt::slam::CActionRobotMovement2D::prepareFastDrawSingleSamples ( ) const

Call this before calling a high number of times "fastDrawSingleSample", which is much faster than "drawSingleSample".

void mrpt::slam::CActionRobotMovement2D::readFromStream ( mrpt::utils::CStream in,
int  version 
)
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.

Parameters
inThe input binary stream where the object data must read from.
versionThe version of the object stored in the stream: use this version number in your code to know how to read the incoming data.
Exceptions
std::exceptionOn any error, see CStream::ReadBuffer
See Also
CStream

Implements mrpt::utils::CSerializable.

void mrpt::slam::CActionRobotMovement2D::writeToStream ( mrpt::utils::CStream out,
int *  getVersion 
) const
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.

Parameters
outThe output binary stream where object must be dumped.
getVersionIf 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.
Exceptions
std::exceptionOn any error, see CStream::WriteBuffer
See Also
CStream

Implements mrpt::utils::CSerializable.

Member Data Documentation

mrpt::utils::CLASSINIT mrpt::slam::CActionRobotMovement2D::_init_CActionRobotMovement2D
staticprotected

Definition at line 37 of file CActionRobotMovement2D.h.

const mrpt::utils::TRuntimeClassId mrpt::slam::CAction::classCAction
staticinherited

Definition at line 36 of file CAction.h.

mrpt::utils::TRuntimeClassId mrpt::slam::CActionRobotMovement2D::classCActionRobotMovement2D
static

Definition at line 37 of file CActionRobotMovement2D.h.

const mrpt::utils::TRuntimeClassId mrpt::utils::CObject::classCObject
staticinherited

Definition at line 124 of file CObject.h.

const mrpt::utils::TRuntimeClassId mrpt::utils::CSerializable::classCSerializable
staticinherited

Definition at line 38 of file CSerializable.h.

const mrpt::utils::TRuntimeClassId* mrpt::slam::CActionRobotMovement2D::classinfo
static

Definition at line 37 of file CActionRobotMovement2D.h.

int32_t mrpt::slam::CActionRobotMovement2D::encoderLeftTicks

For odometry only: the ticks count for each wheel FROM the last reading (positive means FORWARD, for both wheels);.

See Also
hasEncodersInfo

Definition at line 83 of file CActionRobotMovement2D.h.

int32_t mrpt::slam::CActionRobotMovement2D::encoderRightTicks

Definition at line 83 of file CActionRobotMovement2D.h.

TEstimationMethod mrpt::slam::CActionRobotMovement2D::estimationMethod

This fields indicates the way this estimation was obtained.

Definition at line 74 of file CActionRobotMovement2D.h.

bool mrpt::slam::CActionRobotMovement2D::hasEncodersInfo

If "true" means that "encoderLeftTicks" and "encoderRightTicks" contain valid values.

Definition at line 78 of file CActionRobotMovement2D.h.

bool mrpt::slam::CActionRobotMovement2D::hasVelocities

If "true" means that "velocityLin" and "velocityAng" contain valid values.

Definition at line 87 of file CActionRobotMovement2D.h.

CPose2D mrpt::slam::CActionRobotMovement2D::m_fastDrawGauss_M
mutableprotected

Definition at line 214 of file CActionRobotMovement2D.h.

CMatrixDouble33 mrpt::slam::CActionRobotMovement2D::m_fastDrawGauss_Z
mutableprotected

Auxiliary matrix.

Definition at line 213 of file CActionRobotMovement2D.h.

struct OBS_IMPEXP mrpt::slam::CActionRobotMovement2D::TMotionModelOptions mrpt::slam::CActionRobotMovement2D::motionModelConfiguration
CPosePDFPtr mrpt::slam::CActionRobotMovement2D::poseChange
CPose2D mrpt::slam::CActionRobotMovement2D::rawOdometryIncrementReading

This is the raw odometry reading, and only is used when "estimationMethod" is "TEstimationMethod::emOdometry".

Definition at line 70 of file CActionRobotMovement2D.h.

mrpt::system::TTimeStamp mrpt::slam::CAction::timestamp
inherited

The associated time-stamp.

This was added at 2-Dec-2007, new serialization versions have been added to derived classes to manage this time-stamp. Prior versions will be read as having a INVALID_TIMESTAMP value.

Definition at line 50 of file CAction.h.

float mrpt::slam::CActionRobotMovement2D::velocityAng

Definition at line 91 of file CActionRobotMovement2D.h.

float mrpt::slam::CActionRobotMovement2D::velocityLin

The velocity of the robot, linear in meters/sec and angular in rad/sec.

Definition at line 91 of file CActionRobotMovement2D.h.




Page generated by Doxygen 1.8.6 for MRPT 1.2.0 SVN: at dom ago 20 02:20:21 CEST 2017 Hosted on:
SourceForge.net Logo