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

PIDCtrl uses a PID to compute the trajectory's velocities. More...

#include <PID.hpp>

Inheritance diagram for PIDCtrl:
Inheritance graph
[legend]

Public Member Functions

 PIDCtrl (const MotionModel &model, const double &ts, const char *input_file_name, const iSeeML::rob::OrPtConfig &init_config, const double coef[6])
 The constructor needs a motion model, the time step of the controller, a file name giving the path to track, an initial configuration and the PID coefficients. More...
 
virtual ~PIDCtrl ()
 The destructor needs to be explicitely redefined. More...
 
- Public Member Functions inherited from TrackingCtrl
virtual void newState (const State &state)
 Handles new state of the robot. More...
 
 TrackingCtrl (const MotionModel &model, const double &ts, const char *input_file_name, const iSeeML::rob::OrPtConfig &init_config)
 The constructor needs a motion model, a time step, a file name giving the path to track and an initial configuration. More...
 
const std::list< State * > & trajectory () const
 Gives the tracked trajectory. More...
 
virtual ~TrackingCtrl ()
 The destructor needs to be explicitely redefined. More...
 
- Public Member Functions inherited from FileCtrl
 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. More...
 
void setInput (const char *input_file_name)
 Change the input stream to a new file. More...
 
virtual ~FileCtrl ()
 The destructor closes the input stream, if any. More...
 
- Public Member Functions inherited from Controller
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

virtual void chooseVelocities (double &trans_vel, double &rot_vel, std::ostream &log_str)
 Computes new velocities for ROS node. More...
 
- Protected Member Functions inherited from TrackingCtrl
void searchGoal (const double &forwardTime=0)
 Moves the goal forward until it gets after the robot's date plus a given amount of time. More...
 
- Protected Member Functions inherited from FileCtrl
void inputEnd ()
 Close and terminate the input stream. More...
 
bool inputEnded () const
 Is the input stream at its end? More...
 
bool inputOK () const
 Is the input stream OK for reading? 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...
 

Private Attributes

PIDreachCtrl reachCtrl
 The local PID reaching controller. 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 Attributes inherited from TrackingCtrl
std::list< State * >::const_iterator goal
 The trajectory's state which is aimed. More...
 
int nb_states
 The number of states in the followed trajectory. More...
 
State state
 The current state of the robot. More...
 
std::list< State * > traject
 The trajectory which should be followed. More...
 
- Protected Attributes inherited from FileCtrl
std::ifstream * input
 The input stream, if any. 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

PIDCtrl uses a PID to compute the trajectory's velocities.

You need to find the right coefficients.

Since
0.3.1

Definition at line 24 of file PID.hpp.

Constructor & Destructor Documentation

PIDCtrl::PIDCtrl ( const MotionModel model,
const double &  ts,
const char *  input_file_name,
const iSeeML::rob::OrPtConfig &  init_config,
const double  coef[6] 
)
inline

The constructor needs a motion model, the time step of the controller, a file name giving the path to track, an initial configuration and the PID coefficients.

Parameters
modelthe motion model,
tsthe time step of the controller,
input_file_namethe input file name of the path,
init_configthe initial configuration,
coefthe coefficient array.
See also
TrackingCtrl::TrackingCtrl

Definition at line 40 of file PID.hpp.

virtual PIDCtrl::~PIDCtrl ( )
inlinevirtual

The destructor needs to be explicitely redefined.

Definition at line 48 of file PID.hpp.

Member Function Documentation

void PIDCtrl::chooseVelocities ( double &  trans_vel,
double &  rot_vel,
std::ostream &  log_str 
)
protectedvirtual

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.

Reimplemented from FileCtrl.

Definition at line 14 of file PID.cpp.

Member Data Documentation

PIDreachCtrl PIDCtrl::reachCtrl
private

The local PID reaching controller.

Definition at line 25 of file PID.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