delphyne_gui
|
Implements a teleoperation plugin.
See TeleopPlugin.qml to complete understand how the view is connected to each QProperty. The plugin has a text input in which users must place the topic name of the agent to teleoperate. Topic name should be: <teleop/X> where X is the agent number. The plugin appends an extra "/" at the beginning to match topic names. When "Start Driving" is clicked, use:
#include <visualizer/teleop_plugin/teleop_plugin.h>
Public Slots | |
void | OnStartDriving () |
Callback in Qt thread when start driving is clicked. More... | |
void | UpdateSteeringAngle (double sign) |
Updates the steering angle from the plugin UI. More... | |
Signals | |
void | CarNumberChanged () |
Signals to notify that properties changed. More... | |
void | SteeringAngleValueChanged () |
void | ThrottleValueChanged () |
void | BrakeValueChanged () |
void | NewSteeringAngleChanged () |
void | ThrottleKeyPressedChanged () |
void | KeepCurrentThrottleChanged () |
void | BrakeKeyPressedChanged () |
void | KeepCurrentBrakeChanged () |
void | IsDrivingChanged () |
Public Member Functions | |
TeleopPlugin () | |
Constructor. More... | |
void | LoadConfig (const tinyxml2::XMLElement *_pluginElem) override |
Loads the plugin configuration. More... | |
Q_INVOKABLE QString | BrakeValue () const |
Q_INVOKABLE QString | CarNumber () const |
Q_INVOKABLE QString | SteeringAngleValue () const |
Q_INVOKABLE QString | ThrottleValue () const |
Q_INVOKABLE bool | NewSteeringAngle () const |
Q_INVOKABLE bool | ThrottleKeyPressed () const |
Q_INVOKABLE bool | KeepCurrentThrottle () const |
Q_INVOKABLE bool | BrakeKeyPressed () const |
Q_INVOKABLE bool | KeepCurrentBrake () const |
Q_INVOKABLE bool | IsDriving () const |
Q_INVOKABLE void | SetNewSteeringAngle (bool _newSteeringAngle) |
Q_INVOKABLE void | SetThrottleKeyPressed (bool _throttleKeyPressed) |
Q_INVOKABLE void | SetKeepCurrentThrottle (bool _keepCurrentThrottle) |
Q_INVOKABLE void | SetBrakeKeyPressed (bool _brakeKeyPressed) |
Q_INVOKABLE void | SetKeepCurrentBrake (bool _keepCurrentBrake) |
Q_INVOKABLE void | SetIsDriving (bool _isDriving) |
Q_INVOKABLE void | SetCarNumber (const QString &_carNumber) |
Q_INVOKABLE void | SetSteeringAngleValue (const QString &_steeringAngleValue) |
Q_INVOKABLE void | SetThrottleValue (const QString &_throttleValue) |
Q_INVOKABLE void | SetBrakeValue (const QString &_brakeValue) |
Protected Member Functions | |
void | timerEvent (QTimerEvent *event) override |
Timer event callback which handles the logic of publishing driving commands. More... | |
Properties | |
QString | carNumber |
QString | steeringAngleValue |
QString | throttleValue |
QString | brakeValue |
bool | newSteeringAngle {false} |
bool | throttleKeyPressed {false} |
bool | keepCurrentThrottle {false} |
bool | brakeKeyPressed {false} |
bool | keepCurrentBrake {false} |
bool | isDriving {false} |
TeleopPlugin | ( | ) |
Constructor.
Starts the timer and connects it to timerEvent()
.
Q_INVOKABLE bool BrakeKeyPressed | ( | ) | const |
|
signal |
Q_INVOKABLE QString BrakeValue | ( | ) | const |
|
signal |
Q_INVOKABLE QString CarNumber | ( | ) | const |
|
signal |
Signals to notify that properties changed.
Q_INVOKABLE bool IsDriving | ( | ) | const |
|
signal |
Q_INVOKABLE bool KeepCurrentBrake | ( | ) | const |
|
signal |
Q_INVOKABLE bool KeepCurrentThrottle | ( | ) | const |
|
signal |
|
override |
Loads the plugin configuration.
Expects to find car_number
only which is translated to
Q_INVOKABLE bool NewSteeringAngle | ( | ) | const |
|
signal |
|
slot |
Callback in Qt thread when start driving is clicked.
Q_INVOKABLE void SetBrakeKeyPressed | ( | bool | _brakeKeyPressed | ) |
Q_INVOKABLE void SetBrakeValue | ( | const QString & | _brakeValue | ) |
Q_INVOKABLE void SetCarNumber | ( | const QString & | _carNumber | ) |
Q_INVOKABLE void SetIsDriving | ( | bool | _isDriving | ) |
Q_INVOKABLE void SetKeepCurrentBrake | ( | bool | _keepCurrentBrake | ) |
Q_INVOKABLE void SetKeepCurrentThrottle | ( | bool | _keepCurrentThrottle | ) |
Q_INVOKABLE void SetNewSteeringAngle | ( | bool | _newSteeringAngle | ) |
Q_INVOKABLE void SetSteeringAngleValue | ( | const QString & | _steeringAngleValue | ) |
Q_INVOKABLE void SetThrottleKeyPressed | ( | bool | _throttleKeyPressed | ) |
Q_INVOKABLE void SetThrottleValue | ( | const QString & | _throttleValue | ) |
Q_INVOKABLE QString SteeringAngleValue | ( | ) | const |
|
signal |
Q_INVOKABLE bool ThrottleKeyPressed | ( | ) | const |
|
signal |
Q_INVOKABLE QString ThrottleValue | ( | ) | const |
|
signal |
|
overrideprotected |
Timer event callback which handles the logic of publishing driving commands.
|
slot |
Updates the steering angle from the plugin UI.
sign | It should be either 1.0 or -1.0 to move the handle wheel. |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |