10 #ifndef QTCTRL_FILE_CTRL 11 #define QTCTRL_FILE_CTRL 32 {
return (input != NULL) && ( input->is_open() ); }
37 {
return (input != NULL) && ( input->eof() ); }
51 const char* input_file_name = NULL)
52 :
Controller(model, ts), input( input_file_name == NULL ? NULL :
53 new std::ifstream(input_file_name)
66 input =
new std::ifstream(input_file_name);
71 std::ostream& log_str);
75 #endif // QTCTRL_FILE_CTRL bool inputEnded() const
Is the input stream at its end?
Controller is the abstract class inherited by all the implemented controllers.
void chooseVelocities(double &trans_vel, double &rot_vel, std::ostream &log_str)
Computes new velocities for ROS node.
void inputEnd()
Close and terminate the input stream.
bool inputOK() const
Is the input stream OK for reading?
virtual ~FileCtrl()
The destructor closes the input stream, if any.
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.
This class defines a motion model, with the motion limits.
FileCtrl allows to control the robot from a file.
void setInput(const char *input_file_name)
Change the input stream to a new file.
std::ifstream * input
The input stream, if any.
Controller abstract class.