10 #ifndef QTCTRL_CONTROLLER 11 #define QTCTRL_CONTROLLER 57 : first_odometry(true), motion_model(model),
58 time_step( fabs(ts) >= 1E-9 ? fabs(ts) : 1E-9 ) {}
99 void stopMotion() { moving_velocity = turning_velocity = 0; }
112 std::ostream& log_str) = 0;
126 const double& rot_vel);
148 #endif // QTCTRL_CONTROLLER void changeFirstOdometry()
Change the odometry data status (first or not).
void stopMotion()
Stops the robot (i.e. sets both velocities to zero).
Controller is the abstract class inherited by all the implemented controllers.
void commandsUpdated(const double &trans_vel, const double &rot_vel)
Update the display of the controller's commands.
State class, i.e. configuration and velocities.
virtual ~NoCtrl()
The destructor needs to be explicitely redefined.
void stateUpdated(const State &state)
Update the display of the state.
const double time_step
The time step of the controller.
Controller(const MotionModel &model, const double &ts)
This constructor (for the inheriting controllers) sets the motion model to the given one...
Default controller, which does not move.
double moving_velocity
Translation velocity desired for the robot.
NoCtrl(const MotionModel &model)
The constructor only sets the motion model.
void updateVelocities(double &trans_vel, double &rot_vel)
Update the velocities from the fields and send the update signal.
double initial_date
The first date of the odometry.
const MotionModel & motion_model
The model of the motion.
virtual void newState(const State &state)
Handles new state of the robot.
const double & timeStep() const
Stops the robot (i.e. sets both velocities to zero).
This class defines a state, i.e. a configuration and its (translation and rotation) velocities...
void chooseVelocities(double &trans_vel, double &rot_vel, std::ostream &)
Computes new velocities for ROS node.
double turning_velocity
Rotation velocity desired for the robot.
This class defines a motion model, with the motion limits.
virtual void chooseVelocities(double &trans_vel, double &rot_vel, std::ostream &log_str)=0
Computes new velocities for ROS node.
Motion model for qt_ctrl.
virtual ~Controller()
The destructor needs to be defined as virtual.
bool first_odometry
Are the odometry data the first?
bool firstOdometry()
Are the odometry data the first?