Main MRPT website > C++ reference for MRPT 1.5.0
List of all members | Public Types | Public Member Functions | Protected Attributes
mrpt::utils::CRobotSimulator Class Reference

Detailed Description

Definition at line 17 of file CRobotSimulator.h.

#include <mrpt/utils/CRobotSimulator.h>

Inheritance diagram for mrpt::utils::CRobotSimulator:
Inheritance graph
[legend]
Collaboration diagram for mrpt::utils::CRobotSimulator:
Collaboration graph
[legend]

Public Types

typedef CVehicleVelCmd_DiffDriven kinematic_cmd_t
 

Public Member Functions

 CRobotSimulator (float TAU=0, float DELAY=0)
 
void getOdometry (poses::CPose2D &pose) const
 
void getRealPose (poses::CPose2D &pose) const
 
void getOdometry (math::TPose2D &pose) const
 
void getRealPose (math::TPose2D &pose) const
 
void setOdometry (const math::TPose2D &pose)
 
void setRealPose (const math::TPose2D &pose)
 
double getX () const
 
double getY () const
 
double getPHI () const
 
double getT () const
 
void simulateInterval (double At)
 
void resetOdometry (const poses::CPose2D pose=poses::CPose2D())
 
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) MRPT_OVERRIDE
 Sends a velocity command to the robot. More...
 
CVehicleVelCmdPtr getVelCmdType () const MRPT_OVERRIDE
 Gets an empty velocity command object that can be queried to find out the number of velcmd components,... More...
 
Kinematic simulation and control interface
void simulateOneTimeStep (const double dt)
 Runs the simulator during "dt" seconds. More...
 
const mrpt::math::TPose2DgetCurrentGTPose () const
 Returns the instantaneous, ground truth pose in world coordinates. More...
 
void setCurrentGTPose (const mrpt::math::TPose2D &pose)
 Brute-force move robot to target coordinates ("teleport") More...
 
const mrpt::math::TPose2DgetCurrentOdometricPose () const
 Returns the current pose according to (noisy) odometry. More...
 
template<typename T >
void setCurrentOdometricPose (const T &pose)
 Brute-force overwrite robot odometry. More...
 
const mrpt::math::TTwist2DgetCurrentGTVel () const
 Returns the instantaneous, ground truth velocity vector (vx,vy,omega) in world coordinates. More...
 
mrpt::math::TTwist2D getCurrentGTVelLocal () const
 Returns the instantaneous, ground truth velocity vector (vx,vy,omega) in the robot local frame. More...
 
const mrpt::math::TTwist2DgetCurrentOdometricVel () const
 Returns the instantaneous, odometric velocity vector (vx,vy,omega) in world coordinates. More...
 
mrpt::math::TTwist2D getCurrentOdometricVelLocal () const
 Returns the instantaneous, odometric velocity vector (vx,vy,omega) in the robot local frame. More...
 
double getTime () const
 Get the current simulation time. More...
 
void 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::utils::DEG2RAD(1e-3), double Aphi_err_std=mrpt::utils::DEG2RAD(10e-3))
 Enable/Disable odometry errors. More...
 
void resetStatus ()
 
void resetTime ()
 Reset all simulator variables to 0 (except the simulation time). More...
 

Protected Attributes

double m_firmware_control_period
 The period at which the low-level controller updates velocities (Default: 0.5 ms) More...
 
bool m_use_odo_error
 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
 
State vector
double m_time
 simulation running time More...
 
mrpt::math::TPose2D m_GT_pose
 ground truth pose in world coordinates. More...
 
mrpt::math::TTwist2D m_GT_vel
 Velocity in (x,y,omega) More...
 
mrpt::math::TTwist2D m_odometric_vel
 Velocity in (x,y,omega) More...
 
mrpt::math::TPose2D m_odometry
 

Member Typedef Documentation

typedef CVehicleVelCmd_DiffDriven mrpt::kinematics::CVehicleSimul_DiffDriven::kinematic_cmd_t
inherited

Definition at line 25 of file CVehicleSimul_DiffDriven.h.

Constructor & Destructor Documentation

mrpt::utils::CRobotSimulator::CRobotSimulator ( float  TAU = 0,
float  DELAY = 0 
)
inline

Member Function Documentation

const mrpt::math::TPose2D& mrpt::kinematics::CVehicleSimulVirtualBase::getCurrentGTPose ( ) const
inlineinherited
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 54 of file CVehicleSimulVirtualBase.h.

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

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

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

const mrpt::math::TPose2D& mrpt::kinematics::CVehicleSimulVirtualBase::getCurrentOdometricPose ( ) const
inlineinherited
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 59 of file CVehicleSimulVirtualBase.h.

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

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

void mrpt::utils::CRobotSimulator::getOdometry ( poses::CPose2D pose) const
inline
void mrpt::utils::CRobotSimulator::getOdometry ( math::TPose2D pose) const
inline
double mrpt::utils::CRobotSimulator::getPHI ( ) const
inline
void mrpt::utils::CRobotSimulator::getRealPose ( poses::CPose2D pose) const
inline
void mrpt::utils::CRobotSimulator::getRealPose ( math::TPose2D pose) const
inline
double mrpt::utils::CRobotSimulator::getT ( ) const
inline
double mrpt::kinematics::CVehicleSimulVirtualBase::getTime ( ) const
inlineinherited
double mrpt::kinematics::CVehicleSimul_DiffDriven::getV ( )
inlineinherited

Definition at line 39 of file CVehicleSimul_DiffDriven.h.

CVehicleVelCmdPtr mrpt::kinematics::CVehicleSimul_DiffDriven::getVelCmdType ( ) const
inlinevirtualinherited

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 53 of file CVehicleSimul_DiffDriven.h.

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

Definition at line 40 of file CVehicleSimul_DiffDriven.h.

double mrpt::utils::CRobotSimulator::getX ( ) const
inline
double mrpt::utils::CRobotSimulator::getY ( ) const
inline
void mrpt::kinematics::CVehicleSimul_DiffDriven::movementCommand ( double  lin_vel,
double  ang_vel 
)
inherited

Used to command the robot a desired movement:

Parameters
lin_velLinar velocity (m/s)
ang_velAngular velocity (rad/s)
void mrpt::utils::CRobotSimulator::resetOdometry ( const poses::CPose2D  pose = poses::CPose2D())
inline
void mrpt::kinematics::CVehicleSimulVirtualBase::resetStatus ( )
inherited
void mrpt::kinematics::CVehicleSimulVirtualBase::resetTime ( )
inherited

Reset all simulator variables to 0 (except the simulation time).

See also
resetTime Reset time counter
resetStatus
void mrpt::kinematics::CVehicleSimul_DiffDriven::sendVelCmd ( const CVehicleVelCmd cmd_vel)
inlinevirtualinherited

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 mrpt::kinematics::CVehicleVelCmd_DiffDriven::ang_vel, ASSERTMSG_, and mrpt::kinematics::CVehicleVelCmd_DiffDriven::lin_vel.

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

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

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

Referenced by setRealPose().

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

Brute-force overwrite robot odometry.

Definition at line 51 of file CVehicleSimulVirtualBase.h.

Referenced by resetOdometry(), and setOdometry().

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

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.

Referenced by CRobotSimulator().

void mrpt::utils::CRobotSimulator::setOdometry ( const math::TPose2D pose)
inline
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::utils::DEG2RAD(1e-3),
double  Aphi_err_std = mrpt::utils::DEG2RAD(10e-3) 
)
inlineinherited

Enable/Disable odometry errors.

Errors in odometry are 1 sigma Gaussian values per second

Definition at line 74 of file CVehicleSimulVirtualBase.h.

void mrpt::utils::CRobotSimulator::setRealPose ( const math::TPose2D pose)
inline
void mrpt::kinematics::CVehicleSimul_DiffDriven::setV ( double  v)
inlineinherited

Definition at line 36 of file CVehicleSimul_DiffDriven.h.

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

Definition at line 37 of file CVehicleSimul_DiffDriven.h.

void mrpt::utils::CRobotSimulator::simulateInterval ( double  At)
inline
void mrpt::kinematics::CVehicleSimulVirtualBase::simulateOneTimeStep ( const double  dt)
inherited

Runs the simulator during "dt" seconds.

It will be split into periods of "m_firmware_control_period".

Referenced by simulateInterval().

Member Data Documentation

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

Definition at line 112 of file CVehicleSimulVirtualBase.h.

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

Definition at line 112 of file CVehicleSimulVirtualBase.h.

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

Definition at line 110 of file CVehicleSimulVirtualBase.h.

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

Definition at line 110 of file CVehicleSimulVirtualBase.h.

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

Definition at line 111 of file CVehicleSimulVirtualBase.h.

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

Definition at line 111 of file CVehicleSimulVirtualBase.h.

double mrpt::kinematics::CVehicleSimulVirtualBase::m_firmware_control_period
protectedinherited

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

Definition at line 107 of file CVehicleSimulVirtualBase.h.

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

ground truth pose in world coordinates.

Definition at line 102 of file CVehicleSimulVirtualBase.h.

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

Velocity in (x,y,omega)

Definition at line 103 of file CVehicleSimulVirtualBase.h.

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

Velocity in (x,y,omega)

Definition at line 104 of file CVehicleSimulVirtualBase.h.

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

Definition at line 105 of file CVehicleSimulVirtualBase.h.

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

simulation running time

Definition at line 101 of file CVehicleSimulVirtualBase.h.

bool mrpt::kinematics::CVehicleSimulVirtualBase::m_use_odo_error
protectedinherited

Whether to corrupt odometry with noise.

Definition at line 109 of file CVehicleSimulVirtualBase.h.




Page generated by Doxygen 1.8.11 for MRPT 1.5.0 Git: 23811f3 Mon Apr 24 03:24:28 2017 +0200 at Tue Apr 25 00:00:31 CEST 2017