Controller is the abstract class inherited by all the implemented controllers.
More...
#include <controller.hpp>
Controller is the abstract class inherited by all the implemented controllers.
It declares the abstract methods needed by the ROS node for the control to work. Most of fields and methods were initially defined in ROS node.
- Since
- 0.3.0
Definition at line 28 of file controller.hpp.
Controller::Controller |
( |
const MotionModel & |
model, |
|
|
const double & |
ts |
|
) |
| |
|
inlineprotected |
This constructor (for the inheriting controllers) sets the motion model to the given one.
- Parameters
-
model | the motion model, |
ts | the time step of the controller. |
- Warning
- The time step should be strictly positive (it is taken in absolute value, with a minimum value of 1E-9).
Definition at line 56 of file controller.hpp.
virtual Controller::~Controller |
( |
| ) |
|
|
inlinevirtual |
The destructor needs to be defined as virtual.
Definition at line 84 of file controller.hpp.
void Controller::changeFirstOdometry |
( |
| ) |
|
|
inlineprotected |
virtual void Controller::chooseVelocities |
( |
double & |
trans_vel, |
|
|
double & |
rot_vel, |
|
|
std::ostream & |
log_str |
|
) |
| |
|
pure virtual |
Computes new velocities for ROS node.
This method has to be defined by inheritors. It should use updateVelocities.
- Parameters
-
trans_vel | the translation velocity, sent by the ROS node to ROS, |
rot_vel | the rotation velocity, sent to ROS, |
log_str | the log stream, allowing to log debug data. |
Implemented in NoCtrl, FileCtrl, KbdCtrl, SmoothPathCtrl, PIDreachCtrl, PIDCtrl, AnalyticCtrl, and ImitateCtrl.
void Controller::commandsUpdated |
( |
const double & |
trans_vel, |
|
|
const double & |
rot_vel |
|
) |
| |
|
signal |
Update the display of the controller's commands.
- Parameters
-
trans_vel | the translation velocity sent to ROS, |
rot_vel | the rotation velocity sent to ROS. |
- Since
- 0.3.1
bool Controller::firstOdometry |
( |
| ) |
|
|
inlineprotected |
Are the odometry data the first?
- Returns
- Whether the odometry data will be the first or not.
Definition at line 76 of file controller.hpp.
void Controller::newState |
( |
const State & |
state | ) |
|
|
virtual |
Handles new state of the robot.
- Parameters
-
state | the new state of the robot, from odometry. |
This method can be overwritten by inheritors.
Reimplemented in TrackingCtrl, and ReachingCtrl.
Definition at line 16 of file controller.cpp.
void Controller::stateUpdated |
( |
const State & |
state | ) |
|
|
signal |
Update the display of the state.
- Parameters
-
state | The state of the robot. |
- Since
- 0.3.1
void Controller::stopMotion |
( |
| ) |
|
|
inline |
Stops the robot (i.e. sets both velocities to zero).
- Since
- 0.2.1
Definition at line 99 of file controller.hpp.
const double& Controller::timeStep |
( |
| ) |
const |
|
inline |
Stops the robot (i.e. sets both velocities to zero).
- Since
- 0.2.1
Definition at line 88 of file controller.hpp.
void Controller::updateVelocities |
( |
double & |
trans_vel, |
|
|
double & |
rot_vel |
|
) |
| |
|
inlineprotected |
bool Controller::first_odometry |
|
private |
double Controller::initial_date |
|
protected |
The first date of the odometry.
- Since
- 0.3.1
Definition at line 42 of file controller.hpp.
The model of the motion.
- Since
- 0.2.2
Definition at line 36 of file controller.hpp.
double Controller::moving_velocity |
|
protected |
Translation velocity desired for the robot.
- Since
- 0.2.0
Definition at line 45 of file controller.hpp.
const double Controller::time_step |
|
protected |
The time step of the controller.
- Since
- 0.3.0
Definition at line 39 of file controller.hpp.
double Controller::turning_velocity |
|
protected |
Rotation velocity desired for the robot.
- Since
- 0.2.0
Definition at line 47 of file controller.hpp.
The documentation for this class was generated from the following files: