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
97d9118c
Commit
97d9118c
authored
Jul 02, 2015
by
Don Gagne
Browse files
Merge pull request #1696 from dogmaphobic/lowpassRSSI
Low pass filter on RC RSSI
parents
3c8f0abb
b0e764ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/ui/toolbar/MainToolBar.cc
View file @
97d9118c
...
...
@@ -52,6 +52,7 @@ MainToolBar::MainToolBar(QWidget* parent)
,
_showBattery
(
true
)
,
_progressBarValue
(
0.0
f
)
,
_remoteRSSI
(
0
)
,
_remoteRSSIstore
(
100.0
)
,
_telemetryRRSSI
(
0
)
,
_telemetryLRSSI
(
0
)
,
_rollDownMessages
(
0
)
...
...
@@ -328,10 +329,16 @@ void MainToolBar::_telemetryChanged(LinkInterface*, unsigned, unsigned, unsigned
void
MainToolBar
::
_remoteControlRSSIChanged
(
uint8_t
rssi
)
{
// We only care if we haveone single connection
// We only care if we have
one single connection
if
(
_connectionCount
==
1
)
{
if
(
_remoteRSSI
!=
rssi
)
{
_remoteRSSI
=
rssi
;
// Low pass to git rid of jitter
_remoteRSSIstore
=
(
_remoteRSSIstore
*
0.9
f
)
+
((
float
)
rssi
*
0.1
);
uint8_t
filteredRSSI
=
(
uint8_t
)
ceil
(
_remoteRSSIstore
);
if
(
_remoteRSSIstore
<
0.1
)
{
filteredRSSI
=
0
;
}
if
(
_remoteRSSI
!=
filteredRSSI
)
{
_remoteRSSI
=
filteredRSSI
;
emit
remoteRSSIChanged
(
_remoteRSSI
);
}
}
...
...
src/ui/toolbar/MainToolBar.h
View file @
97d9118c
...
...
@@ -134,6 +134,7 @@ private:
bool
_showBattery
;
float
_progressBarValue
;
int
_remoteRSSI
;
double
_remoteRSSIstore
;
int
_telemetryRRSSI
;
int
_telemetryLRSSI
;
...
...
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