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
a15b46b8
Unverified
Commit
a15b46b8
authored
Jun 25, 2018
by
Beat Küng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AirMapTelemetry: rate-limit telemetry to 5Hz
parent
ef729dee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
AirMapTelemetry.cc
src/Airmap/AirMapTelemetry.cc
+7
-0
AirMapTelemetry.h
src/Airmap/AirMapTelemetry.h
+2
-0
No files found.
src/Airmap/AirMapTelemetry.cc
View file @
a15b46b8
...
...
@@ -67,6 +67,12 @@ AirMapTelemetry::_handleGlobalPositionInt(const mavlink_message_t& message)
if
(
!
isTelemetryStreaming
())
{
return
;
}
// rate-limit updates to 5 Hz
if
(
!
_timerLastSent
.
hasExpired
(
200
))
{
return
;
}
_timerLastSent
.
restart
();
mavlink_global_position_int_t
globalPosition
;
mavlink_msg_global_position_int_decode
(
&
message
,
&
globalPosition
);
Telemetry
::
Position
position
{
...
...
@@ -123,6 +129,7 @@ AirMapTelemetry::startTelemetryStream(const QString& flightID)
QString
::
fromStdString
(
result
.
error
().
message
()),
description
);
}
});
_timerLastSent
.
start
();
}
//-----------------------------------------------------------------------------
...
...
src/Airmap/AirMapTelemetry.h
View file @
a15b46b8
...
...
@@ -15,6 +15,7 @@
#include <QGCMAVLink.h>
#include <QObject>
#include <QElapsedTimer>
/// Class to send telemetry data to AirMap
class
AirMapTelemetry
:
public
QObject
,
public
LifetimeChecker
...
...
@@ -51,5 +52,6 @@ private:
std
::
string
_key
;
///< key for AES encryption (16 bytes)
QString
_flightID
;
float
_lastHdop
=
1
.
f
;
QElapsedTimer
_timerLastSent
;
};
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