MRPT
2.0.3
|
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 32 of file CVehicleSimulVirtualBase.h.
#include <mrpt/kinematics/CVehicleSimulVirtualBase.h>
Public Member Functions | |
CVehicleSimulVirtualBase () | |
virtual | ~CVehicleSimulVirtualBase () |
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 {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 |
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 CVehicleVelCmd::Ptr | 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::DEG2RAD(1e-3), double Aphi_err_std=mrpt::DEG2RAD(10e-3)) |
Enable/Disable odometry errors. More... | |
void | resetStatus () |
void | resetTime () |
Reset all simulator variables to 0 (except the. More... | |
|
default |
|
virtualdefault |
|
inline |
Returns the instantaneous, ground truth pose in world coordinates.
Definition at line 45 of file CVehicleSimulVirtualBase.h.
References m_GT_pose.
Referenced by mrpt::nav::CRobot2NavInterfaceForSimulator_Holo::getCurrentPoseAndSpeeds(), mrpt::nav::CRobot2NavInterfaceForSimulator_DiffDriven::getCurrentPoseAndSpeeds(), and run_rnav_test().
|
inline |
Returns the instantaneous, ground truth velocity vector (vx,vy,omega) in world coordinates.
Definition at line 64 of file CVehicleSimulVirtualBase.h.
References m_GT_vel.
Referenced by mrpt::nav::CRobot2NavInterfaceForSimulator_Holo::getCurrentPoseAndSpeeds(), and mrpt::nav::CRobot2NavInterfaceForSimulator_DiffDriven::getCurrentPoseAndSpeeds().
mrpt::math::TTwist2D CVehicleSimulVirtualBase::getCurrentGTVelLocal | ( | ) | const |
Returns the instantaneous, ground truth velocity vector (vx,vy,omega) in the robot local frame.
Definition at line 83 of file CVehicleSimulVirtualBase.cpp.
References m_GT_pose, m_GT_vel, mrpt::math::TPose2D::phi, and mrpt::math::TTwist2D::rotate().
|
inline |
Returns the current pose according to (noisy) odometry.
Definition at line 51 of file CVehicleSimulVirtualBase.h.
References m_odometry.
Referenced by mrpt::nav::CRobot2NavInterfaceForSimulator_Holo::getCurrentPoseAndSpeeds(), and mrpt::nav::CRobot2NavInterfaceForSimulator_DiffDriven::getCurrentPoseAndSpeeds().
|
inline |
Returns the instantaneous, odometric velocity vector (vx,vy,omega) in world coordinates.
Definition at line 71 of file CVehicleSimulVirtualBase.h.
References m_odometric_vel.
mrpt::math::TTwist2D CVehicleSimulVirtualBase::getCurrentOdometricVelLocal | ( | ) | const |
Returns the instantaneous, odometric velocity vector (vx,vy,omega) in the robot local frame.
Definition at line 90 of file CVehicleSimulVirtualBase.cpp.
References m_odometric_vel, m_odometry, mrpt::math::TPose2D::phi, and mrpt::math::TTwist2D::rotate().
Referenced by simulateOneTimeStep().
|
inline |
Get the current simulation time.
Definition at line 80 of file CVehicleSimulVirtualBase.h.
References m_time.
Referenced by mrpt::nav::CRobot2NavInterfaceForSimulator_Holo::getNavigationTime(), mrpt::nav::CRobot2NavInterfaceForSimulator_DiffDriven::getNavigationTime(), 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.
Referenced by resetStatus().
|
protectedpure virtual |
Implemented in mrpt::kinematics::CVehicleSimul_DiffDriven, and mrpt::kinematics::CVehicleSimul_Holo.
Referenced by simulateOneTimeStep().
void CVehicleSimulVirtualBase::resetStatus | ( | ) |
Definition at line 73 of file CVehicleSimulVirtualBase.cpp.
References internal_clear(), m_GT_pose, m_GT_vel, m_odometric_vel, and m_odometry.
Referenced by mrpt::kinematics::CVehicleSimul_DiffDriven::CVehicleSimul_DiffDriven(), and mrpt::kinematics::CVehicleSimul_Holo::CVehicleSimul_Holo().
void CVehicleSimulVirtualBase::resetTime | ( | ) |
Reset all simulator variables to 0 (except the.
simulation time).
Definition at line 82 of file CVehicleSimulVirtualBase.cpp.
References m_time.
Referenced by mrpt::kinematics::CVehicleSimul_DiffDriven::CVehicleSimul_DiffDriven(), and mrpt::kinematics::CVehicleSimul_Holo::CVehicleSimul_Holo().
|
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 CVehicleSimulVirtualBase::setCurrentGTPose | ( | const mrpt::math::TPose2D & | pose | ) |
Brute-force move robot to target coordinates ("teleport")
Definition at line 21 of file CVehicleSimulVirtualBase.cpp.
References m_GT_pose.
|
inline |
Brute-force overwrite robot odometry
Definition at line 57 of file CVehicleSimulVirtualBase.h.
References m_odometry.
|
inline |
Enable/Disable odometry errors.
Errors in odometry are 1 sigma Gaussian values per second
Definition at line 91 of file CVehicleSimulVirtualBase.h.
References m_Aphi_err_bias, m_Aphi_err_std, m_Ax_err_bias, m_Ax_err_std, m_Ay_err_bias, m_Ay_err_std, and m_use_odo_error.
void CVehicleSimulVirtualBase::simulateOneTimeStep | ( | const double | dt | ) |
Runs the simulator during "dt" seconds.
It will be split into periods of "m_firmware_control_period".
Definition at line 26 of file CVehicleSimulVirtualBase.cpp.
References mrpt::random::CRandomGenerator::drawGaussian1D_normalized(), getCurrentOdometricVelLocal(), mrpt::random::getRandomGenerator(), internal_simulControlStep(), m_Aphi_err_bias, m_Aphi_err_std, m_Ax_err_bias, m_Ax_err_std, m_Ay_err_bias, m_Ay_err_std, m_firmware_control_period, m_GT_pose, m_GT_vel, m_odometric_vel, m_odometry, m_time, m_use_odo_error, mrpt::math::TTwist2D::omega, mrpt::math::TPose2D::phi, mrpt::math::TTwist2D::rotate(), mrpt::math::TTwist2D::vx, mrpt::math::TTwist2D::vy, mrpt::math::wrapToPiInPlace(), and mrpt::math::TPose2D::x.
Referenced by run_rnav_test().
|
protected |
Definition at line 134 of file CVehicleSimulVirtualBase.h.
Referenced by setOdometryErrors(), and simulateOneTimeStep().
|
protected |
Definition at line 134 of file CVehicleSimulVirtualBase.h.
Referenced by setOdometryErrors(), and simulateOneTimeStep().
|
protected |
Definition at line 132 of file CVehicleSimulVirtualBase.h.
Referenced by setOdometryErrors(), and simulateOneTimeStep().
|
protected |
Definition at line 132 of file CVehicleSimulVirtualBase.h.
Referenced by setOdometryErrors(), and simulateOneTimeStep().
|
protected |
Definition at line 133 of file CVehicleSimulVirtualBase.h.
Referenced by setOdometryErrors(), and simulateOneTimeStep().
|
protected |
Definition at line 133 of file CVehicleSimulVirtualBase.h.
Referenced by setOdometryErrors(), and simulateOneTimeStep().
|
protected |
The period at which the low-level controller updates velocities (Default: 0.5 ms)
Definition at line 128 of file CVehicleSimulVirtualBase.h.
Referenced by simulateOneTimeStep().
|
protected |
ground truth pose in world coordinates.
Definition at line 119 of file CVehicleSimulVirtualBase.h.
Referenced by getCurrentGTPose(), getCurrentGTVelLocal(), resetStatus(), setCurrentGTPose(), and simulateOneTimeStep().
|
protected |
Velocity in (x,y,omega)
Definition at line 121 of file CVehicleSimulVirtualBase.h.
Referenced by getCurrentGTVel(), getCurrentGTVelLocal(), resetStatus(), and simulateOneTimeStep().
|
protected |
Velocity in (x,y,omega)
Definition at line 123 of file CVehicleSimulVirtualBase.h.
Referenced by getCurrentOdometricVel(), getCurrentOdometricVelLocal(), mrpt::kinematics::CVehicleSimul_Holo::internal_simulControlStep(), mrpt::kinematics::CVehicleSimul_DiffDriven::internal_simulControlStep(), resetStatus(), mrpt::kinematics::CVehicleSimul_Holo::sendVelRampCmd(), and simulateOneTimeStep().
|
protected |
Definition at line 124 of file CVehicleSimulVirtualBase.h.
Referenced by getCurrentOdometricPose(), getCurrentOdometricVelLocal(), mrpt::kinematics::CVehicleSimul_Holo::internal_simulControlStep(), mrpt::kinematics::CVehicleSimul_DiffDriven::internal_simulControlStep(), resetStatus(), mrpt::kinematics::CVehicleSimul_Holo::sendVelCmd(), setCurrentOdometricPose(), and simulateOneTimeStep().
|
protected |
simulation running time
Definition at line 117 of file CVehicleSimulVirtualBase.h.
Referenced by getTime(), mrpt::kinematics::CVehicleSimul_Holo::internal_simulControlStep(), mrpt::kinematics::CVehicleSimul_DiffDriven::internal_simulControlStep(), mrpt::kinematics::CVehicleSimul_DiffDriven::movementCommand(), resetTime(), mrpt::kinematics::CVehicleSimul_Holo::sendVelRampCmd(), and simulateOneTimeStep().
|
protected |
Whether to corrupt odometry with noise.
Definition at line 131 of file CVehicleSimulVirtualBase.h.
Referenced by setOdometryErrors(), and simulateOneTimeStep().
Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 15 15:49:54 UTC 2020 |