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
8f2ae9ef
Commit
8f2ae9ef
authored
Sep 05, 2012
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a long-lasting issue with confusing ground time / non ground time
parent
d28aa046
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
UAS.cc
src/uas/UAS.cc
+23
-1
UAS.h
src/uas/UAS.h
+2
-0
No files found.
src/uas/UAS.cc
View file @
8f2ae9ef
...
...
@@ -104,7 +104,9 @@ UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(),
nedPosGlobalOffset
(
0
,
0
,
0
),
nedAttGlobalOffset
(
0
,
0
,
0
),
connectionLost
(
false
),
lastVoltageWarning
(
0
)
lastVoltageWarning
(
0
),
lastNonNullTime
(
0
),
onboardTimeOffsetInvalidCount
(
0
)
{
for
(
unsigned
int
i
=
0
;
i
<
255
;
++
i
)
...
...
@@ -1533,6 +1535,26 @@ quint64 UAS::getUnixTimeFromMs(quint64 time)
*/
quint64
UAS
::
getUnixTime
(
quint64
time
)
{
// Check if the offset estimation likely went wrong
// and we're talking to a new instance / the system
// has rebooted. Only reset if this is consistent.
if
(
time
!=
0
&&
lastNonNullTime
>
time
)
{
onboardTimeOffsetInvalidCount
++
;
}
else
if
(
lastNonNullTime
<
time
)
{
onboardTimeOffsetInvalidCount
=
0
;
}
// Reset onboard time offset estimation, since it seems to be really off
if
(
onboardTimeOffsetInvalidCount
>
20
)
{
onboardTimeOffset
=
0
;
onboardTimeOffsetInvalidCount
=
0
;
}
quint64
ret
=
0
;
if
(
attitudeStamped
)
{
...
...
src/uas/UAS.h
View file @
8f2ae9ef
...
...
@@ -674,6 +674,8 @@ protected:
bool
connectionLost
;
///< Flag indicates a timed out connection
quint64
connectionLossTime
;
///< Time the connection was interrupted
quint64
lastVoltageWarning
;
///< Time at which the last voltage warning occured
quint64
lastNonNullTime
;
///< The last timestamp from the MAV that was not null
unsigned
int
onboardTimeOffsetInvalidCount
;
///< Count when the offboard time offset estimation seemed wrong
protected
slots
:
/** @brief Write settings to disk */
...
...
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