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
5e416d5e
Commit
5e416d5e
authored
May 05, 2010
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issues with loss counting, added support for usec timestamps
parent
70692347
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
MG.h
src/MG.h
+18
-0
MAVLinkProtocol.cc
src/comm/MAVLinkProtocol.cc
+2
-3
No files found.
src/MG.h
View file @
5e416d5e
...
...
@@ -303,6 +303,24 @@ namespace MG
return
static_cast
<
quint64
>
(
milliseconds
+
time
.
time
().
msec
());
}
/**
* @brief Convenience method to get the milliseconds time stamp for now
*
* The timestamp is created at the instant of calling this method. It is
* defined as the number of milliseconds since unix epoch, which is
* 1.1.1970, 00:00 UTC.
*
* @return The number of milliseconds elapsed since unix epoch
* @deprecated Will the replaced by time helper class
**/
static
quint64
getGroundTimeNowUsecs
()
{
QDateTime
time
=
QDateTime
::
currentDateTime
();
time
=
time
.
toUTC
();
/* Return seconds and milliseconds, in milliseconds unit */
quint64
microseconds
=
time
.
toTime_t
()
*
static_cast
<
quint64
>
(
1000000
);
return
static_cast
<
quint64
>
(
microseconds
+
(
time
.
time
().
msec
()
*
1000
));
}
/*tatic quint64 getMissionTimeUsecs()
{
;
...
...
src/comm/MAVLinkProtocol.cc
View file @
5e416d5e
...
...
@@ -149,7 +149,7 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link)
}
int
safeguard
=
0
;
//qDebug() << "SYSID" << message.sysid << "COMPID" << message.compid << "LASTINDEX" << lastIndex[message.sysid][message.compid] << "SEQ" << message.seq;
//qDebug() << "SYSID" << message.sysid << "COMPID" << message.compid << "
MSGID" << message.msgid << "
LASTINDEX" << lastIndex[message.sysid][message.compid] << "SEQ" << message.seq;
while
(
lastIndex
[
message
.
sysid
][
message
.
compid
]
!=
message
.
seq
&&
safeguard
<
1
)
{
if
(
lastIndex
[
message
.
sysid
][
message
.
compid
]
==
255
)
...
...
@@ -171,13 +171,12 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link)
// while (lastCompIndex->value(message.compid, 0)+1 )
// }
//if ()
if
(
lastLoss
!=
totalLossCounter
)
if
(
lastLoss
!=
totalLossCounter
||
(
totalReceiveCounter
/
64
)
==
0
)
{
// Calculate new loss ratio
// Receive loss
float
receiveLoss
=
(
double
)
totalLossCounter
/
(
double
)(
totalReceiveCounter
+
totalLossCounter
);
receiveLoss
*=
100.0
f
;
qDebug
()
<<
"LOSS"
<<
receiveLoss
;
emit
receiveLossChanged
(
receiveLoss
);
}
...
...
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