Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
DataWidget Class Reference

This class is a Qt widget which displays the data (odometry and commands) of the controller. More...

#include <display.hpp>

Inheritance diagram for DataWidget:
Inheritance graph
[legend]

Public Member Functions

void addTrajectory (const std::list< State * > &trajectory)
 Adds a trajectory to the motion display. More...
 
 DataWidget (QWidget &parent)
 The constructor needs the ROS node whose data will be displayed. More...
 
void newTrajectory ()
 Clears the motion display. More...
 
void setOutput (const char *output_file_name)
 Change the output stream to a new file. More...
 
void updateCommands (const double &trans_vel, const double &rot_vel)
 Update the display of the controller's commands. More...
 
void updateState (const State &state)
 Update the display of the state. More...
 
 ~DataWidget ()
 The destructor closes the output stream, if any. More...
 

Private Types

enum  Labels {
  tOdom, xOdom, yOdom, thOdom,
  vOdom, omOdom, vCmd, omCmd,
  nbLabels, nbOdoms = vCmd, nbCmds = nbLabels - nbOdoms
}
 These are the indexes of the array of labels. More...
 

Private Member Functions

void outputEnd ()
 Close and terminate the output stream. More...
 
bool outputOK () const
 Is the output stream OK for writting? More...
 
void setLabels (const Labels &offset, const Labels &nbData, const double *data)
 Transfer data into the labels. More...
 

Private Attributes

QLabel labels [nbLabels]
 Array of labels displaying controller's data. More...
 
QPointF last_vel
 The last command published. More...
 
QtMotionGUI motion_GUI
 Window showing the motion's path and velocities. More...
 
std::ofstream * output
 The output stream, if any. More...
 

Static Private Attributes

static const char * names []
 Labels shown before the values, and headers in the ouput file. More...
 

Detailed Description

This class is a Qt widget which displays the data (odometry and commands) of the controller.

Since
0.2.2

Definition at line 25 of file display.hpp.

Member Enumeration Documentation

enum DataWidget::Labels
private

These are the indexes of the array of labels.

Enumerator
tOdom 

Index of the odometry's time.

xOdom 

Index of the odometry's position abscissa.

yOdom 

Index of the odometry's position ordinate.

thOdom 

Index of the odometry's orientation.

vOdom 

Index of the odometry's translation velocity.

omOdom 

Index of the odometry's rotation velocity.

vCmd 

Index of the commands' translation velocity.

omCmd 

Index of the commands' rotation velocity.

nbLabels 

Number of labels in the array.

nbOdoms 

Number of odometry indexes.

nbCmds 

Number of commands indexes.

Definition at line 33 of file display.hpp.

Constructor & Destructor Documentation

DataWidget::DataWidget ( QWidget &  parent)

The constructor needs the ROS node whose data will be displayed.

Parameters
parentThe windget containing this widget.

Definition at line 25 of file display.cpp.

DataWidget::~DataWidget ( )
inline

The destructor closes the output stream, if any.

Since
0.2.3

Definition at line 91 of file display.hpp.

Member Function Documentation

void DataWidget::addTrajectory ( const std::list< State * > &  trajectory)
inline

Adds a trajectory to the motion display.

Parameters
trajectorythe trajectory to track.
See also
motion_GUI, QtMotionGUI::addTrajectory
Since
0.3.1

Definition at line 116 of file display.hpp.

void DataWidget::newTrajectory ( )
inline

Clears the motion display.

See also
motion_GUI, QtMotionGUI::clear
Since
0.3.2

Definition at line 121 of file display.hpp.

void DataWidget::outputEnd ( )
inlineprivate

Close and terminate the output stream.

Since
0.2.3

Definition at line 78 of file display.hpp.

bool DataWidget::outputOK ( ) const
inlineprivate

Is the output stream OK for writting?

Returns
Yes if OK, no otherwise.
Since
0.2.3

Definition at line 74 of file display.hpp.

void DataWidget::setLabels ( const Labels offset,
const Labels nbData,
const double *  data 
)
private

Transfer data into the labels.

This is the common part of updateOdometry and updateCommands.

Parameters
offsetThe initial index in the label array,
nbDatathe number of data to transfer,
datathe array of data to display.
See also
labels.

Definition at line 69 of file display.cpp.

void DataWidget::setOutput ( const char *  output_file_name)
inline

Change the output stream to a new file.

Parameters
output_file_nameThe output file name.
Since
0.2.3

Definition at line 95 of file display.hpp.

void DataWidget::updateCommands ( const double &  trans_vel,
const double &  rot_vel 
)

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

Definition at line 105 of file display.cpp.

void DataWidget::updateState ( const State state)

Update the display of the state.

Parameters
stateThe state of the robot.
Since
0.3.1

Definition at line 85 of file display.cpp.

Member Data Documentation

QLabel DataWidget::labels[nbLabels]
private

Array of labels displaying controller's data.

Definition at line 53 of file display.hpp.

QPointF DataWidget::last_vel
private

The last command published.

Since
0.2.3

Definition at line 28 of file display.hpp.

QtMotionGUI DataWidget::motion_GUI
private

Window showing the motion's path and velocities.

Since
0.3.1

Definition at line 57 of file display.hpp.

const char * DataWidget::names
staticprivate
Initial value:
=
{"t", "x", "y", "theta", "v", "omega", "v", "omega"}

Labels shown before the values, and headers in the ouput file.

Since
0.2.3

Definition at line 49 of file display.hpp.

std::ofstream* DataWidget::output
private

The output stream, if any.

Since
0.2.3

Definition at line 29 of file display.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