|
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 | 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 (QGCMAVLink::GripperActions 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 () |
| QVariantList | detectAxisDrift (int threshold=8000) const |
Public Member Functions inherited from Joystick | |
| QString name READ name | CONSTANT (JoystickSettings *settings READ settings CONSTANT) 1(int axisCount READ axisCount CONSTANT) 1(int buttonCount READ buttonCount CONSTANT) 1(bool requiresCalibration READ requiresCalibration CONSTANT) 1(bool hasRumble READ hasRumble CONSTANT) 1(bool hasRumbleTriggers READ hasRumbleTriggers CONSTANT) 1(bool hasLED READ hasLED CONSTANT) 1(QString guid READ guid CONSTANT) 1(quint16 vendorId READ vendorId CONSTANT) 1(quint16 productId READ productId CONSTANT) 1(QString serial READ serial CONSTANT) 1(QString deviceType READ deviceType CONSTANT) 1(int playerIndex READ playerIndex WRITE setPlayerIndex NOTIFY playerIndexChanged) 1(int batteryPercent READ batteryPercent NOTIFY batteryStateChanged) 1(QString powerState READ powerState NOTIFY batteryStateChanged) 1(bool isGamepad READ isGamepad CONSTANT) 1(QString gamepadType READ gamepadType CONSTANT) 1(QString path READ path CONSTANT) 1(bool isVirtual READ isVirtual CONSTANT) 1(quint16 firmwareVersion READ firmwareVersion CONSTANT) 1(QString connectionType READ connectionType CONSTANT) 1(int ballCount READ ballCount CONSTANT) 1(const QmlObjectListModel *assignableActions READ assignableActions NOTIFY assignableActionsChanged) 1(QString disabledActionName READ disabledActionName CONSTANT) 1(QStringList assignableActionTitles READ assignableActionTitles NOTIFY assignableActionsChanged) 1(QStringList buttonActions READ buttonActions NOTIFY buttonActionsChanged) 1(QString buttonActionNone READ buttonActionNone CONSTANT) 1(QString linkedGroupId READ linkedGroupId WRITE setLinkedGroupId NOTIFY linkedGroupChanged) 1(QString linkedGroupRole READ linkedGroupRole WRITE setLinkedGroupRole NOTIFY linkedGroupChanged) Joystick(const QString &name |
| virtual | ~Joystick () |
| void | setButtonRepeat (int button, bool repeat) |
| bool | getButtonRepeat (int button) |
| void | setButtonAction (int button, const QString &action) |
| 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 |
| void | startConfiguration () |
| Tells the joystick that the configuration UI is being displayed so it can do any special processing required. | |
| 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 |
Additional Inherited Members | |
Public Types inherited from Joystick | |
| enum | ButtonEvent_t { ButtonEventUpTransition , ButtonEventDownTransition , ButtonEventRepeat , ButtonEventNone } |
| enum | AxisFunction_t { rollFunction , pitchFunction , yawFunction , throttleFunction , pitchExtensionFunction , rollExtensionFunction , aux1ExtensionFunction , aux2ExtensionFunction , aux3ExtensionFunction , aux4ExtensionFunction , aux5ExtensionFunction , aux6ExtensionFunction , maxAxisFunction } |
| enum | HatDirection : quint8 { HatCentered = 0x00 , HatUp = 0x01 , HatRight = 0x02 , HatDown = 0x04 , HatLeft = 0x08 , HatRightUp = HatRight | HatUp , HatRightDown = HatRight | HatDown , HatLeftUp = HatLeft | HatUp , HatLeftDown = HatLeft | HatDown } |
| Standard gamepad hat/D-pad directions. More... | |
| enum | GamepadButton { ButtonA = 0 , ButtonB = 1 , ButtonX = 2 , ButtonY = 3 , ButtonBack = 4 , ButtonGuide = 5 , ButtonStart = 6 , ButtonLeftStick = 7 , ButtonRightStick = 8 , ButtonLeftShoulder = 9 , ButtonRightShoulder = 10 , ButtonDPadUp = 11 , ButtonDPadDown = 12 , ButtonDPadLeft = 13 , ButtonDPadRight = 14 } |
| Standard gamepad button indices. More... | |
| enum | GamepadAxis { AxisLeftX = 0 , AxisLeftY = 1 , AxisRightX = 2 , AxisRightY = 3 , AxisTriggerLeft = 4 , AxisTriggerRight = 5 } |
| Standard gamepad axis indices. More... | |
Public Attributes inherited from Joystick | |
| QString name READ name int | axisCount |
| QString name READ name int int | buttonCount |
| QString name READ name int int int | hatCount |
| QString name READ name int int int QObject * | parent = nullptr) |
Static Public Attributes inherited from Joystick | |
| static constexpr int | AxisMin = -32768 |
| static constexpr int | AxisMax = 32767 |
Protected Attributes inherited from Joystick | |
| QString | _name |
| int | _axisCount = 0 |
| int | _buttonCount = 0 |
| int | _hatCount = 0 |
Definition at line 21 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(), Joystick::hatCount, 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 35 of file JoystickSDL.h.
Referenced by discover().
|
overridevirtual |
Reimplemented from Joystick.
Definition at line 740 of file JoystickSDL.cc.
|
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 |
Reimplemented from Joystick.
Definition at line 37 of file JoystickSDL.h.
|
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 |
Definition at line 36 of file JoystickSDL.h.
Referenced by discover().
|
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().
|
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 28 of file JoystickSDL.h.