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
dca9e3bf
Commit
dca9e3bf
authored
Nov 24, 2015
by
Nate Weibley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix SI1K radio RSSI calculation to correctly represent received power
parent
135d0fac
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
11 deletions
+26
-11
MAVLinkProtocol.cc
src/comm/MAVLinkProtocol.cc
+18
-1
MAVLinkProtocol.h
src/comm/MAVLinkProtocol.h
+2
-2
MainToolBarController.cc
src/ui/toolbar/MainToolBarController.cc
+4
-6
MainToolBarIndicators.qml
src/ui/toolbar/MainToolBarIndicators.qml
+2
-2
No files found.
src/comm/MAVLinkProtocol.cc
View file @
dca9e3bf
...
...
@@ -291,8 +291,25 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
// process telemetry status message
mavlink_radio_status_t
rstatus
;
mavlink_msg_radio_status_decode
(
&
message
,
&
rstatus
);
int
rssi
=
rstatus
.
rssi
,
remrssi
=
rstatus
.
remrssi
;
// 3DR Si1k radio needs rssi fields to be converted to dBm
if
(
message
.
sysid
==
'3'
&&
message
.
compid
==
'D'
)
{
/* Per the Si1K datasheet figure 23.25 and SI AN474 code
* samples the relationship between the RSSI register
* and received power is as follows:
*
* 10
* inputPower = rssi * ------ 127
* 19
*
* Additionally limit to the only realistic range [-120,0] dBm
*/
rssi
=
qMin
(
qMax
(
qRound
(
static_cast
<
qreal
>
(
rssi
)
/
1.9
-
127.0
),
-
120
),
0
);
remrssi
=
qMin
(
qMax
(
qRound
(
static_cast
<
qreal
>
(
remrssi
)
/
1.9
-
127.0
),
-
120
),
0
);
}
emit
radioStatusChanged
(
link
,
rstatus
.
rxerrors
,
rstatus
.
fixed
,
rs
tatus
.
rssi
,
rstatus
.
remrssi
,
emit
radioStatusChanged
(
link
,
rstatus
.
rxerrors
,
rstatus
.
fixed
,
rs
si
,
remrssi
,
rstatus
.
txbuf
,
rstatus
.
noise
,
rstatus
.
remnoise
);
}
...
...
src/comm/MAVLinkProtocol.h
View file @
dca9e3bf
...
...
@@ -269,8 +269,8 @@ signals:
*
* @param rxerrors receive errors
* @param fixed count of error corrected packets
* @param rssi local signal strength
* @param remrssi remote signal strength
* @param rssi local signal strength
in dBm
* @param remrssi remote signal strength
in dBm
* @param txbuf how full the tx buffer is as a percentage
* @param noise background noise level
* @param remnoise remote background noise level
...
...
src/ui/toolbar/MainToolBarController.cc
View file @
dca9e3bf
...
...
@@ -98,14 +98,12 @@ void MainToolBarController::_activeVehicleChanged(Vehicle* vehicle)
void
MainToolBarController
::
_telemetryChanged
(
LinkInterface
*
,
unsigned
,
unsigned
,
int
rssi
,
int
remrssi
,
unsigned
,
unsigned
,
unsigned
)
{
if
((
unsigned
)
_telemetryLRSSI
!=
rssi
)
{
// According to the Silabs data sheet, the RSSI value is 0.5db per bit
_telemetryLRSSI
=
rssi
>>
1
;
if
(
_telemetryLRSSI
!=
rssi
)
{
_telemetryLRSSI
=
rssi
;
emit
telemetryLRSSIChanged
(
_telemetryLRSSI
);
}
if
((
unsigned
)
_telemetryRRSSI
!=
remrssi
)
{
// According to the Silabs data sheet, the RSSI value is 0.5db per bit
_telemetryRRSSI
=
remrssi
>>
1
;
if
(
_telemetryRRSSI
!=
remrssi
)
{
_telemetryRRSSI
=
remrssi
;
emit
telemetryRRSSIChanged
(
_telemetryRRSSI
);
}
}
...
...
src/ui/toolbar/MainToolBarIndicators.qml
View file @
dca9e3bf
...
...
@@ -536,7 +536,7 @@ Row {
color: colorWhite
}
QGCLabel {
text: _controller.telemetryRRSSI + 'dB'
text: _controller.telemetryRRSSI + 'dB
m
'
width: getProportionalDimmension(30)
horizontalAlignment: Text.AlignRight
font.pixelSize: ScreenTools.smallFontPixelSize
...
...
@@ -553,7 +553,7 @@ Row {
color: colorWhite
}
QGCLabel {
text: _controller.telemetryLRSSI + 'dB'
text: _controller.telemetryLRSSI + 'dB
m
'
width: getProportionalDimmension(30)
horizontalAlignment: Text.AlignRight
font.pixelSize: ScreenTools.smallFontPixelSize
...
...
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