From 72387f01ea14b76e04832674de3e647f951d6c66 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 3 Sep 2015 09:36:34 -0700 Subject: [PATCH 1/2] Allow multiple QGC_LOGGING_CATEGORY in one file --- src/QGCLoggingCategory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/QGCLoggingCategory.h b/src/QGCLoggingCategory.h index a77ad83..b31de01 100644 --- a/src/QGCLoggingCategory.h +++ b/src/QGCLoggingCategory.h @@ -37,7 +37,7 @@ Q_DECLARE_LOGGING_CATEGORY(FirmwareUpgradeLog) /// This is a QGC specific replacement for Q_LOGGING_CATEGORY. It will register the category name into a /// global list. It's usage is the same as Q_LOGGING_CATEOGRY. #define QGC_LOGGING_CATEGORY(name, ...) \ - static QGCLoggingCategory qgcCategory(__VA_ARGS__); \ + static QGCLoggingCategory qgcCategory ## name (__VA_ARGS__); \ Q_LOGGING_CATEGORY(name, __VA_ARGS__) class QGCLoggingCategoryRegister From 7906286c93dc7324ed3d372e594f58ce55465d79 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 3 Sep 2015 09:36:56 -0700 Subject: [PATCH 2/2] Joystick value logging, Fix for center throttle zero --- src/Joystick/Joystick.cc | 4 +++- src/Joystick/Joystick.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Joystick/Joystick.cc b/src/Joystick/Joystick.cc index a1017cd..04bea5a 100644 --- a/src/Joystick/Joystick.cc +++ b/src/Joystick/Joystick.cc @@ -38,6 +38,7 @@ #endif QGC_LOGGING_CATEGORY(JoystickLog, "JoystickLog") +QGC_LOGGING_CATEGORY(JoystickValuesLog, "JoystickValuesLog") const char* Joystick::_settingsGroup = "Joysticks"; const char* Joystick::_calibratedSettingsKey = "Calibrated"; @@ -298,7 +299,6 @@ void Joystick::run(void) // Adjust throttle to 0:1 range if (_throttleMode == ThrottleModeCenterZero) { throttle = std::max(0.0f, throttle); - throttle = (throttle * 2.0f) - 1.0f; } else { throttle = (throttle + 1.0f) / 2.0f; } @@ -345,6 +345,8 @@ void Joystick::run(void) _lastButtonBits = newButtonBits; + qCDebug(JoystickValuesLog) << "roll:pitch:yaw:throttle" << roll << -pitch << yaw << throttle; + emit manualControl(roll, -pitch, yaw, throttle, buttonPressedBits, activeVehicle->joystickMode()); } diff --git a/src/Joystick/Joystick.h b/src/Joystick/Joystick.h index 178c0eb..46af7ed 100644 --- a/src/Joystick/Joystick.h +++ b/src/Joystick/Joystick.h @@ -31,6 +31,7 @@ #include "Vehicle.h" Q_DECLARE_LOGGING_CATEGORY(JoystickLog) +Q_DECLARE_LOGGING_CATEGORY(JoystickValuesLog) class Joystick : public QThread {