This class can be used to simulate the kinematics and dynamics of a differential driven planar mobile robot, including odometry errors and dynamics limitations.
Main API methods are:
Definition at line 30 of file CVehicleSimulVirtualBase.h.
#include <mrpt/kinematics/CVehicleSimulVirtualBase.h>
Public Member Functions | |
CVehicleSimulVirtualBase () | |
virtual | ~CVehicleSimulVirtualBase () |
Kinematic simulation and control interface | |
void | simulateOneTimeStep (const double dt) |
Runs the simulator during "dt" seconds. More... | |
const mrpt::math::TPose2D & | getCurrentGTPose () 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::TPose2D & | getCurrentOdometricPose () 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::TTwist2D & | getCurrentGTVel () 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::TTwist2D & | getCurrentOdometricVel () 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... | |
virtual void | sendVelCmd (const CVehicleVelCmd &cmd_vel)=0 |
Sends a velocity command to the robot. More... | |
virtual CVehicleVelCmdPtr | getVelCmdType () const =0 |
Gets an empty velocity command object that can be queried to find out the number of velcmd components,... 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 Member Functions | |
virtual void | internal_simulControlStep (const double dt)=0 |
virtual void | internal_clear ()=0 |
Resets all pending cmds. 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 |
mrpt::kinematics::CVehicleSimulVirtualBase::CVehicleSimulVirtualBase | ( | ) |
|
virtual |
|
inline |
Returns the instantaneous, ground truth pose in world coordinates.
Definition at line 42 of file CVehicleSimulVirtualBase.h.
Referenced by mrpt::nav::CRobot2NavInterfaceForSimulator_Holo::getCurrentPoseAndSpeeds(), mrpt::nav::CRobot2NavInterfaceForSimulator_DiffDriven::getCurrentPoseAndSpeeds(), mrpt::utils::CRobotSimulator::getPHI(), mrpt::utils::CRobotSimulator::getRealPose(), mrpt::utils::CRobotSimulator::getX(), and mrpt::utils::CRobotSimulator::getY().
|
inline |
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 |
Returns the instantaneous, ground truth velocity vector (vx,vy,omega) in the robot local frame.
|
inline |
Returns the current pose according to (noisy) odometry.
Definition at line 48 of file CVehicleSimulVirtualBase.h.
Referenced by mrpt::nav::CRobot2NavInterfaceForSimulator_Holo::getCurrentPoseAndSpeeds(), mrpt::nav::CRobot2NavInterfaceForSimulator_DiffDriven::getCurrentPoseAndSpeeds(), and mrpt::utils::CRobotSimulator::getOdometry().
|
inline |
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 |
Returns the instantaneous, odometric velocity vector (vx,vy,omega) in the robot local frame.
|
inline |
Get the current simulation time.
Definition at line 65 of file CVehicleSimulVirtualBase.h.
Referenced by mrpt::nav::CRobot2NavInterfaceForSimulator_Holo::getNavigationTime(), mrpt::nav::CRobot2NavInterfaceForSimulator_DiffDriven::getNavigationTime(), mrpt::utils::CRobotSimulator::getT(), mrpt::nav::CRobot2NavInterfaceForSimulator_Holo::resetNavigationTimer(), and mrpt::nav::CRobot2NavInterfaceForSimulator_DiffDriven::resetNavigationTimer().
|
pure virtual |
Gets an empty velocity command object that can be queried to find out the number of velcmd components,...
Implemented in mrpt::kinematics::CVehicleSimul_DiffDriven, and mrpt::kinematics::CVehicleSimul_Holo.
|
protectedpure virtual |
Resets all pending cmds.
Implemented in mrpt::kinematics::CVehicleSimul_DiffDriven, and mrpt::kinematics::CVehicleSimul_Holo.
|
protectedpure virtual |
Implemented in mrpt::kinematics::CVehicleSimul_DiffDriven, and mrpt::kinematics::CVehicleSimul_Holo.
void mrpt::kinematics::CVehicleSimulVirtualBase::resetStatus | ( | ) |
void mrpt::kinematics::CVehicleSimulVirtualBase::resetTime | ( | ) |
Reset all simulator variables to 0 (except the simulation time).
|
pure virtual |
Sends a velocity command to the robot.
The number of components and their meaning depends on the vehicle-kinematics derived class
Implemented in mrpt::kinematics::CVehicleSimul_DiffDriven, and mrpt::kinematics::CVehicleSimul_Holo.
void mrpt::kinematics::CVehicleSimulVirtualBase::setCurrentGTPose | ( | const mrpt::math::TPose2D & | pose | ) |
Brute-force move robot to target coordinates ("teleport")
Referenced by mrpt::utils::CRobotSimulator::setRealPose().
|
inline |
Brute-force overwrite robot odometry.
Definition at line 51 of file CVehicleSimulVirtualBase.h.
Referenced by mrpt::utils::CRobotSimulator::resetOdometry(), and mrpt::utils::CRobotSimulator::setOdometry().
|
inline |
Enable/Disable odometry errors.
Errors in odometry are 1 sigma Gaussian values per second
Definition at line 74 of file CVehicleSimulVirtualBase.h.
void mrpt::kinematics::CVehicleSimulVirtualBase::simulateOneTimeStep | ( | const double | dt | ) |
Runs the simulator during "dt" seconds.
It will be split into periods of "m_firmware_control_period".
Referenced by mrpt::utils::CRobotSimulator::simulateInterval().
|
protected |
Definition at line 112 of file CVehicleSimulVirtualBase.h.
|
protected |
Definition at line 112 of file CVehicleSimulVirtualBase.h.
|
protected |
Definition at line 110 of file CVehicleSimulVirtualBase.h.
|
protected |
Definition at line 110 of file CVehicleSimulVirtualBase.h.
|
protected |
Definition at line 111 of file CVehicleSimulVirtualBase.h.
|
protected |
Definition at line 111 of file CVehicleSimulVirtualBase.h.
|
protected |
The period at which the low-level controller updates velocities (Default: 0.5 ms)
Definition at line 107 of file CVehicleSimulVirtualBase.h.
|
protected |
ground truth pose in world coordinates.
Definition at line 102 of file CVehicleSimulVirtualBase.h.
|
protected |
Velocity in (x,y,omega)
Definition at line 103 of file CVehicleSimulVirtualBase.h.
|
protected |
Velocity in (x,y,omega)
Definition at line 104 of file CVehicleSimulVirtualBase.h.
|
protected |
Definition at line 105 of file CVehicleSimulVirtualBase.h.
|
protected |
simulation running time
Definition at line 101 of file CVehicleSimulVirtualBase.h.
|
protected |
Whether to corrupt odometry with noise.
Definition at line 109 of file CVehicleSimulVirtualBase.h.
Page generated by Doxygen 1.8.13 for MRPT 1.5.3 at Sun Nov 26 00:44:48 UTC 2017 |