Public Member Functions | Protected Slots | Private Slots | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
QtCtrlGUI Class Reference

This class is the Qt main window of qt_ctrl package. More...

#include <window.hpp>

Inheritance diagram for QtCtrlGUI:
Inheritance graph
[legend]

Public Member Functions

const MotionModelmotionModel () const
 The motion model of the controlled robot. More...
 
void newTrajectory (const std::list< State * > &trajectory)
 Adds a trajectory to the motion display. More...
 
 QtCtrlGUI (const int argc, char **argv, QWidget *parent=0)
 The constructor requires main()'s arguments (they can be forwarded by the ROS node to ROS). More...
 
 ~QtCtrlGUI ()
 Freeing the allocated pointer. More...
 

Protected Slots

void closeEvent (QCloseEvent *event)
 The closing method of QMainWindow is surcharged to save settings before closing. More...
 
void keyPressEvent (QKeyEvent *event)
 All key press events are transmitted to the control widget. More...
 
void keyReleaseEvent (QKeyEvent *event)
 When a key is released, it is transmitted to the control widget. More...
 

Private Slots

void actionAbout ()
 Method activated by the "About" menu item (not yet used). More...
 
void buttonStartStop ()
 Method activated by the "Start/Stop" button. More...
 
void threadError (const int error, const QString &program)
 Signals which error occured when starting ROS server. More...
 
void updateCommands (const double &trans_vel, const double &rot_vel)
 Update the display of the controller's commands. More...
 
void updateLogging ()
 Method activated when this GUI's log view is updated. More...
 
void updateState (const State &state)
 Update the display of the state. More...
 
void updateTrajectory ()
 Update the display of the . More...
 

Private Member Functions

void connectCtrl ()
 Connects the controller signals to this class' methods. More...
 
void readSettings ()
 Load up Qt program settings at startup. More...
 
void writeSettings ()
 Save Qt program settings when closing. More...
 

Private Attributes

QAction about_action
 The Qt action starting a dialog box about Qt Ctrl. More...
 
QAction about_Qt_action
 The Qt action starting a dialog box about Qt. More...
 
QMenu app_menu
 The actions' menu of this GUI. More...
 
Controllercontroller
 The controller of the ROS node can change. More...
 
ROSnode ctrl_node
 The ROS node at the center of this GUI. More...
 
ControlWidgetctrl_wdgt
 The widget showing the controller's velocities can also change. More...
 
DataWidget display
 The data display widget of the ROS node. More...
 
QMenu help_menu
 The help menu of this GUI. More...
 
QListView logs
 The Qt list view showing the logs of the ROS node. More...
 
QMenuBar menu_bar
 The menu bar of this GUI. More...
 
MotionModel motion_model
 The motion model of the controlled robot. More...
 
ROSserver ROS_server
 The instance used to start a ROS server, if needed. More...
 
QAction start_stop_action
 The Qt action starting the ROS node. More...
 
QToolBar tool_bar
 The tool bar of this GUI. More...
 

Static Private Attributes

static const double time_step = .2
 The default time step. More...
 

Detailed Description

This class is the Qt main window of qt_ctrl package.

It contains (from left to right and top to bottom ) a control widget (connected to a controller), a data widget displaying odometry and commands' values, and a Qt list view showing the logs of the console outputs sent to ROS by the ROS node.

Since
0.2.0

Definition at line 41 of file window.hpp.

Constructor & Destructor Documentation

QtCtrlGUI::QtCtrlGUI ( const int  argc,
char **  argv,
QWidget *  parent = 0 
)

The constructor requires main()'s arguments (they can be forwarded by the ROS node to ROS).

Parameters
argcthe arguments' count,
argvthe arguments' value,
parentthe main widget parent, if any (optional).
See also
ROSnode::ROSnode().

Definition at line 33 of file window.cpp.

QtCtrlGUI::~QtCtrlGUI ( )
inline

Freeing the allocated pointer.

Definition at line 135 of file window.hpp.

Member Function Documentation

void QtCtrlGUI::actionAbout ( )
privateslot

Method activated by the "About" menu item (not yet used).

Definition at line 153 of file window.cpp.

void QtCtrlGUI::buttonStartStop ( )
privateslot

Method activated by the "Start/Stop" button.

Since
0.2.1

Definition at line 167 of file window.cpp.

void QtCtrlGUI::closeEvent ( QCloseEvent *  event)
inlineprotectedslot

The closing method of QMainWindow is surcharged to save settings before closing.

Parameters
eventthe close event, sent to the closing method of QMainWindow.

See writeSettings(), QMainWindow.

Definition at line 156 of file window.hpp.

void QtCtrlGUI::connectCtrl ( )
inlineprivate

Connects the controller signals to this class' methods.

This has to be donne each time the controller is changed.

Definition at line 110 of file window.hpp.

void QtCtrlGUI::keyPressEvent ( QKeyEvent *  event)
inlineprotectedslot

All key press events are transmitted to the control widget.

Parameters
eventthe key press event, sent to the related method of the control widget.
Since
0.2.1

Definition at line 171 of file window.hpp.

void QtCtrlGUI::keyReleaseEvent ( QKeyEvent *  event)
inlineprotectedslot

When a key is released, it is transmitted to the control widget.

Parameters
eventthe key release event, sent to the related method of the control widget.
Since
0.2.1

Definition at line 181 of file window.hpp.

const MotionModel& QtCtrlGUI::motionModel ( ) const
inline

The motion model of the controlled robot.

Since
0.2.2

Definition at line 139 of file window.hpp.

void QtCtrlGUI::newTrajectory ( const std::list< State * > &  trajectory)
inline

Adds a trajectory to the motion display.

Parameters
trajectorythe trajectory to track.
See also
DataWidget::addTrajectory
Since
0.3.2

Definition at line 144 of file window.hpp.

void QtCtrlGUI::readSettings ( )
private

Load up Qt program settings at startup.

Definition at line 99 of file window.cpp.

void QtCtrlGUI::threadError ( const int  error,
const QString &  program 
)
privateslot

Signals which error occured when starting ROS server.

Parameters
errorthe error which occured.
programthe name of the script started.
Since
0.3.3

Definition at line 141 of file window.cpp.

void QtCtrlGUI::updateCommands ( const double &  trans_vel,
const double &  rot_vel 
)
inlineprivateslot

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 213 of file window.hpp.

void QtCtrlGUI::updateLogging ( )
inlineprivateslot

Method activated when this GUI's log view is updated.

Definition at line 197 of file window.hpp.

void QtCtrlGUI::updateState ( const State state)
inlineprivateslot

Update the display of the state.

Parameters
stateThe state of the robot.
Since
0.3.1

Definition at line 201 of file window.hpp.

void QtCtrlGUI::updateTrajectory ( )
inlineprivateslot

Update the display of the .

Since
0.3.2

Definition at line 205 of file window.hpp.

void QtCtrlGUI::writeSettings ( )
private

Save Qt program settings when closing.

Definition at line 124 of file window.cpp.

Member Data Documentation

QAction QtCtrlGUI::about_action
private

The Qt action starting a dialog box about Qt Ctrl.

Since
0.2.1

Definition at line 72 of file window.hpp.

QAction QtCtrlGUI::about_Qt_action
private

The Qt action starting a dialog box about Qt.

Since
0.2.1

Definition at line 79 of file window.hpp.

QMenu QtCtrlGUI::app_menu
private

The actions' menu of this GUI.

Since
0.2.1

Definition at line 53 of file window.hpp.

Controller* QtCtrlGUI::controller
private

The controller of the ROS node can change.

Since
0.3.0

Definition at line 87 of file window.hpp.

ROSnode QtCtrlGUI::ctrl_node
private

The ROS node at the center of this GUI.

Since
0.2.2

Definition at line 90 of file window.hpp.

ControlWidget* QtCtrlGUI::ctrl_wdgt
private

The widget showing the controller's velocities can also change.

Since
0.2.1

Definition at line 94 of file window.hpp.

DataWidget QtCtrlGUI::display
private

The data display widget of the ROS node.

Since
0.2.2

Definition at line 98 of file window.hpp.

QMenu QtCtrlGUI::help_menu
private

The help menu of this GUI.

Since
0.2.1

Definition at line 57 of file window.hpp.

QListView QtCtrlGUI::logs
private

The Qt list view showing the logs of the ROS node.

Definition at line 102 of file window.hpp.

QMenuBar QtCtrlGUI::menu_bar
private

The menu bar of this GUI.

Since
0.2.1

Definition at line 49 of file window.hpp.

MotionModel QtCtrlGUI::motion_model
private

The motion model of the controlled robot.

Since
0.2.2

Definition at line 83 of file window.hpp.

ROSserver QtCtrlGUI::ROS_server
private

The instance used to start a ROS server, if needed.

Definition at line 75 of file window.hpp.

QAction QtCtrlGUI::start_stop_action
private

The Qt action starting the ROS node.

Since
0.2.1

Definition at line 68 of file window.hpp.

const double QtCtrlGUI::time_step = .2
staticprivate

The default time step.

Since
0.3.1

Definition at line 45 of file window.hpp.

QToolBar QtCtrlGUI::tool_bar
private

The tool bar of this GUI.

Even though it is not used by this class, it is by Qt and has to exist as long as the window does.

Since
0.2.1

Definition at line 64 of file window.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