FileCtrl allows to control the robot from a file.
More...
#include <file.hpp>
|
void | chooseVelocities (double &trans_vel, double &rot_vel, std::ostream &log_str) |
| Computes new velocities for ROS node. More...
|
|
| FileCtrl (const MotionModel &model, const double &ts, const char *input_file_name=NULL) |
| The constructor needs a motion model and an optional input file name. More...
|
|
void | setInput (const char *input_file_name) |
| Change the input stream to a new file. More...
|
|
virtual | ~FileCtrl () |
| The destructor closes the input stream, if any. More...
|
|
virtual void | newState (const State &state) |
| Handles new state of the robot. More...
|
|
void | stopMotion () |
| Stops the robot (i.e. sets both velocities to zero). More...
|
|
const double & | timeStep () const |
| Stops the robot (i.e. sets both velocities to zero). More...
|
|
virtual | ~Controller () |
| The destructor needs to be defined as virtual. More...
|
|
FileCtrl allows to control the robot from a file.
Most of fields and methods were initially defined in ROS node.
- Since
- 0.3.0
Definition at line 25 of file file.hpp.
FileCtrl::FileCtrl |
( |
const MotionModel & |
model, |
|
|
const double & |
ts, |
|
|
const char * |
input_file_name = NULL |
|
) |
| |
|
inline |
The constructor needs a motion model and an optional input file name.
- Parameters
-
model | the motion model, |
ts | the time step of the controller, |
input_file_name | the input file name. |
- See also
- Controller(const MotionModel&)
Definition at line 50 of file file.hpp.
virtual FileCtrl::~FileCtrl |
( |
| ) |
|
|
inlinevirtual |
The destructor closes the input stream, if any.
- Since
- 0.2.4
Definition at line 60 of file file.hpp.
void FileCtrl::chooseVelocities |
( |
double & |
trans_vel, |
|
|
double & |
rot_vel, |
|
|
std::ostream & |
log_str |
|
) |
| |
|
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. |
Implements Controller.
Reimplemented in PIDCtrl, and ImitateCtrl.
Definition at line 14 of file file.cpp.
void FileCtrl::inputEnd |
( |
| ) |
|
|
inlineprotected |
Close and terminate the input stream.
- Since
- 0.2.4
Definition at line 40 of file file.hpp.
bool FileCtrl::inputEnded |
( |
| ) |
const |
|
inlineprotected |
Is the input stream at its end?
- Returns
- Yes if at the end, no otherwise.
- Since
- 0.3.1
Definition at line 36 of file file.hpp.
bool FileCtrl::inputOK |
( |
| ) |
const |
|
inlineprotected |
Is the input stream OK for reading?
- Returns
- Yes if OK, no otherwise.
- Since
- 0.2.4
Definition at line 31 of file file.hpp.
void FileCtrl::setInput |
( |
const char * |
input_file_name | ) |
|
|
inline |
Change the input stream to a new file.
- Parameters
-
input_file_name | The input file name. |
- Since
- 0.2.4
Definition at line 64 of file file.hpp.
std::ifstream* FileCtrl::input |
|
protected |
The input stream, if any.
- Since
- 0.2.4
Definition at line 27 of file file.hpp.
The documentation for this class was generated from the following files: