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
135996b3
Commit
135996b3
authored
Nov 26, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2276 from NaterGator/si1k-rssi
Fix telemetry radio RSSI calculation for SI1000 based modems
parents
ceaa61ac
dca9e3bf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
16 deletions
+31
-16
MAVLinkProtocol.cc
src/comm/MAVLinkProtocol.cc
+18
-1
MAVLinkProtocol.h
src/comm/MAVLinkProtocol.h
+3
-3
MainToolBarController.cc
src/ui/toolbar/MainToolBarController.cc
+7
-9
MainToolBarController.h
src/ui/toolbar/MainToolBarController.h
+1
-1
MainToolBarIndicators.qml
src/ui/toolbar/MainToolBarIndicators.qml
+2
-2
No files found.
src/comm/MAVLinkProtocol.cc
View file @
135996b3
...
...
@@ -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 @
135996b3
...
...
@@ -269,13 +269,13 @@ 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
*/
void
radioStatusChanged
(
LinkInterface
*
link
,
unsigned
rxerrors
,
unsigned
fixed
,
unsigned
rssi
,
unsigned
remrssi
,
void
radioStatusChanged
(
LinkInterface
*
link
,
unsigned
rxerrors
,
unsigned
fixed
,
int
rssi
,
int
remrssi
,
unsigned
txbuf
,
unsigned
noise
,
unsigned
remnoise
);
/// @brief Emitted when a temporary log file is ready for saving
...
...
src/ui/toolbar/MainToolBarController.cc
View file @
135996b3
...
...
@@ -52,8 +52,8 @@ MainToolBarController::MainToolBarController(QObject* parent)
// RSSI (didn't like standard connection)
connect
(
qgcApp
()
->
toolbox
()
->
mavlinkProtocol
(),
SIGNAL
(
radioStatusChanged
(
LinkInterface
*
,
unsigned
,
unsigned
,
unsigned
,
unsigned
,
unsigned
,
unsigned
,
unsigned
)),
this
,
SLOT
(
_telemetryChanged
(
LinkInterface
*
,
unsigned
,
unsigned
,
unsigned
,
unsigned
,
unsigned
,
unsigned
,
unsigned
)));
SIGNAL
(
radioStatusChanged
(
LinkInterface
*
,
unsigned
,
unsigned
,
int
,
int
,
unsigned
,
unsigned
,
unsigned
)),
this
,
SLOT
(
_telemetryChanged
(
LinkInterface
*
,
unsigned
,
unsigned
,
int
,
int
,
unsigned
,
unsigned
,
unsigned
)));
connect
(
qgcApp
()
->
toolbox
()
->
multiVehicleManager
(),
&
MultiVehicleManager
::
activeVehicleChanged
,
this
,
&
MainToolBarController
::
_activeVehicleChanged
);
}
...
...
@@ -96,16 +96,14 @@ void MainToolBarController::_activeVehicleChanged(Vehicle* vehicle)
}
}
void
MainToolBarController
::
_telemetryChanged
(
LinkInterface
*
,
unsigned
,
unsigned
,
unsigned
rssi
,
unsigned
remrssi
,
unsigned
,
unsigned
,
unsigned
)
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/MainToolBarController.h
View file @
135996b3
...
...
@@ -80,7 +80,7 @@ signals:
private
slots
:
void
_activeVehicleChanged
(
Vehicle
*
vehicle
);
void
_setProgressBarValue
(
float
value
);
void
_telemetryChanged
(
LinkInterface
*
link
,
unsigned
rxerrors
,
unsigned
fixed
,
unsigned
rssi
,
unsigned
remrssi
,
unsigned
txbuf
,
unsigned
noise
,
unsigned
remnoise
);
void
_telemetryChanged
(
LinkInterface
*
link
,
unsigned
rxerrors
,
unsigned
fixed
,
int
rssi
,
int
remrssi
,
unsigned
txbuf
,
unsigned
noise
,
unsigned
remnoise
);
void
_delayedShowToolBarMessage
(
void
);
private:
...
...
src/ui/toolbar/MainToolBarIndicators.qml
View file @
135996b3
...
...
@@ -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