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
693bda3d
Unverified
Commit
693bda3d
authored
Jul 13, 2018
by
Don Gagne
Committed by
GitHub
Jul 13, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6634 from mavlink/handleRxRSSI
Properly handle (unavailable) RX RSSI
parents
b536725f
e200d622
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
10 deletions
+19
-10
GuidedActionsController.qml
src/FlightDisplay/GuidedActionsController.qml
+1
-1
Vehicle.cc
src/Vehicle/Vehicle.cc
+13
-5
RCRSSIIndicator.qml
src/ui/toolbar/RCRSSIIndicator.qml
+5
-4
No files found.
src/FlightDisplay/GuidedActionsController.qml
View file @
693bda3d
...
...
@@ -130,7 +130,7 @@ Item {
property
bool
_hideEmergenyStop
:
!
QGroundControl
.
corePlugin
.
options
.
guidedBarShowEmergencyStop
property
bool
_hideOrbit
:
!
QGroundControl
.
corePlugin
.
options
.
guidedBarShowOrbit
property
bool
_vehicleWasFlying
:
false
property
bool
_rcRSSIAvailable
:
_activeVehicle
?
_activeVehicle
.
rcRSSI
>
0
&&
_activeVehicle
.
rcRSSI
<
255
:
false
property
bool
_rcRSSIAvailable
:
_activeVehicle
?
_activeVehicle
.
rcRSSI
>
0
&&
_activeVehicle
.
rcRSSI
<
=
100
:
false
//Handy code for debugging state problems
property
bool
__debugGuidedStates
:
false
...
...
src/Vehicle/Vehicle.cc
View file @
693bda3d
...
...
@@ -110,7 +110,7 @@ Vehicle::Vehicle(LinkInterface* link,
,
_currentMessageType
(
MessageNone
)
,
_updateCount
(
0
)
,
_rcRSSI
(
255
)
,
_rcRSSIstore
(
255
)
,
_rcRSSIstore
(
255
.
)
,
_autoDisconnect
(
false
)
,
_flying
(
false
)
,
_landing
(
false
)
...
...
@@ -303,7 +303,7 @@ Vehicle::Vehicle(MAV_AUTOPILOT firmwareType,
,
_currentMessageType
(
MessageNone
)
,
_updateCount
(
0
)
,
_rcRSSI
(
255
)
,
_rcRSSIstore
(
255
)
,
_rcRSSIstore
(
255
.
)
,
_autoDisconnect
(
false
)
,
_flying
(
false
)
,
_landing
(
false
)
...
...
@@ -2446,10 +2446,18 @@ void Vehicle::_imageReady(UASInterface*)
void
Vehicle
::
_remoteControlRSSIChanged
(
uint8_t
rssi
)
{
if
(
_rcRSSIstore
<
0
||
_rcRSSIstore
>
100
)
{
_rcRSSIstore
=
rssi
;
//-- 0 <= rssi <= 100 - 255 means "invalid/unknown"
if
(
rssi
>
100
)
{
// Anything over 100 doesn't make sense
if
(
_rcRSSI
!=
255
)
{
_rcRSSI
=
255
;
emit
rcRSSIChanged
(
_rcRSSI
);
}
return
;
}
//-- Initialize it
if
(
_rcRSSIstore
==
255.
)
{
_rcRSSIstore
=
(
double
)
rssi
;
}
// Low pass to git rid of jitter
_rcRSSIstore
=
(
_rcRSSIstore
*
0.9
f
)
+
((
float
)
rssi
*
0.1
);
uint8_t
filteredRSSI
=
(
uint8_t
)
ceil
(
_rcRSSIstore
);
...
...
src/ui/toolbar/RCRSSIIndicator.qml
View file @
693bda3d
...
...
@@ -26,7 +26,8 @@ Item {
anchors.bottom
:
parent
.
bottom
visible
:
_activeVehicle
?
_activeVehicle
.
supportsRadio
:
true
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
bool
_rcRSSIAvailable
:
_activeVehicle
?
_activeVehicle
.
rcRSSI
>
0
&&
_activeVehicle
.
rcRSSI
<=
100
:
false
Component
{
id
:
rcRSSIInfo
...
...
@@ -54,7 +55,7 @@ Item {
GridLayout
{
id
:
rcrssiGrid
visible
:
_
activeVehicle
&&
_activeVehicle
.
rcRSSI
!=
255
visible
:
_
rcRSSIAvailable
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
columnSpacing
:
ScreenTools
.
defaultFontPixelWidth
columns
:
2
...
...
@@ -86,14 +87,14 @@ Item {
sourceSize.height
:
height
source
:
"
/qmlimages/RC.svg
"
fillMode
:
Image
.
PreserveAspectFit
opacity
:
_
activeVehicle
?
(((
_activeVehicle
.
rcRSSI
<
0
)
||
(
_activeVehicle
.
rcRSSI
>
100
))
?
0.5
:
1
)
:
0.5
opacity
:
_
rcRSSIAvailable
?
1
:
0.5
color
:
qgcPal
.
buttonText
}
SignalStrength
{
anchors.verticalCenter
:
parent
.
verticalCenter
size
:
parent
.
height
*
0.5
percent
:
_
activeVehicle
?
((
_activeVehicle
.
rcRSSI
>
100
)
?
0
:
_activeVehicle
.
rcRSSI
)
:
0
percent
:
_
rcRSSIAvailable
?
_activeVehicle
.
rcRSSI
:
0
}
}
...
...
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