This class is a Qt widget which allows to control the keyboard controller.
More...
#include <teleop.hpp>
|
void | react (const int &key) |
| This widget reacts to commands, which are Qt key values. More...
|
|
void | stopAcc () |
| Stops the acceleration of the ROS node. More...
|
|
This class is a Qt widget which allows to control the keyboard controller.
This widget reacts to key pression, and modify accordingly the controller velocities (with the keyboard controller acceleration or stop methods).
Due to a bug (key pressions were not detected), buttons were added. A more precise method could be used later.
- Since
- 0.2.1
Definition at line 31 of file teleop.hpp.
TeleopWidget::TeleopWidget |
( |
QWidget & |
parent, |
|
|
KbdCtrl & |
control, |
|
|
const MotionModel & |
motion_model |
|
) |
| |
The constructor needs the main window containing this widget, and the ROS node to control.
- Parameters
-
parent | The containing graphical object, |
control | the controller whose behaviour is shown, |
motion_model | the motion model. |
Definition at line 24 of file teleop.cpp.
TeleopWidget::~TeleopWidget |
( |
| ) |
|
|
inline |
The destructor needs to be redefined.
Definition at line 54 of file teleop.hpp.
void TeleopWidget::keyPressEvent |
( |
QKeyEvent * |
event | ) |
|
|
inlineprotectedslot |
This widget reacts to key pression.
The key associated to actions are the following: the application can be stopped either by pressing 'q' (Quit) or 'x' (eXit). The other possibilities are those of react method.
- Parameters
-
event | The event associated to a key pression. |
See QKeyEvent.
Definition at line 82 of file teleop.hpp.
void TeleopWidget::keyReleaseEvent |
( |
QKeyEvent * |
| ) |
|
|
inlineprotectedslot |
When a key is released, both accelerations stop.
Definition at line 87 of file teleop.hpp.
void TeleopWidget::react |
( |
const int & |
key | ) |
|
|
privateslot |
This widget reacts to commands, which are Qt key values.
The commands are currently fixed, there will be later a dialog to change the values associated to each action. These commands modify the controller velocities (with the keyboard controller acceleration, stop, stop translation or stop rotation methods). The robot can be stopped (zero velocities) by pressing either '0' or 'End'. The robot can otherwise change its velocity in two ways:
Directions are in the robot's frame, up meaning forward (acceleration) while down means backward (deceleration). Center ('5' or 'Home') stops the robot's rotation.
- Parameters
-
key | The command, one of Qt key values. |
See QKeyEvent.
Definition at line 111 of file teleop.cpp.
void TeleopWidget::stopAcc |
( |
| ) |
|
|
inlineprivateslot |
Stops the acceleration of the ROS node.
- Since
- 0.2.2
Definition at line 91 of file teleop.hpp.
void TeleopWidget::updateCommands |
( |
const double & |
trans_vel, |
|
|
const double & |
rot_vel |
|
) |
| |
|
inlinevirtual |
Update the display of the ROS node.
- Parameters
-
trans_vel | the translation velocity sent to ROS, |
rot_vel | the rotation velocity sent to ROS. |
- Since
- 0.3.1
Implements ControlWidget.
Definition at line 67 of file teleop.hpp.
void TeleopWidget::updateState |
( |
const State & |
state | ) |
|
|
inlinevirtual |
Update the display of the odometry.
- Parameters
-
state | The state of the robot. |
- Since
- 0.3.1
Implements ControlWidget.
Definition at line 63 of file teleop.hpp.
QWidget& TeleopWidget::widget |
( |
| ) |
|
|
inlinevirtual |
QSignalMapper TeleopWidget::mapper |
|
private |
This widget draws the velocities' evolutions.
- Since
- 0.2.2
Definition at line 36 of file teleop.hpp.
The documentation for this class was generated from the following files: