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
16e91924
Commit
16e91924
authored
Mar 13, 2016
by
Don Gagne
Browse files
Merge pull request #3005 from DonLakeFlyer/MoreCompass
Better param reset for APM compass cal
parents
bbdf6dde
23acfb63
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/AutoPilotPlugins/APM/APMCompassCal.cc
View file @
16e91924
...
...
@@ -624,21 +624,17 @@ void APMCompassCal::startCalibration(void)
const
char
*
deviceIdParam
=
CalWorkerThread
::
rgCompassParams
[
i
][
3
];
if
(
plugin
->
parameterExists
(
-
1
,
deviceIdParam
))
{
if
(
plugin
->
getParameterFact
(
-
1
,
deviceIdParam
)
->
rawValue
().
toInt
()
>
0
)
{
for
(
int
j
=
0
;
j
<
3
;
j
++
)
{
const
char
*
offsetParam
=
CalWorkerThread
::
rgCompassParams
[
i
][
j
];
if
(
plugin
->
parameterExists
(
-
1
,
offsetParam
))
{
Fact
*
paramFact
=
plugin
->
getParameterFact
(
-
1
,
offsetParam
);
_rgSavedCompassOffsets
[
i
][
j
]
=
paramFact
->
rawValue
().
toFloat
();
paramFact
->
setRawValue
(
0.0
);
goto
has_compass
;
}
}
_calWorkerThread
->
rgCompassAvailable
[
i
]
=
plugin
->
getParameterFact
(
-
1
,
deviceIdParam
)
->
rawValue
().
toInt
()
>
0
;
for
(
int
j
=
0
;
j
<
3
;
j
++
)
{
const
char
*
offsetParam
=
CalWorkerThread
::
rgCompassParams
[
i
][
j
];
Fact
*
paramFact
=
plugin
->
getParameterFact
(
-
1
,
offsetParam
);
_rgSavedCompassOffsets
[
i
][
j
]
=
paramFact
->
rawValue
().
toFloat
();
paramFact
->
setRawValue
(
0.0
);
}
}
else
{
_calWorkerThread
->
rgCompassAvailable
[
i
]
=
false
;
}
_calWorkerThread
->
rgCompassAvailable
[
i
]
=
false
;
has_compass:
qCDebug
(
APMCompassCalLog
)
<<
QStringLiteral
(
"Compass %1 available: %2"
).
arg
(
i
).
arg
(
_calWorkerThread
->
rgCompassAvailable
[
i
]);
}
...
...
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