MRPT  1.9.9
List of all members | Public Member Functions | Public Attributes | Private Member Functions
mrpt::kinematics::CVehicleVelCmd_DiffDriven Class Reference

Detailed Description

Kinematic model for Ackermann-like or differential-driven vehicles.

Definition at line 19 of file CVehicleVelCmd_DiffDriven.h.

#include <mrpt/kinematics/CVehicleVelCmd_DiffDriven.h>

Inheritance diagram for mrpt::kinematics::CVehicleVelCmd_DiffDriven:

Public Member Functions

 ~CVehicleVelCmd_DiffDriven () override
 
size_t getVelCmdLength () const override
 Get number of components in each velocity command. More...
 
std::string getVelCmdDescription (const int index) const override
 Get textual, human-readable description of each velocity command component. More...
 
double getVelCmdElement (const int index) const override
 Get each velocity command component. More...
 
void setVelCmdElement (const int index, const double val) override
 Set each velocity command component. More...
 
bool isStopCmd () const override
 Returns true if the command means "do not move" / "stop". More...
 
void setToStop () override
 Set to a command that means "do not move" / "stop". More...
 
void cmdVel_scale (double vel_scale) override
 See docs of method in base class. More...
 
double cmdVel_limits (const mrpt::kinematics::CVehicleVelCmd &prev_vel_cmd, const double beta, const TVelCmdParams &params) override
 See base class docs. More...
 
std::string asString () const
 Returns a human readable description of the cmd. More...
 
virtual mxArraywriteToMatlab () 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
 Makes a deep copy of the object and returns a smart pointer to it. More...
 

Public Attributes

double lin_vel {.0}
 Linear velocity (m/s) More...
 
double ang_vel {.0}
 Angular velocity (rad/s) More...
 

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...
 
CSerializable virtual methods
virtual void serializeTo (CSchemeArchiveBase &out) const
 Virtual method for writing (serializing) to an abstract schema based archive. More...
 
virtual void serializeFrom (CSchemeArchiveBase &in)
 Virtual method for reading (deserializing) from an abstract schema based archive. More...
 

Private Member Functions

double filter_max_vw (double &v, double &w, const TVelCmdParams &p)
 

RTTI stuff

using Ptr = std::shared_ptr< mrpt::kinematics ::CVehicleVelCmd_DiffDriven >
 
using ConstPtr = std::shared_ptr< const mrpt::kinematics ::CVehicleVelCmd_DiffDriven >
 
using UniquePtr = std::unique_ptr< mrpt::kinematics ::CVehicleVelCmd_DiffDriven >
 
using ConstUniquePtr = std::unique_ptr< const mrpt::kinematics ::CVehicleVelCmd_DiffDriven >
 
static const mrpt::rtti::TRuntimeClassId runtimeClassId
 
static constexpr const char * className = "mrpt::kinematics" "::" "CVehicleVelCmd_DiffDriven"
 
static const mrpt::rtti::TRuntimeClassId_GetBaseClass ()
 
static constexpr auto getClassName ()
 
static const mrpt::rtti::TRuntimeClassIdGetRuntimeClassIdStatic ()
 
static std::shared_ptr< CObjectCreateObject ()
 
template<typename... Args>
static Ptr Create (Args &&... args)
 
template<typename Alloc , typename... Args>
static Ptr CreateAlloc (const Alloc &alloc, Args &&... args)
 
template<typename... Args>
static UniquePtr CreateUnique (Args &&... args)
 
virtual const mrpt::rtti::TRuntimeClassIdGetRuntimeClass () const override
 Returns information about the class of an object in runtime. More...
 
virtual mrpt::rtti::CObjectclone () const override
 Returns a deep copy (clone) of the object, indepently of its class. More...
 

Member Typedef Documentation

◆ ConstPtr

Definition at line 21 of file CVehicleVelCmd_DiffDriven.h.

◆ ConstUniquePtr

Definition at line 21 of file CVehicleVelCmd_DiffDriven.h.

◆ Ptr

A type for the associated smart pointer

Definition at line 21 of file CVehicleVelCmd_DiffDriven.h.

◆ UniquePtr

Definition at line 21 of file CVehicleVelCmd_DiffDriven.h.

Constructor & Destructor Documentation

◆ ~CVehicleVelCmd_DiffDriven()

mrpt::kinematics::CVehicleVelCmd_DiffDriven::~CVehicleVelCmd_DiffDriven ( )
override

Member Function Documentation

◆ _GetBaseClass()

static const mrpt::rtti::TRuntimeClassId* mrpt::kinematics::CVehicleVelCmd_DiffDriven::_GetBaseClass ( )
staticprotected

◆ asString()

std::string mrpt::kinematics::CVehicleVelCmd::asString ( ) const
inherited

Returns a human readable description of the cmd.

Definition at line 22 of file CVehicleVelCmd.cpp.

References mrpt::format().

Here is the call graph for this function:

◆ clone()

virtual mrpt::rtti::CObject* mrpt::kinematics::CVehicleVelCmd_DiffDriven::clone ( ) const
overridevirtual

Returns a deep copy (clone) of the object, indepently of its class.

Implements mrpt::rtti::CObject.

◆ cmdVel_limits()

double CVehicleVelCmd_DiffDriven::cmdVel_limits ( const mrpt::kinematics::CVehicleVelCmd prev_vel_cmd,
const double  beta,
const TVelCmdParams params 
)
overridevirtual

See base class docs.

Tecognizes these parameters: robotMax_V_mps, robotMax_W_degps

Implements mrpt::kinematics::CVehicleVelCmd.

Definition at line 101 of file CVehicleVelCmd_DiffDriven.cpp.

References ang_vel, ASSERT_, ASSERTMSG_, filter_max_vw(), lin_vel, and params.

Here is the call graph for this function:

◆ cmdVel_scale()

void CVehicleVelCmd_DiffDriven::cmdVel_scale ( double  vel_scale)
overridevirtual

See docs of method in base class.

The implementation for differential-driven robots of this method just multiplies all the components of vel_cmd times vel_scale, which is appropriate for differential-driven kinematic models (v,w).

Implements mrpt::kinematics::CVehicleVelCmd.

Definition at line 95 of file CVehicleVelCmd_DiffDriven.cpp.

References ang_vel, and lin_vel.

◆ Create()

template<typename... Args>
static Ptr mrpt::kinematics::CVehicleVelCmd_DiffDriven::Create ( Args &&...  args)
inlinestatic

Definition at line 21 of file CVehicleVelCmd_DiffDriven.h.

◆ CreateAlloc()

template<typename Alloc , typename... Args>
static Ptr mrpt::kinematics::CVehicleVelCmd_DiffDriven::CreateAlloc ( const Alloc &  alloc,
Args &&...  args 
)
inlinestatic

Definition at line 21 of file CVehicleVelCmd_DiffDriven.h.

◆ CreateObject()

static std::shared_ptr<CObject> mrpt::kinematics::CVehicleVelCmd_DiffDriven::CreateObject ( )
static

◆ CreateUnique()

template<typename... Args>
static UniquePtr mrpt::kinematics::CVehicleVelCmd_DiffDriven::CreateUnique ( Args &&...  args)
inlinestatic

Definition at line 21 of file CVehicleVelCmd_DiffDriven.h.

◆ duplicateGetSmartPtr()

mrpt::rtti::CObject::Ptr CObject::duplicateGetSmartPtr ( ) const
inlineinherited

Makes a deep copy of the object and returns a smart pointer to it.

Definition at line 204 of file CObject.h.

References mrpt::rtti::CObject::clone().

Referenced by mrpt::obs::CRawlog::insert().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ filter_max_vw()

double CVehicleVelCmd_DiffDriven::filter_max_vw ( double &  v,
double &  w,
const TVelCmdParams p 
)
private

Definition at line 134 of file CVehicleVelCmd_DiffDriven.cpp.

References mrpt::kinematics::CVehicleVelCmd::TVelCmdParams::robotMax_V_mps, and mrpt::kinematics::CVehicleVelCmd::TVelCmdParams::robotMax_W_radps.

Referenced by cmdVel_limits().

Here is the caller graph for this function:

◆ getClassName()

static constexpr auto mrpt::kinematics::CVehicleVelCmd_DiffDriven::getClassName ( )
inlinestatic

Definition at line 21 of file CVehicleVelCmd_DiffDriven.h.

◆ GetRuntimeClass()

virtual const mrpt::rtti::TRuntimeClassId* mrpt::kinematics::CVehicleVelCmd_DiffDriven::GetRuntimeClass ( ) const
overridevirtual

Returns information about the class of an object in runtime.

Reimplemented from mrpt::kinematics::CVehicleVelCmd.

◆ GetRuntimeClassIdStatic()

static const mrpt::rtti::TRuntimeClassId& mrpt::kinematics::CVehicleVelCmd_DiffDriven::GetRuntimeClassIdStatic ( )
static

◆ getVelCmdDescription()

std::string CVehicleVelCmd_DiffDriven::getVelCmdDescription ( const int  index) const
overridevirtual

Get textual, human-readable description of each velocity command component.

Implements mrpt::kinematics::CVehicleVelCmd.

Definition at line 22 of file CVehicleVelCmd_DiffDriven.cpp.

References THROW_EXCEPTION_FMT.

◆ getVelCmdElement()

double CVehicleVelCmd_DiffDriven::getVelCmdElement ( const int  index) const
overridevirtual

Get each velocity command component.

Implements mrpt::kinematics::CVehicleVelCmd.

Definition at line 38 of file CVehicleVelCmd_DiffDriven.cpp.

References ang_vel, lin_vel, and THROW_EXCEPTION_FMT.

◆ getVelCmdLength()

size_t mrpt::kinematics::CVehicleVelCmd_DiffDriven::getVelCmdLength ( ) const
overridevirtual

Get number of components in each velocity command.

Implements mrpt::kinematics::CVehicleVelCmd.

◆ isStopCmd()

bool CVehicleVelCmd_DiffDriven::isStopCmd ( ) const
overridevirtual

Returns true if the command means "do not move" / "stop".

See also
setToStop

Implements mrpt::kinematics::CVehicleVelCmd.

Definition at line 69 of file CVehicleVelCmd_DiffDriven.cpp.

References ang_vel, and lin_vel.

◆ serializeFrom() [1/2]

void CVehicleVelCmd_DiffDriven::serializeFrom ( mrpt::serialization::CArchive in,
uint8_t  serial_version 
)
overrideprotectedvirtual

Pure virtual method for reading (deserializing) from an abstract archive.

Users don't call this method directly. Instead, use stream >> object;.

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 I/O error

Implements mrpt::serialization::CSerializable.

Definition at line 75 of file CVehicleVelCmd_DiffDriven.cpp.

References ang_vel, lin_vel, and MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION.

◆ serializeFrom() [2/2]

virtual void mrpt::serialization::CSerializable::serializeFrom ( CSchemeArchiveBase in)
inlineprotectedvirtualinherited

Virtual method for reading (deserializing) from an abstract schema based archive.

Definition at line 74 of file CSerializable.h.

References mrpt::serialization::CSerializable::GetRuntimeClass(), and THROW_EXCEPTION.

Here is the call graph for this function:

◆ serializeGetVersion()

uint8_t CVehicleVelCmd_DiffDriven::serializeGetVersion ( ) const
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 88 of file CVehicleVelCmd_DiffDriven.cpp.

◆ serializeTo() [1/2]

void CVehicleVelCmd_DiffDriven::serializeTo ( mrpt::serialization::CArchive out) const
overrideprotectedvirtual

Pure virtual method for writing (serializing) to an abstract archive.

Users don't call this method directly. Instead, use stream << object;.

Exceptions
std::exceptionOn any I/O error

Implements mrpt::serialization::CSerializable.

Definition at line 89 of file CVehicleVelCmd_DiffDriven.cpp.

References ang_vel, lin_vel, and out.

◆ serializeTo() [2/2]

virtual void mrpt::serialization::CSerializable::serializeTo ( CSchemeArchiveBase out) const
inlineprotectedvirtualinherited

Virtual method for writing (serializing) to an abstract schema based archive.

Definition at line 64 of file CSerializable.h.

References mrpt::serialization::CSerializable::GetRuntimeClass(), and THROW_EXCEPTION.

Here is the call graph for this function:

◆ setToStop()

void CVehicleVelCmd_DiffDriven::setToStop ( )
overridevirtual

Set to a command that means "do not move" / "stop".

See also
isStopCmd

Implements mrpt::kinematics::CVehicleVelCmd.

Definition at line 74 of file CVehicleVelCmd_DiffDriven.cpp.

References ang_vel, and lin_vel.

Referenced by mrpt::nav::CRobot2NavInterfaceForSimulator_DiffDriven::stop().

Here is the caller graph for this function:

◆ setVelCmdElement()

void CVehicleVelCmd_DiffDriven::setVelCmdElement ( const int  index,
const double  val 
)
overridevirtual

Set each velocity command component.

Implements mrpt::kinematics::CVehicleVelCmd.

Definition at line 53 of file CVehicleVelCmd_DiffDriven.cpp.

References ang_vel, lin_vel, THROW_EXCEPTION_FMT, and val.

◆ writeToMatlab()

virtual mxArray* mrpt::serialization::CSerializable::writeToMatlab ( ) const
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.

Returns
A new mxArray (caller is responsible of memory freeing) or nullptr is class does not support conversion to MATLAB.

Definition at line 90 of file CSerializable.h.

Member Data Documentation

◆ ang_vel

double mrpt::kinematics::CVehicleVelCmd_DiffDriven::ang_vel {.0}

◆ className

constexpr const char* mrpt::kinematics::CVehicleVelCmd_DiffDriven::className = "mrpt::kinematics" "::" "CVehicleVelCmd_DiffDriven"
static

Definition at line 21 of file CVehicleVelCmd_DiffDriven.h.

◆ lin_vel

double mrpt::kinematics::CVehicleVelCmd_DiffDriven::lin_vel {.0}

◆ runtimeClassId

const mrpt::rtti::TRuntimeClassId mrpt::kinematics::CVehicleVelCmd_DiffDriven::runtimeClassId
staticprotected

Definition at line 21 of file CVehicleVelCmd_DiffDriven.h.




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020