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
c2f4dc0d
Commit
c2f4dc0d
authored
Jan 26, 2012
by
LM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small compile fixes, fixed image copy calls for non-visible Huds
parent
6c1ee41c
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
114 additions
and
8 deletions
+114
-8
qgroundcontrol.pri
qgroundcontrol.pri
+2
-0
HUD.cc
src/ui/HUD.cc
+7
-4
MAVLinkDecoder.cc
src/ui/MAVLinkDecoder.cc
+2
-1
QGCFirmwareUpdate.h
src/ui/QGCFirmwareUpdate.h
+14
-0
QGCToolBar.cc
src/ui/QGCToolBar.cc
+2
-2
QGCMapWidget.cc
src/ui/map/QGCMapWidget.cc
+62
-0
QGCMapWidget.h
src/ui/map/QGCMapWidget.h
+4
-0
Pixhawk3DWidget.h
src/ui/map3D/Pixhawk3DWidget.h
+14
-0
Q3DWidget.cc
src/ui/map3D/Q3DWidget.cc
+7
-1
No files found.
qgroundcontrol.pri
View file @
c2f4dc0d
...
...
@@ -250,6 +250,7 @@ message("Compiling for linux 32")
-lOpenThreads
DEFINES += QGC_OSG_ENABLED
DEFINES += QGC_OSG_QT_ENABLED
}
exists(/usr/local/include/google/protobuf) {
...
...
@@ -333,6 +334,7 @@ linux-g++-64 {
-lOpenThreads
DEFINES += QGC_OSG_ENABLED
DEFINES += QGC_OSG_QT_ENABLED
}
exists(/usr/local/include/google/protobuf) {
...
...
src/ui/HUD.cc
View file @
c2f4dc0d
...
...
@@ -1431,10 +1431,13 @@ void HUD::setPixels(int imgid, const unsigned char* imageData, int length, int s
void
HUD
::
copyImage
()
{
qDebug
()
<<
"HUD::copyImage()"
;
UAS
*
u
=
dynamic_cast
<
UAS
*>
(
this
->
uas
);
if
(
u
)
if
(
isVisible
())
{
this
->
glImage
=
QGLWidget
::
convertToGLFormat
(
u
->
getImage
());
qDebug
()
<<
"HUD::copyImage()"
;
UAS
*
u
=
dynamic_cast
<
UAS
*>
(
this
->
uas
);
if
(
u
)
{
this
->
glImage
=
QGLWidget
::
convertToGLFormat
(
u
->
getImage
());
}
}
}
src/ui/MAVLinkDecoder.cc
View file @
c2f4dc0d
...
...
@@ -27,8 +27,9 @@ MAVLinkDecoder::MAVLinkDecoder(MAVLinkProtocol* protocol, QObject *parent) :
messageFilter
.
insert
(
MAVLINK_MSG_ID_MISSION_ITEM
,
false
);
messageFilter
.
insert
(
MAVLINK_MSG_ID_MISSION_COUNT
,
false
);
messageFilter
.
insert
(
MAVLINK_MSG_ID_MISSION_ACK
,
false
);
#ifdef MAVLINK_ENABLED_PIXHAWK
messageFilter
.
insert
(
MAVLINK_MSG_ID_DATA_STREAM
,
false
);
#ifdef MAVLINK_ENABLED_PIXHAWK
messageFilter
.
insert
(
MAVLINK_MSG_ID_ENCAPSULATED_DATA
,
false
);
messageFilter
.
insert
(
MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE
,
false
);
#endif
messageFilter
.
insert
(
MAVLINK_MSG_ID_EXTENDED_MESSAGE
,
false
);
...
...
src/ui/QGCFirmwareUpdate.h
View file @
c2f4dc0d
...
...
@@ -17,9 +17,23 @@ public:
protected:
void
changeEvent
(
QEvent
*
e
);
void
showEvent
(
QShowEvent
*
event
)
{
QWidget
::
showEvent
(
event
);
emit
visibilityChanged
(
true
);
}
void
hideEvent
(
QHideEvent
*
event
)
{
QWidget
::
hideEvent
(
event
);
emit
visibilityChanged
(
false
);
}
private:
Ui
::
QGCFirmwareUpdate
*
ui
;
signals:
void
visibilityChanged
(
bool
visible
);
};
#endif // QGCFIRMWAREUPDATE_H
src/ui/QGCToolBar.cc
View file @
c2f4dc0d
...
...
@@ -374,6 +374,6 @@ void QGCToolBar::receiveTextMessage(int uasid, int componentid, int severity, QS
QGCToolBar
::~
QGCToolBar
()
{
delete
toggleLoggingAction
;
delete
logReplayAction
;
if
(
toggleLoggingAction
)
toggleLoggingAction
->
deleteLater
()
;
if
(
logReplayAction
)
logReplayAction
->
deleteLater
()
;
}
src/ui/map/QGCMapWidget.cc
View file @
c2f4dc0d
...
...
@@ -284,6 +284,68 @@ void QGCMapWidget::updateGlobalPosition()
}
}
void
QGCMapWidget
::
updateLocalPosition
()
{
QList
<
UASInterface
*>
systems
=
UASManager
::
instance
()
->
getUASList
();
foreach
(
UASInterface
*
system
,
systems
)
{
// Get reference to graphic UAV item
mapcontrol
::
UAVItem
*
uav
=
GetUAV
(
system
->
getUASID
());
// Check if reference is valid, else create a new one
if
(
uav
==
NULL
)
{
MAV2DIcon
*
newUAV
=
new
MAV2DIcon
(
map
,
this
,
system
);
AddUAV
(
system
->
getUASID
(),
newUAV
);
uav
=
newUAV
;
uav
->
SetTrailTime
(
1
);
uav
->
SetTrailDistance
(
5
);
uav
->
SetTrailType
(
mapcontrol
::
UAVTrailType
::
ByTimeElapsed
);
}
// Set new lat/lon position of UAV icon
double
latitude
=
UASManager
::
instance
()
->
getHomeLatitude
();
double
longitude
=
UASManager
::
instance
()
->
getHomeLongitude
();
double
altitude
=
UASManager
::
instance
()
->
getHomeAltitude
();
internals
::
PointLatLng
pos_lat_lon
=
internals
::
PointLatLng
(
system
->
getLatitude
(),
system
->
getLongitude
());
uav
->
SetUAVPos
(
pos_lat_lon
,
system
->
getAltitude
());
// Follow status
if
(
followUAVEnabled
&&
system
->
getUASID
()
==
followUAVID
)
SetCurrentPosition
(
pos_lat_lon
);
// Convert from radians to degrees and apply
uav
->
SetUAVHeading
((
system
->
getYaw
()
/
M_PI
)
*
180.0
f
);
}
}
void
QGCMapWidget
::
updateLocalPositionEstimates
()
{
QList
<
UASInterface
*>
systems
=
UASManager
::
instance
()
->
getUASList
();
foreach
(
UASInterface
*
system
,
systems
)
{
// Get reference to graphic UAV item
mapcontrol
::
UAVItem
*
uav
=
GetUAV
(
system
->
getUASID
());
// Check if reference is valid, else create a new one
if
(
uav
==
NULL
)
{
MAV2DIcon
*
newUAV
=
new
MAV2DIcon
(
map
,
this
,
system
);
AddUAV
(
system
->
getUASID
(),
newUAV
);
uav
=
newUAV
;
uav
->
SetTrailTime
(
1
);
uav
->
SetTrailDistance
(
5
);
uav
->
SetTrailType
(
mapcontrol
::
UAVTrailType
::
ByTimeElapsed
);
}
// Set new lat/lon position of UAV icon
double
latitude
=
UASManager
::
instance
()
->
getHomeLatitude
();
double
longitude
=
UASManager
::
instance
()
->
getHomeLongitude
();
double
altitude
=
UASManager
::
instance
()
->
getHomeAltitude
();
internals
::
PointLatLng
pos_lat_lon
=
internals
::
PointLatLng
(
system
->
getLatitude
(),
system
->
getLongitude
());
uav
->
SetUAVPos
(
pos_lat_lon
,
system
->
getAltitude
());
// Follow status
if
(
followUAVEnabled
&&
system
->
getUASID
()
==
followUAVID
)
SetCurrentPosition
(
pos_lat_lon
);
// Convert from radians to degrees and apply
uav
->
SetUAVHeading
((
system
->
getYaw
()
/
M_PI
)
*
180.0
f
);
}
}
void
QGCMapWidget
::
updateSystemSpecs
(
int
uas
)
{
...
...
src/ui/map/QGCMapWidget.h
View file @
c2f4dc0d
...
...
@@ -46,6 +46,10 @@ public slots:
void
updateGlobalPosition
(
UASInterface
*
uas
,
double
lat
,
double
lon
,
double
alt
,
quint64
usec
);
/** @brief Update the global position of all systems */
void
updateGlobalPosition
();
/** @brief Update the local position and draw it converted to GPS reference */
void
updateLocalPosition
();
/** @brief Update the local position estimates (individual sensors) and draw it converted to GPS reference */
void
updateLocalPositionEstimates
();
/** @brief Update the type, size, etc. of this system */
void
updateSystemSpecs
(
int
uas
);
/** @brief Change current system in focus / editing */
...
...
src/ui/map3D/Pixhawk3DWidget.h
View file @
c2f4dc0d
...
...
@@ -85,9 +85,23 @@ protected:
virtual
void
display
(
void
);
virtual
void
keyPressEvent
(
QKeyEvent
*
event
);
virtual
void
mousePressEvent
(
QMouseEvent
*
event
);
void
showEvent
(
QShowEvent
*
event
)
{
QWidget
::
showEvent
(
event
);
emit
visibilityChanged
(
true
);
}
void
hideEvent
(
QHideEvent
*
event
)
{
QWidget
::
hideEvent
(
event
);
emit
visibilityChanged
(
false
);
}
UASInterface
*
uas
;
signals:
void
visibilityChanged
(
bool
visible
);
private:
void
getPose
(
double
&
x
,
double
&
y
,
double
&
z
,
double
&
roll
,
double
&
pitch
,
double
&
yaw
,
...
...
src/ui/map3D/Q3DWidget.cc
View file @
c2f4dc0d
...
...
@@ -35,7 +35,9 @@ This file is part of the QGROUNDCONTROL project
#include <osg/Geometry>
#include <osg/LineWidth>
#include <osg/MatrixTransform>
#ifdef QGC_OSG_QT_ENABLED
#include <osgQt/QFontImplementation>
#endif
#ifdef Q_OS_MACX
#include <Carbon/Carbon.h>
#endif
...
...
@@ -57,9 +59,13 @@ Q3DWidget::Q3DWidget(QWidget* parent)
cameraParams
.
cameraFov
=
30.0
f
;
cameraParams
.
minClipRange
=
1.0
f
;
cameraParams
.
maxClipRange
=
10000.0
f
;
#ifdef QGC_OSG_QT_ENABLED
osg
::
ref_ptr
<
osgText
::
Font
::
FontImplementation
>
fontImpl
;
fontImpl
=
new
osgQt
::
QFontImplementation
(
QFont
(
":/general/vera.ttf"
));
#else
osg
::
ref_ptr
<
osgText
::
Font
::
FontImplementation
>
fontImpl
;
fontImpl
=
0
;
//new osgText::Font::Font("images/Vera.ttf");
#endif
font
=
new
osgText
::
Font
(
fontImpl
);
osgGW
=
new
osgViewer
::
GraphicsWindowEmbedded
(
0
,
0
,
width
(),
height
());
...
...
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