Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
11874ee9
Commit
11874ee9
authored
Nov 08, 2012
by
Thomas Gubler
Browse files
Flightgear HIL: Flightgear does not like NaN values, added a check before the output to Flightgear
parent
716915e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/comm/QGCFlightGearLink.cc
View file @
11874ee9
...
...
@@ -159,9 +159,16 @@ void QGCFlightGearLink::updateControls(uint64_t time, float rollAilerons, float
Q_UNUSED
(
systemMode
);
Q_UNUSED
(
navMode
);
QString
state
(
"%1
\t
%2
\t
%3
\t
%4
\t
%5
\n
"
);
state
=
state
.
arg
(
rollAilerons
).
arg
(
pitchElevator
).
arg
(
yawRudder
).
arg
(
true
).
arg
(
throttle
);
writeBytes
(
state
.
toAscii
().
constData
(),
state
.
length
());
if
(
!
isnan
(
rollAilerons
)
&&
!
isnan
(
pitchElevator
)
&&
!
isnan
(
yawRudder
)
&&
!
isnan
(
throttle
))
{
QString
state
(
"%1
\t
%2
\t
%3
\t
%4
\t
%5
\n
"
);
state
=
state
.
arg
(
rollAilerons
).
arg
(
pitchElevator
).
arg
(
yawRudder
).
arg
(
true
).
arg
(
throttle
);
writeBytes
(
state
.
toAscii
().
constData
(),
state
.
length
());
}
else
{
qDebug
()
<<
"HIL: Got NaN values from the hardware: isnan output: roll: "
<<
isnan
(
rollAilerons
)
<<
", pitch: "
<<
isnan
(
pitchElevator
)
<<
", yaw: "
<<
isnan
(
yawRudder
)
<<
", throttle: "
<<
isnan
(
throttle
);
}
//qDebug() << "Updated controls" << state;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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