10 #ifndef QTCTRL_KEYBOARD_CTRL 11 #define QTCTRL_KEYBOARD_CTRL 57 void acc(
const int transFact,
const int rotFact) {
58 turning_factor = (rotFact > 1 ? 1 : rotFact < -1 ? -1 : rotFact);
59 moving_factor = (transFact > 1 ? 1 : transFact < -1 ? -1
65 std::ostream& log_str) {
68 moving_factor, turning_factor,
time_step);
76 #endif // QTCTRL_KEYBOARD_CTRL Controller is the abstract class inherited by all the implemented controllers.
double turning_factor
Increment factor of rotation velocity, in [-1, 1].
KbdCtrl allows to control the robot with the keyboard.
const double time_step
The time step of the controller.
double moving_velocity
Translation velocity desired for the robot.
void applyAccelerationFactors(double &trans_vel, double &rot_vel, const double &trans_fact, const double &rot_fact, const double &time_step) const
Modify translation and rotation given velocities, applying the extremal accelerations multiplied by t...
void stopTranslation()
Stops the robot's translation.
void acc(const int transFact, const int rotFact)
Changes both velocities (translation and rotation) by adding or removing the related increment (accel...
KbdCtrl(const MotionModel &model, const double &ts)
The constructor needs a motion model.
void updateVelocities(double &trans_vel, double &rot_vel)
Update the velocities from the fields and send the update signal.
const MotionModel & motion_model
The model of the motion.
void chooseVelocities(double &trans_vel, double &rot_vel, std::ostream &log_str)
Computes new velocities for ROS node.
virtual ~KbdCtrl()
The destructor needs to be explicitely redefined.
double turning_velocity
Rotation velocity desired for the robot.
This class defines a motion model, with the motion limits.
double moving_factor
Increment factor of translation velocity, in [-1, 1].
Controller abstract class.
void stopRotation()
Stops the robot's rotation.