Signals | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
Controller Class Referenceabstract

Controller is the abstract class inherited by all the implemented controllers. More...

#include <controller.hpp>

Inheritance diagram for Controller:
Inheritance graph
[legend]

Signals

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...
 

Public Member Functions

virtual void chooseVelocities (double &trans_vel, double &rot_vel, std::ostream &log_str)=0
 Computes new velocities for ROS node. 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...
 

Protected Member Functions

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

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...
 

Private Attributes

bool first_odometry
 Are the odometry data the first? More...
 

Detailed Description

Controller is the abstract class inherited by all the implemented controllers.

It declares the abstract methods needed by the ROS node for the control to work. Most of fields and methods were initially defined in ROS node.

Since
0.3.0

Definition at line 28 of file controller.hpp.

Constructor & Destructor Documentation

Controller::Controller ( const MotionModel model,
const double &  ts 
)
inlineprotected

This constructor (for the inheriting controllers) sets the motion model to the given one.

Parameters
modelthe motion model,
tsthe time step of the controller.
Warning
The time step should be strictly positive (it is taken in absolute value, with a minimum value of 1E-9).

Definition at line 56 of file controller.hpp.

virtual Controller::~Controller ( )
inlinevirtual

The destructor needs to be defined as virtual.

Definition at line 84 of file controller.hpp.

Member Function Documentation

void Controller::changeFirstOdometry ( )
inlineprotected

Change the odometry data status (first or not).

See also
firstOdometry()

Definition at line 80 of file controller.hpp.

virtual void Controller::chooseVelocities ( double &  trans_vel,
double &  rot_vel,
std::ostream &  log_str 
)
pure virtual

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.

Implemented in NoCtrl, FileCtrl, KbdCtrl, SmoothPathCtrl, PIDreachCtrl, PIDCtrl, AnalyticCtrl, and ImitateCtrl.

void Controller::commandsUpdated ( const double &  trans_vel,
const double &  rot_vel 
)
signal

Update the display of the controller's commands.

Parameters
trans_velthe translation velocity sent to ROS,
rot_velthe rotation velocity sent to ROS.
Since
0.3.1
bool Controller::firstOdometry ( )
inlineprotected

Are the odometry data the first?

Returns
Whether the odometry data will be the first or not.

Definition at line 76 of file controller.hpp.

void Controller::newState ( const State state)
virtual

Handles new state of the robot.

Parameters
statethe new state of the robot, from odometry.

This method can be overwritten by inheritors.

Reimplemented in TrackingCtrl, and ReachingCtrl.

Definition at line 16 of file controller.cpp.

void Controller::stateUpdated ( const State state)
signal

Update the display of the state.

Parameters
stateThe state of the robot.
Since
0.3.1
void Controller::stopMotion ( )
inline

Stops the robot (i.e. sets both velocities to zero).

Since
0.2.1

Definition at line 99 of file controller.hpp.

const double& Controller::timeStep ( ) const
inline

Stops the robot (i.e. sets both velocities to zero).

Since
0.2.1

Definition at line 88 of file controller.hpp.

void Controller::updateVelocities ( double &  trans_vel,
double &  rot_vel 
)
inlineprotected

Update the velocities from the fields and send the update signal.

Parameters
trans_velthe translation velocity,
rot_velthe rotation velocity.
See also
moving_velocity, turning_velocity, commandsUpdated.

Definition at line 66 of file controller.hpp.

Member Data Documentation

bool Controller::first_odometry
private

Are the odometry data the first?

Definition at line 32 of file controller.hpp.

double Controller::initial_date
protected

The first date of the odometry.

Since
0.3.1

Definition at line 42 of file controller.hpp.

const MotionModel& Controller::motion_model
protected

The model of the motion.

Since
0.2.2

Definition at line 36 of file controller.hpp.

double Controller::moving_velocity
protected

Translation velocity desired for the robot.

Since
0.2.0

Definition at line 45 of file controller.hpp.

const double Controller::time_step
protected

The time step of the controller.

Since
0.3.0

Definition at line 39 of file controller.hpp.

double Controller::turning_velocity
protected

Rotation velocity desired for the robot.

Since
0.2.0

Definition at line 47 of file controller.hpp.


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


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