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
8b4ecdd3
Commit
8b4ecdd3
authored
Jul 03, 2013
by
Bryant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Windows compilation of Joystick interface (MSVC doesn't support C99 & the NAN macro).
parent
134947f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
JoystickInput.cc
src/input/JoystickInput.cc
+8
-5
No files found.
src/input/JoystickInput.cc
View file @
8b4ecdd3
...
...
@@ -20,6 +20,9 @@
#include <QMutexLocker>
#include <QSettings>
#include <math.h>
#include <limits>
using
namespace
std
;
/**
* The coordinate frame of the joystick axis is the aeronautical frame like shown on this image:
...
...
@@ -473,10 +476,10 @@ void JoystickInput::run()
// Now signal an update for all UI together.
if
(
isEnabled
)
{
float
roll
=
rollAxis
>
-
1
?
joystickAxes
[
rollAxis
]
:
NAN
;
float
pitch
=
pitchAxis
>
-
1
?
joystickAxes
[
pitchAxis
]
:
NAN
;
float
yaw
=
yawAxis
>
-
1
?
joystickAxes
[
yawAxis
]
:
NAN
;
float
throttle
=
throttleAxis
>
-
1
?
joystickAxes
[
throttleAxis
]
:
NAN
;
float
roll
=
rollAxis
>
-
1
?
joystickAxes
[
rollAxis
]
:
numeric_limits
<
float
>::
quiet_NaN
()
;
float
pitch
=
pitchAxis
>
-
1
?
joystickAxes
[
pitchAxis
]
:
numeric_limits
<
float
>::
quiet_NaN
()
;
float
yaw
=
yawAxis
>
-
1
?
joystickAxes
[
yawAxis
]
:
numeric_limits
<
float
>::
quiet_NaN
()
;
float
throttle
=
throttleAxis
>
-
1
?
joystickAxes
[
throttleAxis
]
:
numeric_limits
<
float
>::
quiet_NaN
()
;
emit
joystickChanged
(
roll
,
pitch
,
yaw
,
throttle
,
xHat
,
yHat
,
joystickButtons
);
}
...
...
@@ -513,7 +516,7 @@ void JoystickInput::setActiveJoystick(int id)
joystickAxes
.
clear
();
for
(
int
i
=
0
;
i
<
joystickNumAxes
;
i
++
)
{
joystickAxes
.
append
(
NAN
);
joystickAxes
.
append
(
numeric_limits
<
float
>::
quiet_NaN
()
);
}
// Update cached joystick button values.
...
...
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