9#ifndef CRobotSimulator_H
10#define CRobotSimulator_H
93 cDELAY = CMD_delay_sec;
101 double Ax_err_bias = 1e-6,
102 double Ax_err_std = 10e-6,
103 double Ay_err_bias = 1e-6,
104 double Ay_err_std = 10e-6,
105 double Aphi_err_bias =
DEG2RAD(1e-6),
106 double Aphi_err_std =
DEG2RAD(10e-6)
109 usar_error_odometrico=enabled;
110 m_Ax_err_bias=Ax_err_bias;
111 m_Ax_err_std=Ax_err_std;
112 m_Ay_err_bias=Ay_err_bias;
113 m_Ay_err_std=Ay_err_std;
114 m_Aphi_err_bias=Aphi_err_bias;
115 m_Aphi_err_std=Aphi_err_std;
124 double getX()
const {
return m_pose.
x(); }
128 double getY() {
return m_pose.
y(); }
148 void setV(
double v) { this->v=v; }
149 void setW(
double w) { this->w=w; }
A class used to store a 2D pose.
const double & phi() const
Get the phi angle of the 2D pose (in radians)
double x() const
Common members of all points & poses classes.
This class can be used to simulate the kinematics and dynamics of a differential driven planar mobile...
void movementCommand(double lin_vel, double ang_vel)
Used to command the robot a desired movement (velocities)
double getT()
Read the instantaneous, error-free status of the simulated robot.
void getOdometry(mrpt::poses::CPose2D &pose) const
Reads the simulated robot odometry (this is NOT equal to the actual error-free robot coordinates).
bool usar_error_odometrico
Whether to corrupt odometry with noise
void resetOdometry(const mrpt::poses::CPose2D &newOdo=mrpt::poses::CPose2D())
Forces odometry to be set to a specified values.
double Command_Time
Dynamic limitations of the robot.
double getV()
Read the instantaneous, error-free status of the simulated robot.
double getW()
Read the instantaneous, error-free status of the simulated robot.
void simulateInterval(double At)
This method must be called periodically to simulate discrete time intervals.
float cTAU
The time-constants for the first order low-pass filter for the velocities changes.
CRobotSimulator(float TAU=0, float DELAY=0)
Constructor with default dynamic model-parameters.
double getY()
Read the instantaneous, error-free status of the simulated robot.
double w
Instantaneous velocity of the robot (angular, rad/s)
virtual ~CRobotSimulator()
Destructor.
double v
Instantaneous velocity of the robot (linear, m/s)
void resetTime()
Reset time counter.
double t
Simulation time variable.
mrpt::poses::CPose2D m_odometry
Used to simulate odometry (with optional error)
void resetStatus()
Reset all the simulator variables to 0 (All but current simulator time).
void setV(double v)
Set actual robot pose (inmediately, without simulating the movement along time) (Not to be called nor...
double getPHI()
Read the instantaneous, error-free status of the simulated robot.
void getRealPose(mrpt::poses::CPose2D &pose) const
Reads the real robot pose.
void getRealPose(mrpt::math::TPose2D &pose) const
Reads the real robot pose.
double getX() const
Read the instantaneous, error-free status of the simulated robot.
void getOdometry(mrpt::math::TPose2D &pose) const
Reads the simulated robot odometry (this is NOT equal to the actual error-free robot coordinates).
float cDELAY
The delay constant for the velocities changes.
void setDelayModelParams(float TAU_delay_sec=1.8f, float CMD_delay_sec=0.3f)
Change the model of delays used for the orders sent to the robot.
void setRealPose(const mrpt::poses::CPose2D &p)
Reset actual robot pose (inmediately, without simulating the movement along time)
mrpt::poses::CPose2D m_pose
Global, absolute and error-free robot coordinates.
void setOdometryErrors(bool enabled, double Ax_err_bias=1e-6, double Ax_err_std=10e-6, double Ay_err_bias=1e-6, double Ay_err_std=10e-6, double Aphi_err_bias=DEG2RAD(1e-6), double Aphi_err_std=DEG2RAD(10e-6))
Enable/Disable odometry errors Errors in odometry are introduced per millisecond.
EIGEN_STRONG_INLINE const AdjointReturnType t() const
Transpose.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.