Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
2140c8f9
Commit
2140c8f9
authored
Sep 03, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1828 from DonLakeFlyer/Joystick
Fix center stick zero throttle, add JoystickValuesLog
parents
5ad54f97
7906286c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
Joystick.cc
src/Joystick/Joystick.cc
+3
-1
Joystick.h
src/Joystick/Joystick.h
+1
-0
QGCLoggingCategory.h
src/QGCLoggingCategory.h
+1
-1
No files found.
src/Joystick/Joystick.cc
View file @
2140c8f9
...
...
@@ -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.0
f
,
throttle
);
throttle
=
(
throttle
*
2.0
f
)
-
1.0
f
;
}
else
{
throttle
=
(
throttle
+
1.0
f
)
/
2.0
f
;
}
...
...
@@ -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
());
}
...
...
src/Joystick/Joystick.h
View file @
2140c8f9
...
...
@@ -31,6 +31,7 @@
#include "Vehicle.h"
Q_DECLARE_LOGGING_CATEGORY
(
JoystickLog
)
Q_DECLARE_LOGGING_CATEGORY
(
JoystickValuesLog
)
class
Joystick
:
public
QThread
{
...
...
src/QGCLoggingCategory.h
View file @
2140c8f9
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment