Main MRPT website > C++ reference for MRPT 1.4.0
List of all members | Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
mrpt::obs::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 29 of file obs/CActionRobotMovement2D.h.

#include <mrpt/obs/CActionRobotMovement2D.h>

Inheritance diagram for mrpt::obs::CActionRobotMovement2D:
Inheritance graph

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 mrpt::poses::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 (mrpt::poses::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 (mrpt::poses::CPose2D &outSample) const
 Faster version than "drawSingleSample", but requires a previous call to "prepareFastDrawSingleSamples".
 

Public Attributes

mrpt::poses::CPosePDFPtr poseChange
 The 2D pose change probabilistic estimation.
 
mrpt::poses::CPose2D rawOdometryIncrementReading
 This is the raw odometry reading, and only is used when "estimationMethod" is "TEstimationMethod::emOdometry".
 
TEstimationMethod estimationMethod
 This fields indicates the way in which 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
 
float velocityAng
 The velocity of the robot, linear in meters/sec and angular in rad/sec.
 
struct OBS_IMPEXP mrpt::obs::CActionRobotMovement2D::TMotionModelOptions motionModelConfiguration
 
mrpt::system::TTimeStamp timestamp
 The associated time-stamp.
 

Static Public Attributes

RTTI stuff <br>
static const mrpt::utils::TRuntimeClassId classCAction
 

Protected Member Functions

void computeFromOdometry_modelGaussian (const mrpt::poses::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 mrpt::poses::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 (mrpt::poses::CPose2D &outSample) const
 The sample generator for the model "computeFromOdometry_modelGaussian", internally called when the user invokes "drawSingleSample".
 
void drawSingleSample_modelThrun (mrpt::poses::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 (mrpt::poses::CPose2D &outSample) const
 Internal use.
 
void fastDrawSingleSample_modelThrun (mrpt::poses::CPose2D &outSample) const
 Internal use.
 
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

mrpt::math::CMatrixDouble33 m_fastDrawGauss_Z
 Auxiliary matrix.
 
mrpt::poses::CPose2D m_fastDrawGauss_M
 

RTTI stuff <br>

typedef CActionRobotMovement2DPtr SmartPtr
 
static mrpt::utils::CLASSINIT _init_CActionRobotMovement2D
 
static mrpt::utils::TRuntimeClassId classCActionRobotMovement2D
 
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 CActionRobotMovement2DPtr Create ()
 

Member Typedef Documentation

◆ SmartPtr

A typedef for the associated smart pointer

Definition at line 32 of file obs/CActionRobotMovement2D.h.

Member Enumeration Documentation

◆ TDrawSampleMotionModel

Enumerator
mmGaussian 
mmThrun 

Definition at line 62 of file obs/CActionRobotMovement2D.h.

◆ TEstimationMethod

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

Enumerator
emOdometry 
emScan2DMatching 

Definition at line 37 of file obs/CActionRobotMovement2D.h.

Constructor & Destructor Documentation

◆ CActionRobotMovement2D() [1/2]

mrpt::obs::CActionRobotMovement2D::CActionRobotMovement2D ( )

Constructor.

◆ CActionRobotMovement2D() [2/2]

mrpt::obs::CActionRobotMovement2D::CActionRobotMovement2D ( const CActionRobotMovement2D o)

Copy constructor.

◆ ~CActionRobotMovement2D()

mrpt::obs::CActionRobotMovement2D::~CActionRobotMovement2D ( )

Destructor.

Member Function Documentation

◆ _GetBaseClass()

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

◆ computeFromEncoders()

void mrpt::obs::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.

◆ computeFromOdometry()

void mrpt::obs::CActionRobotMovement2D::computeFromOdometry ( const mrpt::poses::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

◆ computeFromOdometry_modelGaussian()

void mrpt::obs::CActionRobotMovement2D::computeFromOdometry_modelGaussian ( const mrpt::poses::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

◆ computeFromOdometry_modelThrun()

void mrpt::obs::CActionRobotMovement2D::computeFromOdometry_modelThrun ( const mrpt::poses::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

◆ Create()

static CActionRobotMovement2DPtr mrpt::obs::CActionRobotMovement2D::Create ( )
static

◆ CreateObject()

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

◆ drawSingleSample()

void mrpt::obs::CActionRobotMovement2D::drawSingleSample ( mrpt::poses::CPose2D outSample) const

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

See also
CPosePDF::drawSingleSample

◆ drawSingleSample_modelGaussian()

void mrpt::obs::CActionRobotMovement2D::drawSingleSample_modelGaussian ( mrpt::poses::CPose2D outSample) const
protected

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

◆ drawSingleSample_modelThrun()

void mrpt::obs::CActionRobotMovement2D::drawSingleSample_modelThrun ( mrpt::poses::CPose2D outSample) const
protected

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

◆ duplicate()

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

◆ fastDrawSingleSample()

void mrpt::obs::CActionRobotMovement2D::fastDrawSingleSample ( mrpt::poses::CPose2D outSample) const

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

◆ fastDrawSingleSample_modelGaussian()

void mrpt::obs::CActionRobotMovement2D::fastDrawSingleSample_modelGaussian ( mrpt::poses::CPose2D outSample) const
protected

Internal use.

◆ fastDrawSingleSample_modelThrun()

void mrpt::obs::CActionRobotMovement2D::fastDrawSingleSample_modelThrun ( mrpt::poses::CPose2D outSample) const
protected

Internal use.

◆ GetRuntimeClass()

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

Reimplemented from mrpt::obs::CAction.

◆ operator=()

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

Copy operator.

◆ prepareFastDrawSingleSample_modelGaussian()

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

Internal use.

◆ prepareFastDrawSingleSample_modelThrun()

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

Internal use.

◆ prepareFastDrawSingleSamples()

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

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

◆ readFromStream()

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

◆ writeToStream()

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

Member Data Documentation

◆ _init_CActionRobotMovement2D

mrpt::utils::CLASSINIT mrpt::obs::CActionRobotMovement2D::_init_CActionRobotMovement2D
staticprotected

Definition at line 32 of file obs/CActionRobotMovement2D.h.

◆ classCAction

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

Definition at line 36 of file obs/CAction.h.

◆ classCActionRobotMovement2D

mrpt::utils::TRuntimeClassId mrpt::obs::CActionRobotMovement2D::classCActionRobotMovement2D
static

Definition at line 32 of file obs/CActionRobotMovement2D.h.

◆ classinfo

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

Definition at line 32 of file obs/CActionRobotMovement2D.h.

◆ encoderLeftTicks

int32_t mrpt::obs::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 57 of file obs/CActionRobotMovement2D.h.

◆ encoderRightTicks

int32_t mrpt::obs::CActionRobotMovement2D::encoderRightTicks

Definition at line 57 of file obs/CActionRobotMovement2D.h.

◆ estimationMethod

TEstimationMethod mrpt::obs::CActionRobotMovement2D::estimationMethod

This fields indicates the way in which this estimation was obtained.

Definition at line 51 of file obs/CActionRobotMovement2D.h.

◆ hasEncodersInfo

bool mrpt::obs::CActionRobotMovement2D::hasEncodersInfo

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

Definition at line 53 of file obs/CActionRobotMovement2D.h.

◆ hasVelocities

bool mrpt::obs::CActionRobotMovement2D::hasVelocities

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

Definition at line 59 of file obs/CActionRobotMovement2D.h.

◆ m_fastDrawGauss_M

mrpt::poses::CPose2D mrpt::obs::CActionRobotMovement2D::m_fastDrawGauss_M
mutableprotected

Definition at line 177 of file obs/CActionRobotMovement2D.h.

◆ m_fastDrawGauss_Z

mrpt::math::CMatrixDouble33 mrpt::obs::CActionRobotMovement2D::m_fastDrawGauss_Z
mutableprotected

Auxiliary matrix.

Definition at line 176 of file obs/CActionRobotMovement2D.h.

◆ motionModelConfiguration

struct OBS_IMPEXP mrpt::obs::CActionRobotMovement2D::TMotionModelOptions mrpt::obs::CActionRobotMovement2D::motionModelConfiguration

◆ poseChange

mrpt::poses::CPosePDFPtr mrpt::obs::CActionRobotMovement2D::poseChange

The 2D pose change probabilistic estimation.

Definition at line 48 of file obs/CActionRobotMovement2D.h.

◆ rawOdometryIncrementReading

mrpt::poses::CPose2D mrpt::obs::CActionRobotMovement2D::rawOdometryIncrementReading

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

Definition at line 50 of file obs/CActionRobotMovement2D.h.

◆ timestamp

mrpt::system::TTimeStamp mrpt::obs::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 obs/CAction.h.

◆ velocityAng

float mrpt::obs::CActionRobotMovement2D::velocityAng

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

Definition at line 60 of file obs/CActionRobotMovement2D.h.

◆ velocityLin

float mrpt::obs::CActionRobotMovement2D::velocityLin

Definition at line 60 of file obs/CActionRobotMovement2D.h.




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