|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <JoystickSDL.h>
Inheritance diagram for JoystickSDL:
Collaboration diagram for JoystickSDL:Signals | |
| void | axisDriftDetected (const QVariantList &driftingAxes) |
| Emitted when significant axis drift is detected on open. | |
Signals inherited from Joystick | |
| void | buttonActionsChanged () |
| void | assignableActionsChanged () |
| void | playerIndexChanged () |
| void | batteryStateChanged () |
| void | connectionStateChanged (const QString &newState) |
| void | linkedGroupChanged () |
| void | axisValues (float roll, float pitch, float yaw, float throttle) |
| void | startContinuousZoom (int direction) |
| void | stopContinuousZoom () |
| void | stepZoom (int direction) |
| void | startContinuousFocus (int direction) |
| void | stopContinuousFocus () |
| void | stepFocus (int direction) |
| void | stepCamera (int direction) |
| void | stepStream (int direction) |
| void | triggerCamera () |
| void | startVideoRecord () |
| void | stopVideoRecord () |
| void | toggleVideoRecord () |
| void | gimbalPitchStart (int direction) |
| void | gimbalYawStart (int direction) |
| void | gimbalPitchStop () |
| void | gimbalYawStop () |
| void | centerGimbal () |
| void | gimbalYawLock (bool lock) |
| void | setArmed (bool arm) |
| void | setVtolInFwdFlight (bool set) |
| void | setFlightMode (const QString &flightMode) |
| void | emergencyStop () |
| void | gripperAction (GRIPPER_ACTIONS gripperAction) |
| void | landingGearDeploy () |
| void | landingGearRetract () |
| void | motorInterlock (bool enable) |
| void | unknownAction (const QString &action) |
| void | vehicleJoystickData (float roll, float pitch, float yaw, float throttle, uint16_t buttonsLow, uint16_t buttonsHigh, float gimbalPitch, float gimbalYaw) |
| void | rawChannelValuesChanged (QVector< int > channelValues) |
| Signalled during PollingForConfiguration. | |
| void | rawButtonPressedChanged (int index, bool pressed) |
| Signalled during PollingForConfiguration. | |
| void | gyroscopeDataUpdated (const QVector3D &data) |
| void | accelerometerDataUpdated (const QVector3D &data) |
| void | touchpadEvent (int touchpad, int finger, bool down, float x, float y, float pressure) |
| void | mappingRemapped () |
| void | updateComplete () |
Public Member Functions | |
| JoystickSDL (const QString &name, const QList< int > &gamepadAxes, const QList< int > &nonGamepadAxes, int buttonCount, int hatCount, int instanceId, QObject *parent=nullptr) | |
| ~JoystickSDL () override | |
| int | instanceId () const |
| void | setInstanceId (int instanceId) |
| bool | requiresCalibration () const override |
| bool | hasRumble () const override |
| bool | hasRumbleTriggers () const override |
| bool | hasLED () const override |
| void | rumble (quint16 lowFreq, quint16 highFreq, quint32 durationMs) override |
| void | rumbleTriggers (quint16 left, quint16 right, quint32 durationMs) override |
| void | setLED (quint8 red, quint8 green, quint8 blue) override |
| bool | sendEffect (const QByteArray &data) override |
| QString | guid () const override |
| quint16 | vendorId () const override |
| quint16 | productId () const override |
| QString | serial () const override |
| QString | deviceType () const override |
| QString | path () const override |
| bool | isVirtual () const override |
| quint16 | firmwareVersion () const override |
| QString | connectionType () const override |
| int | playerIndex () const override |
| void | setPlayerIndex (int index) override |
| int | batteryPercent () const override |
| QString | powerState () const override |
| bool | isGamepad () const override |
| QString | gamepadType () const override |
| QString | axisLabel (int axis) const override |
| QString | buttonLabel (int button) const override |
| QString | getMapping () const override |
| bool | addMapping (const QString &mapping) override |
| QVariantMap | getAxisBinding (int axis) const override |
| QVariantMap | getButtonBinding (int button) const override |
| bool | hasGyroscope () const override |
| bool | hasAccelerometer () const override |
| bool | setGyroscopeEnabled (bool enabled) override |
| bool | setAccelerometerEnabled (bool enabled) override |
| QVector3D | gyroscopeData () const override |
| QVector3D | accelerometerData () const override |
| float | gyroscopeDataRate () const override |
| float | accelerometerDataRate () const override |
| int | touchpadCount () const override |
| int | touchpadFingerCount (int touchpad) const override |
| QVariantMap | getTouchpadFinger (int touchpad, int finger) const override |
| int | ballCount () const override |
| QVariantMap | getBall (int ball) const override |
| bool | hasButton (int button) const override |
| bool | hasAxis (int axis) const override |
| QString | realGamepadType () const override |
| QString | buttonLabelForType (int button) const override |
| bool | hasHaptic () const override |
| int | hapticEffectsCount () const override |
| bool | hapticRumbleSupported () const override |
| bool | hapticRumbleInit () override |
| bool | hapticRumblePlay (float strength, quint32 durationMs) override |
| void | hapticRumbleStop () override |
| QString | getMappingForGUID (const QString &guid) const override |
| bool | setVirtualAxis (int axis, int value) override |
| bool | setVirtualButton (int button, bool down) override |
| bool | setVirtualHat (int hat, quint8 value) override |
| bool | setVirtualBall (int ball, int dx, int dy) override |
| bool | setVirtualTouchpad (int touchpad, int finger, bool down, float x, float y, float pressure) override |
| bool | sendVirtualSensorData (int sensorType, float x, float y, float z) override |
| bool | hasMonoLED () const override |
| bool | hasRGBLED () const override |
| bool | hasPlayerLED () const override |
| QString | connectionState () const override |
| QVariantMap | getAxisInitialState (int axis) const override |
| bool | setMapping (const QString &mapping) override |
| void | updateCachedGyroData (const QVector3D &data) |
| void | updateCachedAccelData (const QVector3D &data) |
| void | checkConnectionStateChanged () |
| Q_INVOKABLE QVariantList | detectAxisDrift (int threshold=8000) const |
Public Member Functions inherited from Joystick | |
| Joystick (const QString &name, int axisCount, int buttonCount, int hatCount, QObject *parent=nullptr) | |
| virtual | ~Joystick () |
| Q_INVOKABLE void | setButtonRepeat (int button, bool repeat) |
| Q_INVOKABLE bool | getButtonRepeat (int button) |
| Q_INVOKABLE void | setButtonAction (int button, const QString &action) |
| Q_INVOKABLE QString | getButtonAction (int button) const |
| JoystickSettings * | settings () |
| QString | name () const |
| int | buttonCount () const |
| int | axisCount () const |
| QStringList | buttonActions () const |
| QString | buttonActionNone () const |
| QString | disabledActionName () const |
| const QmlObjectListModel * | assignableActions () const |
| QStringList | assignableActionTitles () const |
| QString | linkedGroupId () const |
| HOTAS/Multi-device linking (devices with same groupId act as single joystick) | |
| void | setLinkedGroupId (const QString &groupId) |
| QString | linkedGroupRole () const |
| void | setLinkedGroupRole (const QString &role) |
| void | setAxisCalibration (int axis, const AxisCalibration_t &calibration) |
| Joystick::AxisCalibration_t | getAxisCalibration (int axis) const |
| RemoteControlCalibrationController::StickFunction | mapAxisFunctionToRCCStickFunction (AxisFunction_t axisFunction) const |
| AxisFunction_t | mapRCCStickFunctionToAxisFunction (RemoteControlCalibrationController::StickFunction stickFunction) const |
| void | setFunctionForChannel (RemoteControlCalibrationController::StickFunction stickFunction, int channel) |
| int | getChannelForFunction (RemoteControlCalibrationController::StickFunction stickFunction) const |
| Q_INVOKABLE void | startConfiguration () |
| Tells the joystick that the configuration UI is being displayed so it can do any special processing required. | |
| Q_INVOKABLE void | stopConfiguration () |
| Tells the joystick that the configuration UI is being closed so it can do any special processing required. | |
| void | stop () |
Static Public Member Functions | |
| static bool | init () |
| static void | shutdown (bool deleteDiscoveryCache=true) |
| static QMap< QString, Joystick * > | discover () |
Static Public Member Functions inherited from Joystick | |
| static QString | axisFunctionToString (AxisFunction_t function) |
Friends | |
| class | MockJoystick |
Definition at line 18 of file JoystickSDL.h.
|
explicit |
Definition at line 106 of file JoystickSDL.cc.
|
override |
Definition at line 119 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 938 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 967 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 809 of file JoystickSDL.cc.
|
signal |
Emitted when significant axis drift is detected on open.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 757 of file JoystickSDL.cc.
Referenced by detectAxisDrift().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1018 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 702 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 781 of file JoystickSDL.cc.
Referenced by buttonLabelForType().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1085 of file JoystickSDL.cc.
References buttonLabel().
| void JoystickSDL::checkConnectionStateChanged | ( | ) |
Definition at line 1395 of file JoystickSDL.cc.
References connectionState(), and Joystick::connectionStateChanged().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1278 of file JoystickSDL.cc.
References connectionType().
Referenced by checkConnectionStateChanged().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 656 of file JoystickSDL.cc.
References SDLJoystick::connectionStateToString().
Referenced by connectionState().
| QVariantList JoystickSDL::detectAxisDrift | ( | int | threshold = 8000 | ) | const |
Check for axis drift (significant deviation from center at rest) Returns list of axes with detected drift and their values
Definition at line 1405 of file JoystickSDL.cc.
References axisLabel().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 602 of file JoystickSDL.cc.
|
static |
Definition at line 178 of file JoystickSDL.cc.
References Joystick::axisCount(), Joystick::buttonCount(), SDLJoystick::getNameForInstanceId(), instanceId(), Joystick::name(), SDLJoystick::pumpEvents(), s_discoveryCache, and setInstanceId().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 648 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 745 of file JoystickSDL.cc.
References SDLJoystick::gamepadTypeDisplayName().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 825 of file JoystickSDL.cc.
References SDLJoystick::findBinding().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1287 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1026 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 858 of file JoystickSDL.cc.
References SDLJoystick::findBinding().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 796 of file JoystickSDL.cc.
|
overridevirtual |
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 995 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 564 of file JoystickSDL.cc.
Referenced by getMappingForGUID().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 917 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 959 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1126 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1143 of file JoystickSDL.cc.
Referenced by hapticRumblePlay().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1170 of file JoystickSDL.cc.
References hapticRumbleInit().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1185 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1134 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 885 of file JoystickSDL.cc.
Referenced by setAccelerometerEnabled().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1057 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1046 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 877 of file JoystickSDL.cc.
Referenced by setGyroscopeEnabled().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1118 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 503 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1259 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1269 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1264 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 491 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 497 of file JoystickSDL.cc.
|
static |
Definition at line 157 of file JoystickSDL.cc.
References SDLJoystick::init(), and sdlEventWatcher().
Referenced by JoystickManager::init().
|
inline |
Definition at line 32 of file JoystickSDL.h.
Referenced by discover(), and setInstanceId().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 740 of file JoystickSDL.cc.
Referenced by requiresCalibration().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 643 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 632 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 671 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 712 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 583 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1073 of file JoystickSDL.cc.
References SDLJoystick::gamepadTypeDisplayName().
|
inlineoverridevirtual |
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 513 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 526 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 548 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1363 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 591 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 905 of file JoystickSDL.cc.
References hasAccelerometer().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 893 of file JoystickSDL.cc.
References hasGyroscope().
|
inline |
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 535 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1309 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 682 of file JoystickSDL.cc.
References Joystick::playerIndexChanged().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1216 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1326 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1229 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1242 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 1339 of file JoystickSDL.cc.
|
static |
Definition at line 167 of file JoystickSDL.cc.
References s_discoveryCache, sdlEventWatcher(), and SDLJoystick::shutdown().
Referenced by JoystickManager::~JoystickManager().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 979 of file JoystickSDL.cc.
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 987 of file JoystickSDL.cc.
| void JoystickSDL::updateCachedAccelData | ( | const QVector3D & | data | ) |
Definition at line 1388 of file JoystickSDL.cc.
References Joystick::accelerometerDataUpdated().
| void JoystickSDL::updateCachedGyroData | ( | const QVector3D & | data | ) |
Definition at line 1381 of file JoystickSDL.cc.
References Joystick::gyroscopeDataUpdated().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 575 of file JoystickSDL.cc.
|
friend |
Definition at line 25 of file JoystickSDL.h.