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
998e753c
Commit
998e753c
authored
Feb 23, 2012
by
Lionel Heng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added timeout to overlay visualization.
parent
63a6b200
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
4 deletions
+29
-4
GLOverlayGeode.cc
src/ui/map3D/GLOverlayGeode.cc
+13
-0
GLOverlayGeode.h
src/ui/map3D/GLOverlayGeode.h
+5
-0
Pixhawk3DWidget.cc
src/ui/map3D/Pixhawk3DWidget.cc
+11
-4
No files found.
src/ui/map3D/GLOverlayGeode.cc
View file @
998e753c
...
...
@@ -2,6 +2,7 @@
GLOverlayGeode
::
GLOverlayGeode
()
:
mDrawable
(
new
GLOverlayDrawable
)
,
mMessageTimestamp
(
0.0
)
{
addDrawable
(
mDrawable
);
}
...
...
@@ -21,6 +22,18 @@ GLOverlayGeode::coordinateFrameType(void) const
return
mCoordinateFrameType
;
}
void
GLOverlayGeode
::
setMessageTimestamp
(
qreal
timestamp
)
{
mMessageTimestamp
=
timestamp
;
}
qreal
GLOverlayGeode
::
messageTimestamp
(
void
)
const
{
return
mMessageTimestamp
;
}
GLOverlayGeode
::
GLOverlayDrawable
::
GLOverlayDrawable
()
{
setUseDisplayList
(
true
);
...
...
src/ui/map3D/GLOverlayGeode.h
View file @
998e753c
...
...
@@ -3,6 +3,7 @@
#include <mavlink_protobuf_manager.hpp>
#include <osg/Geode>
#include <QtGlobal>
class
GLOverlayGeode
:
public
osg
::
Geode
{
...
...
@@ -13,6 +14,9 @@ public:
px
::
GLOverlay
::
CoordinateFrameType
coordinateFrameType
(
void
)
const
;
void
setMessageTimestamp
(
qreal
timestamp
);
qreal
messageTimestamp
(
void
)
const
;
private:
class
GLOverlayDrawable
:
public
osg
::
Drawable
{
...
...
@@ -39,6 +43,7 @@ private:
osg
::
ref_ptr
<
GLOverlayDrawable
>
mDrawable
;
px
::
GLOverlay
::
CoordinateFrameType
mCoordinateFrameType
;
qreal
mMessageTimestamp
;
};
#endif // GLOVERLAYGEODE_H
src/ui/map3D/Pixhawk3DWidget.cc
View file @
998e753c
...
...
@@ -563,7 +563,8 @@ Pixhawk3DWidget::addOverlay(UASInterface *uas)
SystemContainer
&
systemData
=
mSystemContainerMap
[
systemId
];
px
::
GLOverlay
overlay
=
uas
->
getOverlay
();
qreal
receivedTimestamp
;
px
::
GLOverlay
overlay
=
uas
->
getOverlay
(
receivedTimestamp
);
QString
overlayName
=
QString
::
fromStdString
(
overlay
.
name
());
...
...
@@ -580,7 +581,9 @@ Pixhawk3DWidget::addOverlay(UASInterface *uas)
emit
overlayCreatedSignal
(
systemId
,
overlayName
);
}
systemData
.
overlayNodeMap
()[
overlayName
]
->
setOverlay
(
overlay
);
osg
::
ref_ptr
<
GLOverlayGeode
>&
overlayNode
=
systemData
.
overlayNodeMap
()[
overlayName
];
overlayNode
->
setOverlay
(
overlay
);
overlayNode
->
setMessageTimestamp
(
receivedTimestamp
);
}
#endif
...
...
@@ -953,11 +956,15 @@ Pixhawk3DWidget::update(void)
bool
displayOverlay
=
systemViewParams
->
displayOverlay
().
value
(
itOverlay
.
key
());
bool
visible
;
visible
=
(
overlayNode
->
coordinateFrameType
()
==
px
::
GLOverlay
::
GLOBAL
)
&&
displayOverlay
;
visible
=
(
overlayNode
->
coordinateFrameType
()
==
px
::
GLOverlay
::
GLOBAL
)
&&
displayOverlay
&&
(
QGC
::
groundTimeSeconds
()
-
overlayNode
->
messageTimestamp
()
<
kMessageTimeout
);
allocentricMap
->
setChildValue
(
overlayNode
,
visible
);
visible
=
(
overlayNode
->
coordinateFrameType
()
==
px
::
GLOverlay
::
LOCAL
)
&&
displayOverlay
;
visible
=
(
overlayNode
->
coordinateFrameType
()
==
px
::
GLOverlay
::
LOCAL
)
&&
displayOverlay
&&
(
QGC
::
groundTimeSeconds
()
-
overlayNode
->
messageTimestamp
()
<
kMessageTimeout
);;
rollingMap
->
setChildValue
(
overlayNode
,
visible
);
}
...
...
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