MRPT  2.0.4
List of all members | Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
mrpt::kinematics::CVehicleSimul_DiffDriven Class Reference

Detailed Description

Simulates the kinematics of a differential-driven planar mobile robot/vehicle, including odometry errors and dynamics limitations.

Definition at line 21 of file CVehicleSimul_DiffDriven.h.

#include <mrpt/kinematics/CVehicleSimul_DiffDriven.h>

Inheritance diagram for mrpt::kinematics::CVehicleSimul_DiffDriven:

Public Types

using kinematic_cmd_t = CVehicleVelCmd_DiffDriven
 

Public Member Functions

 CVehicleSimul_DiffDriven ()
 
 ~CVehicleSimul_DiffDriven () override
 
void setDelayModelParams (double TAU_delay_sec=1.8, double CMD_delay_sec=0.)
 Change the model of delays used for the orders sent to the robot. More...
 
void setV (double v)
 
void setW (double w)
 
double getV ()
 
double getW ()
 
void movementCommand (double lin_vel, double ang_vel)
 Used to command the robot a desired movement: More...
 
void sendVelCmd (const CVehicleVelCmd &cmd_vel) override
 Sends a velocity command to the robot. More...
 
CVehicleVelCmd::Ptr getVelCmdType () const override
 Gets an empty velocity command object that can be queried to find out the number of velcmd components,... More...
 

Protected Attributes

double m_firmware_control_period {500e-6}
 The period at which the low-level controller updates velocities (Default: 0.5 ms) More...
 
bool m_use_odo_error {false}
 Whether to corrupt odometry with noise. More...
 
double m_Ax_err_bias
 
double m_Ax_err_std
 
double m_Ay_err_bias
 
double m_Ay_err_std
 
double m_Aphi_err_bias
 
double m_Aphi_err_std
 

Private Member Functions

void internal_simulControlStep (const double dt) override
 
void internal_clear () override
 Resets all pending cmds. More...
 

Private Attributes

double m_v {0}
 lin & angular velocity in the robot local frame. More...
 
double m_w {0}
 
double Command_Time {0}
 Dynamic limitations of the robot. More...
 
double Command_v {0}
 
double Command_w {0}
 
double Command_v0 {0}
 
double Command_w0 {0}
 
double cTAU {.0}
 The time-constants for the first order low-pass filter for the velocities changes. More...
 
double cDELAY {.0}
 The delay constant for the velocities changes. More...
 

Member Typedef Documentation

◆ kinematic_cmd_t

Definition at line 24 of file CVehicleSimul_DiffDriven.h.

Constructor & Destructor Documentation

◆ CVehicleSimul_DiffDriven()

CVehicleSimul_DiffDriven::CVehicleSimul_DiffDriven ( )

◆ ~CVehicleSimul_DiffDriven()

CVehicleSimul_DiffDriven::~CVehicleSimul_DiffDriven ( )
overridedefault

Member Function Documentation

◆ getCurrentGTPose()

const mrpt::math::TPose2D& mrpt::kinematics::CVehicleSimulVirtualBase::getCurrentGTPose ( ) const
inlineinherited

◆ getCurrentGTVel()

const mrpt::math::TTwist2D& mrpt::kinematics::CVehicleSimulVirtualBase::getCurrentGTVel ( ) const
inlineinherited

Returns the instantaneous, ground truth velocity vector (vx,vy,omega) in world coordinates.

Definition at line 64 of file CVehicleSimulVirtualBase.h.

References mrpt::kinematics::CVehicleSimulVirtualBase::m_GT_vel.

Referenced by mrpt::nav::CRobot2NavInterfaceForSimulator_Holo::getCurrentPoseAndSpeeds(), and mrpt::nav::CRobot2NavInterfaceForSimulator_DiffDriven::getCurrentPoseAndSpeeds().

◆ getCurrentGTVelLocal()

mrpt::math::TTwist2D CVehicleSimulVirtualBase::getCurrentGTVelLocal ( ) const
inherited

Returns the instantaneous, ground truth velocity vector (vx,vy,omega) in the robot local frame.

Definition at line 83 of file CVehicleSimulVirtualBase.cpp.

References mrpt::kinematics::CVehicleSimulVirtualBase::m_GT_pose, mrpt::kinematics::CVehicleSimulVirtualBase::m_GT_vel, mrpt::math::TPose2D::phi, and mrpt::math::TTwist2D::rotate().

◆ getCurrentOdometricPose()

const mrpt::math::TPose2D& mrpt::kinematics::CVehicleSimulVirtualBase::getCurrentOdometricPose ( ) const
inlineinherited

◆ getCurrentOdometricVel()

const mrpt::math::TTwist2D& mrpt::kinematics::CVehicleSimulVirtualBase::getCurrentOdometricVel ( ) const
inlineinherited

Returns the instantaneous, odometric velocity vector (vx,vy,omega) in world coordinates.

Definition at line 71 of file CVehicleSimulVirtualBase.h.

References mrpt::kinematics::CVehicleSimulVirtualBase::m_odometric_vel.

◆ getCurrentOdometricVelLocal()

mrpt::math::TTwist2D CVehicleSimulVirtualBase::getCurrentOdometricVelLocal ( ) const
inherited

◆ getTime()

double mrpt::kinematics::CVehicleSimulVirtualBase::getTime ( ) const
inlineinherited

◆ getV()

double mrpt::kinematics::CVehicleSimul_DiffDriven::getV ( )
inline

Definition at line 40 of file CVehicleSimul_DiffDriven.h.

References m_v.

◆ getVelCmdType()

CVehicleVelCmd::Ptr mrpt::kinematics::CVehicleSimul_DiffDriven::getVelCmdType ( ) const
inlineoverridevirtual

Gets an empty velocity command object that can be queried to find out the number of velcmd components,...

Implements mrpt::kinematics::CVehicleSimulVirtualBase.

Definition at line 57 of file CVehicleSimul_DiffDriven.h.

◆ getW()

double mrpt::kinematics::CVehicleSimul_DiffDriven::getW ( )
inline

Definition at line 41 of file CVehicleSimul_DiffDriven.h.

References m_w.

◆ internal_clear()

void CVehicleSimul_DiffDriven::internal_clear ( )
overrideprivatevirtual

Resets all pending cmds.

Implements mrpt::kinematics::CVehicleSimulVirtualBase.

Definition at line 22 of file CVehicleSimul_DiffDriven.cpp.

References Command_Time, Command_v, Command_w, m_v, and m_w.

◆ internal_simulControlStep()

void CVehicleSimul_DiffDriven::internal_simulControlStep ( const double  dt)
overrideprivatevirtual

◆ movementCommand()

void CVehicleSimul_DiffDriven::movementCommand ( double  lin_vel,
double  ang_vel 
)

Used to command the robot a desired movement:

Parameters
lin_velLinar velocity (m/s)
ang_velAngular velocity (rad/s)

Definition at line 62 of file CVehicleSimul_DiffDriven.cpp.

References Command_Time, Command_v, Command_v0, Command_w, Command_w0, mrpt::kinematics::CVehicleSimulVirtualBase::m_time, m_v, and m_w.

Referenced by sendVelCmd().

◆ resetStatus()

void CVehicleSimulVirtualBase::resetStatus ( )
inherited

◆ resetTime()

void CVehicleSimulVirtualBase::resetTime ( )
inherited

Reset all simulator variables to 0 (except the.

simulation time).

See also
resetTime Reset time counter
resetStatus

Definition at line 82 of file CVehicleSimulVirtualBase.cpp.

References mrpt::kinematics::CVehicleSimulVirtualBase::m_time.

Referenced by CVehicleSimul_DiffDriven(), and mrpt::kinematics::CVehicleSimul_Holo::CVehicleSimul_Holo().

◆ sendVelCmd()

void mrpt::kinematics::CVehicleSimul_DiffDriven::sendVelCmd ( const CVehicleVelCmd cmd_vel)
inlineoverridevirtual

Sends a velocity command to the robot.

The number of components and their meaning depends on the vehicle-kinematics derived class

Implements mrpt::kinematics::CVehicleSimulVirtualBase.

Definition at line 48 of file CVehicleSimul_DiffDriven.h.

References ASSERTMSG_, cmd(), and movementCommand().

Referenced by mrpt::nav::CRobot2NavInterfaceForSimulator_DiffDriven::changeSpeeds(), and mrpt::nav::CRobot2NavInterfaceForSimulator_DiffDriven::stop().

◆ setCurrentGTPose()

void CVehicleSimulVirtualBase::setCurrentGTPose ( const mrpt::math::TPose2D pose)
inherited

Brute-force move robot to target coordinates ("teleport")

Definition at line 21 of file CVehicleSimulVirtualBase.cpp.

References mrpt::kinematics::CVehicleSimulVirtualBase::m_GT_pose.

◆ setCurrentOdometricPose()

template<typename T >
void mrpt::kinematics::CVehicleSimulVirtualBase::setCurrentOdometricPose ( const T &  pose)
inlineinherited

Brute-force overwrite robot odometry

Definition at line 57 of file CVehicleSimulVirtualBase.h.

References mrpt::kinematics::CVehicleSimulVirtualBase::m_odometry.

◆ setDelayModelParams()

void mrpt::kinematics::CVehicleSimul_DiffDriven::setDelayModelParams ( double  TAU_delay_sec = 1.8,
double  CMD_delay_sec = 0. 
)
inline

Change the model of delays used for the orders sent to the robot.

See also
movementCommand

Definition at line 31 of file CVehicleSimul_DiffDriven.h.

References cDELAY, and cTAU.

◆ setOdometryErrors()

void mrpt::kinematics::CVehicleSimulVirtualBase::setOdometryErrors ( bool  enabled,
double  Ax_err_bias = 1e-3,
double  Ax_err_std = 10e-3,
double  Ay_err_bias = 1e-3,
double  Ay_err_std = 10e-3,
double  Aphi_err_bias = mrpt::DEG2RAD(1e-3),
double  Aphi_err_std = mrpt::DEG2RAD(10e-3) 
)
inlineinherited

◆ setV()

void mrpt::kinematics::CVehicleSimul_DiffDriven::setV ( double  v)
inline

Definition at line 38 of file CVehicleSimul_DiffDriven.h.

References m_v.

◆ setW()

void mrpt::kinematics::CVehicleSimul_DiffDriven::setW ( double  w)
inline

Definition at line 39 of file CVehicleSimul_DiffDriven.h.

References m_w.

◆ simulateOneTimeStep()

void CVehicleSimulVirtualBase::simulateOneTimeStep ( const double  dt)
inherited

Member Data Documentation

◆ cDELAY

double mrpt::kinematics::CVehicleSimul_DiffDriven::cDELAY {.0}
private

The delay constant for the velocities changes.

Definition at line 81 of file CVehicleSimul_DiffDriven.h.

Referenced by internal_simulControlStep(), and setDelayModelParams().

◆ Command_Time

double mrpt::kinematics::CVehicleSimul_DiffDriven::Command_Time {0}
private

Dynamic limitations of the robot.

Approximation to non-infinity motor forces: A first order low-pass filter, using: Command_Time: Time "t" when the last order was received. Command_v, Command_w: The user-desired velocities. Command_v0, Command_w0: Actual robot velocities at the moment of user request.

Definition at line 74 of file CVehicleSimul_DiffDriven.h.

Referenced by internal_clear(), internal_simulControlStep(), and movementCommand().

◆ Command_v

double mrpt::kinematics::CVehicleSimul_DiffDriven::Command_v {0}
private

◆ Command_v0

double mrpt::kinematics::CVehicleSimul_DiffDriven::Command_v0 {0}
private

Definition at line 74 of file CVehicleSimul_DiffDriven.h.

Referenced by internal_simulControlStep(), and movementCommand().

◆ Command_w

double mrpt::kinematics::CVehicleSimul_DiffDriven::Command_w {0}
private

◆ Command_w0

double mrpt::kinematics::CVehicleSimul_DiffDriven::Command_w0 {0}
private

Definition at line 75 of file CVehicleSimul_DiffDriven.h.

Referenced by internal_simulControlStep(), and movementCommand().

◆ cTAU

double mrpt::kinematics::CVehicleSimul_DiffDriven::cTAU {.0}
private

The time-constants for the first order low-pass filter for the velocities changes.

Definition at line 79 of file CVehicleSimul_DiffDriven.h.

Referenced by internal_simulControlStep(), and setDelayModelParams().

◆ m_Aphi_err_bias

double mrpt::kinematics::CVehicleSimulVirtualBase::m_Aphi_err_bias
protectedinherited

◆ m_Aphi_err_std

double mrpt::kinematics::CVehicleSimulVirtualBase::m_Aphi_err_std
protectedinherited

◆ m_Ax_err_bias

double mrpt::kinematics::CVehicleSimulVirtualBase::m_Ax_err_bias
protectedinherited

◆ m_Ax_err_std

double mrpt::kinematics::CVehicleSimulVirtualBase::m_Ax_err_std
protectedinherited

◆ m_Ay_err_bias

double mrpt::kinematics::CVehicleSimulVirtualBase::m_Ay_err_bias
protectedinherited

◆ m_Ay_err_std

double mrpt::kinematics::CVehicleSimulVirtualBase::m_Ay_err_std
protectedinherited

◆ m_firmware_control_period

double mrpt::kinematics::CVehicleSimulVirtualBase::m_firmware_control_period {500e-6}
protectedinherited

The period at which the low-level controller updates velocities (Default: 0.5 ms)

Definition at line 128 of file CVehicleSimulVirtualBase.h.

Referenced by mrpt::kinematics::CVehicleSimulVirtualBase::simulateOneTimeStep().

◆ m_GT_pose

mrpt::math::TPose2D mrpt::kinematics::CVehicleSimulVirtualBase::m_GT_pose
protectedinherited

◆ m_GT_vel

mrpt::math::TTwist2D mrpt::kinematics::CVehicleSimulVirtualBase::m_GT_vel
protectedinherited

◆ m_odometric_vel

mrpt::math::TTwist2D mrpt::kinematics::CVehicleSimulVirtualBase::m_odometric_vel
protectedinherited

◆ m_odometry

mrpt::math::TPose2D mrpt::kinematics::CVehicleSimulVirtualBase::m_odometry
protectedinherited

◆ m_time

double mrpt::kinematics::CVehicleSimulVirtualBase::m_time
protectedinherited

◆ m_use_odo_error

bool mrpt::kinematics::CVehicleSimulVirtualBase::m_use_odo_error {false}
protectedinherited

◆ m_v

double mrpt::kinematics::CVehicleSimul_DiffDriven::m_v {0}
private

lin & angular velocity in the robot local frame.

Definition at line 64 of file CVehicleSimul_DiffDriven.h.

Referenced by getV(), internal_clear(), internal_simulControlStep(), movementCommand(), and setV().

◆ m_w

double mrpt::kinematics::CVehicleSimul_DiffDriven::m_w {0}
private



Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sun Jul 19 15:15:43 UTC 2020