Main MRPT website > C++ reference
MRPT logo
Classes | Public Types | 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

#include <mrpt/slam/CActionRobotMovement2D.h>

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

List of all members.

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

 CActionRobotMovement2D ()
 Constructor.
 CActionRobotMovement2D (const CActionRobotMovement2D &o)
 Copy constructor.
CActionRobotMovement2Doperator= (const CActionRobotMovement2D &o)
 Copy operator.
 ~CActionRobotMovement2D ()
 Destructor.
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).
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).
void drawSingleSample (CPose2D &outSample) const
 Using this method instead of "poseChange->drawSingleSample()" may be more efficient in most situations.
void prepareFastDrawSingleSamples () const
 Call this before calling a high number of times "fastDrawSingleSample", which is much faster than "drawSingleSample".
void fastDrawSingleSample (CPose2D &outSample) const
 Faster version than "drawSingleSample", but requires a previous call to "prepareFastDrawSingleSamples".
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).
CObjectclone () const
 Cloning interface for smart pointers.

Public Attributes

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

Static Public Attributes

static const
mrpt::utils::TRuntimeClassId 
classCObject
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.
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.
void drawSingleSample_modelGaussian (CPose2D &outSample) const
 The sample generator for the model "computeFromOdometry_modelGaussian", internally called when the user invokes "drawSingleSample".
void drawSingleSample_modelThrun (CPose2D &outSample) const
 The sample generator for the model "computeFromOdometry_modelThrun", internally called when the user invokes "drawSingleSample".
void prepareFastDrawSingleSample_modelGaussian () const
 Internal use.
void prepareFastDrawSingleSample_modelThrun () const
 Internal use.
void fastDrawSingleSample_modelGaussian (CPose2D &outSample) const
 Internal use.
void fastDrawSingleSample_modelThrun (CPose2D &outSample) const
 Internal use.
virtual void writeToStream (mrpt::utils::CStream &out, int *getVersion) const =0
 Introduces a pure virtual method responsible for writing to a CStream.
virtual void readFromStream (mrpt::utils::CStream &in, int version)=0
 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.

Protected Attributes

CMatrixDouble33 m_fastDrawGauss_Z
 Auxiliary matrix.
CPose2D m_fastDrawGauss_M

RTTI stuff

static const
mrpt::utils::TRuntimeClassId 
classCAction
class mrpt::utils::CStream

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.
virtual mrpt::utils::CObjectduplicate () const
 Returns a copy of the object, indepently of its class.
static mrpt::utils::CObjectCreateObject ()
static CActionRobotMovement2DPtr Create ()

Member Typedef Documentation

A typedef for the associated smart pointer

Definition at line 56 of file CActionRobotMovement2D.h.


Member Enumeration Documentation

Enumerator:
mmGaussian 
mmThrun 

Definition at line 112 of file CActionRobotMovement2D.h.

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

Enumerator:
emOdometry 
emScan2DMatching 

Definition at line 61 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 ( ) [static, protected]

Reimplemented from mrpt::slam::CAction.

CObject* mrpt::utils::CObject::clone ( ) const [inline, inherited]

Cloning interface for smart pointers.

Reimplemented in mrpt::opengl::CRenderizable, and mrpt::opengl::CRenderizableDisplayList.

Definition at line 154 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::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 [inline, inherited]

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 151 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.

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".

virtual void mrpt::utils::CSerializable::readFromStream ( mrpt::utils::CStream in,
int  version 
) [protected, pure virtual, inherited]

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

Implemented in mrpt::math::CMatrixD, and mrpt::math::CMatrix.

virtual void mrpt::utils::CSerializable::writeToStream ( mrpt::utils::CStream out,
int *  getVersion 
) const [protected, pure virtual, inherited]

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

Implemented in mrpt::math::CMatrixD, and mrpt::math::CMatrix.


Friends And Related Function Documentation

friend class mrpt::utils::CStream [friend, inherited]

Reimplemented from mrpt::utils::CSerializable.

Definition at line 55 of file CAction.h.


Member Data Documentation

Definition at line 56 of file CActionRobotMovement2D.h.

Definition at line 55 of file CAction.h.

Definition at line 56 of file CActionRobotMovement2D.h.

Definition at line 139 of file CObject.h.

Definition at line 56 of file CSerializable.h.

Definition at line 56 of file CActionRobotMovement2D.h.

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 102 of file CActionRobotMovement2D.h.

Definition at line 102 of file CActionRobotMovement2D.h.

This fields indicates the way this estimation was obtained.

Definition at line 93 of file CActionRobotMovement2D.h.

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

Definition at line 97 of file CActionRobotMovement2D.h.

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

Definition at line 106 of file CActionRobotMovement2D.h.

Definition at line 233 of file CActionRobotMovement2D.h.

Auxiliary matrix.

Definition at line 232 of file CActionRobotMovement2D.h.

The 2D pose change probabilistic estimation.

Definition at line 85 of file CActionRobotMovement2D.h.

Referenced by mrpt::slam::PF_implementation::PF_SLAM_implementation_gatherActionsCheckBothActObs().

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

Definition at line 89 of file CActionRobotMovement2D.h.

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 69 of file CAction.h.

Definition at line 110 of file CActionRobotMovement2D.h.

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

Definition at line 110 of file CActionRobotMovement2D.h.




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011