This class is a Qt widget which allows to show the controller's behaviour (current and aimed velocities). More...
#include <viewCtrl.hpp>
Public Member Functions | |
void | updateCommands (const double &trans_vel, const double &rot_vel) |
Update the display of the ROS node. More... | |
void | updateState (const State &state) |
Update the display of the odometry. More... | |
ViewCtrlWdgt (QWidget &parent, Controller &control, const MotionModel &motion_model) | |
The constructor needs the containing graphical object, the motion model and the related controller. More... | |
QWidget & | widget () |
Returns the widget used to display the behaviour. More... | |
~ViewCtrlWdgt () | |
The destructor needs to be redefined. More... | |
![]() | |
void | keyPressed (QKeyEvent *event) |
Handles Quit/eXit shortcuts. More... | |
void | keyReleased (QKeyEvent *) |
Key release can be handled by inheritors. More... | |
virtual | ~ControlWidget () |
The destructor needs to be defined as virtual. More... | |
Protected Slots | |
void | paintEvent (QPaintEvent *event) |
Draws the controller's velocities and their evolution. More... | |
Protected Member Functions | |
void | modify (QPointF &variable, const QPointF &value) |
Memorizes a new value in a variable and redraw. More... | |
QPoint | plot (const QPointF &velocities) const |
Returns the graphical point corresponding to a couple of velocities. More... | |
QRect | region (const QPointF &vel) const |
Returns the graphical region drawn around velocities. More... | |
![]() | |
ControlWidget (Controller &controller, const MotionModel &motion_model) | |
The constructor is used by inheritors. More... | |
Protected Attributes | |
QPointF | commands |
The velocities sent as commands. More... | |
QPointF | velocities |
The velocities from the odometry. More... | |
![]() | |
Controller & | ctrl |
This widget is the GUI of a controller. More... | |
const MotionModel & | model |
The motion model and its limits values. More... | |
This class is a Qt widget which allows to show the controller's behaviour (current and aimed velocities).
This widget takes the code of the teleoperation widget which can be useful to other control widgets.
Definition at line 24 of file viewCtrl.hpp.
ViewCtrlWdgt::ViewCtrlWdgt | ( | QWidget & | parent, |
Controller & | control, | ||
const MotionModel & | motion_model | ||
) |
The constructor needs the containing graphical object, the motion model and the related controller.
parent | The containing graphical object, |
control | the controller whose behaviour is shown, |
motion_model | the motion model. |
See QWidget.
Definition at line 66 of file viewCtrl.cpp.
|
inline |
The destructor needs to be redefined.
Definition at line 76 of file viewCtrl.hpp.
|
inlineprotected |
Memorizes a new value in a variable and redraw.
variable | either velocities or commands, |
value | the new value for this variable. |
Definition at line 50 of file viewCtrl.hpp.
|
protectedslot |
Draws the controller's velocities and their evolution.
event | The drawing event, giving the region which should be redrawn. |
Definition at line 33 of file viewCtrl.cpp.
|
protected |
Returns the graphical point corresponding to a couple of velocities.
velocities | The velocities, a couple of double. |
Definition at line 17 of file viewCtrl.cpp.
|
inlineprotected |
Returns the graphical region drawn around velocities.
vel | The velocities, a couple of double. |
Definition at line 40 of file viewCtrl.hpp.
|
inlinevirtual |
Update the display of the ROS node.
trans_vel | the translation velocity sent to ROS, |
rot_vel | the rotation velocity sent to ROS. |
Implements ControlWidget.
Definition at line 90 of file viewCtrl.hpp.
|
inlinevirtual |
Update the display of the odometry.
state | The state of the robot. |
Implements ControlWidget.
Definition at line 85 of file viewCtrl.hpp.
|
inlinevirtual |
Returns the widget used to display the behaviour.
See Qt widget.
Implements ControlWidget.
Definition at line 82 of file viewCtrl.hpp.
|
protected |
The velocities sent as commands.
Definition at line 29 of file viewCtrl.hpp.
|
protected |
The velocities from the odometry.
Definition at line 28 of file viewCtrl.hpp.