Public Member Functions | Private Attributes | List of all members
KbdCtrl Class Reference

KbdCtrl allows to control the robot with the keyboard. More...

#include <keyboard.hpp>

Inheritance diagram for KbdCtrl:
Inheritance graph
[legend]

Public Member Functions

void acc (const int transFact, const int rotFact)
 Changes both velocities (translation and rotation) by adding or removing the related increment (acceleration times loop duration). More...
 
void chooseVelocities (double &trans_vel, double &rot_vel, std::ostream &log_str)
 Computes new velocities for ROS node. More...
 
 KbdCtrl (const MotionModel &model, const double &ts)
 The constructor needs a motion model. More...
 
void stopRotation ()
 Stops the robot's rotation. More...
 
void stopTranslation ()
 Stops the robot's translation. More...
 
virtual ~KbdCtrl ()
 The destructor needs to be explicitely redefined. More...
 
- Public Member Functions inherited from Controller
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...
 

Private Attributes

double moving_factor
 Increment factor of translation velocity, in [-1, 1]. More...
 
double turning_factor
 Increment factor of rotation velocity, in [-1, 1]. More...
 

Additional Inherited Members

- Signals inherited from Controller
void commandsUpdated (const double &trans_vel, const double &rot_vel)
 Update the display of the controller's commands. More...
 
void stateUpdated (const State &state)
 Update the display of the state. More...
 
- Protected Member Functions inherited from Controller
void changeFirstOdometry ()
 Change the odometry data status (first or not). More...
 
 Controller (const MotionModel &model, const double &ts)
 This constructor (for the inheriting controllers) sets the motion model to the given one. More...
 
bool firstOdometry ()
 Are the odometry data the first? More...
 
void updateVelocities (double &trans_vel, double &rot_vel)
 Update the velocities from the fields and send the update signal. More...
 
- Protected Attributes inherited from Controller
double initial_date
 The first date of the odometry. More...
 
const MotionModelmotion_model
 The model of the motion. More...
 
double moving_velocity
 Translation velocity desired for the robot. More...
 
const double time_step
 The time step of the controller. More...
 
double turning_velocity
 Rotation velocity desired for the robot. More...
 

Detailed Description

KbdCtrl allows to control the robot with the keyboard.

Most of fields and methods were initially defined in ROS node.

Since
0.3.0

Definition at line 23 of file keyboard.hpp.

Constructor & Destructor Documentation

KbdCtrl::KbdCtrl ( const MotionModel model,
const double &  ts 
)
inline

The constructor needs a motion model.

Parameters
modelThe motion model,
tsthe time step of the controller.
See also
Controller(const MotionModel&, const double&)

Definition at line 34 of file keyboard.hpp.

virtual KbdCtrl::~KbdCtrl ( )
inlinevirtual

The destructor needs to be explicitely redefined.

Definition at line 38 of file keyboard.hpp.

Member Function Documentation

void KbdCtrl::acc ( const int  transFact,
const int  rotFact 
)
inline

Changes both velocities (translation and rotation) by adding or removing the related increment (acceleration times loop duration).

Parameters
transFactThe translation factor multiplied to the translation increment (the factor is considered as 1 if > 1, and -1 if < -1).
rotFactThe rotation factor multiplied to the rotation increment (the factor is considered as 1 if > 1, and -1 if < -1).

Definition at line 57 of file keyboard.hpp.

void KbdCtrl::chooseVelocities ( double &  trans_vel,
double &  rot_vel,
std::ostream &  log_str 
)
inlinevirtual

Computes new velocities for ROS node.

This method has to be defined by inheritors. It should use updateVelocities.

Parameters
trans_velthe translation velocity, sent by the ROS node to ROS,
rot_velthe rotation velocity, sent to ROS,
log_strthe log stream, allowing to log debug data.

Implements Controller.

Definition at line 64 of file keyboard.hpp.

void KbdCtrl::stopRotation ( )
inline

Stops the robot's rotation.

Since
0.2.1

Definition at line 41 of file keyboard.hpp.

void KbdCtrl::stopTranslation ( )
inline

Stops the robot's translation.

Since
0.2.2

Definition at line 44 of file keyboard.hpp.

Member Data Documentation

double KbdCtrl::moving_factor
private

Increment factor of translation velocity, in [-1, 1].

Since
0.2.0

Definition at line 25 of file keyboard.hpp.

double KbdCtrl::turning_factor
private

Increment factor of rotation velocity, in [-1, 1].

Since
0.2.0

Definition at line 27 of file keyboard.hpp.


The documentation for this class was generated from the following file:


qt_ctrl
Author(s): Alexis Scheuer
autogenerated on Wed Dec 16 2020 15:51:32