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
e6d7dec4
Commit
e6d7dec4
authored
Jun 01, 2010
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added map view, fixed audio output
parent
77ec7b8e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
7 deletions
+62
-7
GAudioOutput.cc
src/GAudioOutput.cc
+1
-0
PxQuadMAV.cc
src/uas/PxQuadMAV.cc
+1
-1
UASInterface.h
src/uas/UASInterface.h
+1
-1
MapWidget.cc
src/ui/MapWidget.cc
+53
-4
MapWidget.h
src/ui/MapWidget.h
+6
-1
No files found.
src/GAudioOutput.cc
View file @
e6d7dec4
...
...
@@ -197,6 +197,7 @@ bool GAudioOutput::startEmergency()
// Beep immediately and then start timer
beep
();
emergencyTimer
->
start
(
1500
);
QTimer
::
singleShot
(
5000
,
this
,
SLOT
(
stopEmergency
()));
}
return
true
;
}
...
...
src/uas/PxQuadMAV.cc
View file @
e6d7dec4
...
...
@@ -55,8 +55,8 @@ void PxQuadMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
emit
valueChanged
(
uasId
,
str
+
".x"
,
vect
.
x
,
MG
::
TIME
::
getGroundTimeNow
());
emit
valueChanged
(
uasId
,
str
+
".y"
,
vect
.
y
,
MG
::
TIME
::
getGroundTimeNow
());
emit
valueChanged
(
uasId
,
str
+
".z"
,
vect
.
z
,
MG
::
TIME
::
getGroundTimeNow
());
break
;
}
break
;
default:
// Do nothing
break
;
...
...
src/uas/UASInterface.h
View file @
e6d7dec4
...
...
@@ -289,7 +289,7 @@ signals:
void
attitudeChanged
(
UASInterface
*
,
double
roll
,
double
pitch
,
double
yaw
,
quint64
usec
);
void
attitudeThrustSetPointChanged
(
UASInterface
*
,
double
rollDesired
,
double
pitchDesired
,
double
yawDesired
,
double
thrustDesired
,
quint64
usec
);
void
localPositionChanged
(
UASInterface
*
,
double
x
,
double
y
,
double
z
,
quint64
usec
);
void
globalPositionChanged
(
UASInterface
*
,
double
l
on
,
double
lat
,
double
alt
,
quint64
usec
);
void
globalPositionChanged
(
UASInterface
*
,
double
l
at
,
double
lon
,
double
alt
,
quint64
usec
);
void
speedChanged
(
UASInterface
*
,
double
x
,
double
y
,
double
z
,
quint64
usec
);
void
imageStarted
(
int
imgid
,
int
width
,
int
height
,
int
depth
,
int
channels
);
void
imageDataReceived
(
int
imgid
,
const
unsigned
char
*
imageData
,
int
length
,
int
startIndex
);
...
...
src/ui/MapWidget.cc
View file @
e6d7dec4
...
...
@@ -31,6 +31,8 @@ This file is part of the PIXHAWK project
#include "MapWidget.h"
#include "ui_MapWidget.h"
#include "UASInterface.h"
#include "UASManager.h"
MapWidget
::
MapWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
),
...
...
@@ -54,7 +56,7 @@ MapWidget::MapWidget(QWidget *parent) :
//GoogleSatMapAdapter* gSatAdapter = new GoogleSatMapAdapter();
// create a layer with the mapadapter and type MapLayer
Layer
*
osmLayer
=
new
Layer
(
"Custom Layer"
,
osmAdapter
,
Layer
::
MapLayer
);
osmLayer
=
new
Layer
(
"Custom Layer"
,
osmAdapter
,
Layer
::
MapLayer
);
//Layer* gSatLayer = new Layer("Custom Layer", gSatAdapter, Layer::MapLayer);
// add Layer to the MapControl
...
...
@@ -97,20 +99,67 @@ MapWidget::MapWidget(QWidget *parent) :
//gm->start();
mc
->
setZoom
(
3
);
connect
(
UASManager
::
instance
(),
SIGNAL
(
UASCreated
(
UASInterface
*
)),
this
,
SLOT
(
addUAS
(
UASInterface
*
)));
}
MapWidget
::~
MapWidget
()
{
delete
m_ui
;
}
/**
*
* @param uas the UAS/MAV to monitor/display with the HUD
*/
void
MapWidget
::
addUAS
(
UASInterface
*
uas
)
{
mav
=
uas
;
}
void
MapWidget
::
updateGlobalPosition
(
UASInterface
*
uas
,
double
lat
,
double
lon
,
double
alt
,
quint64
usec
)
{
Q_UNUSED
(
usec
);
// create a LineString
QList
<
Point
*>
points
;
// Points with a circle
// A QPen can be used to customize the
QPen
*
pointpen
=
new
QPen
(
QColor
(
0
,
255
,
0
));
pointpen
->
setWidth
(
3
);
points
.
append
(
new
CirclePoint
(
lat
,
lon
,
alt
,
uas
->
getUASName
(),
Point
::
Middle
,
pointpen
));
// points.append(new CirclePoint(8.275145, 50.016992, 15, "Wiesbaden-Mainz-Kastel, Johannes-Goßner-Straße", Point::Middle, pointpen));
// points.append(new CirclePoint(8.270476, 50.021426, 15, "Wiesbaden-Mainz-Kastel, Ruthof", Point::Middle, pointpen));
// // "Blind" Points
// points.append(new Point(8.266445, 50.025913, "Wiesbaden-Mainz-Kastel, Mudra Kaserne"));
// points.append(new Point(8.260378, 50.030345, "Wiesbaden-Mainz-Amoneburg, Dyckerhoffstraße"));
// A QPen also can use transparency
QPen
*
linepen
=
new
QPen
(
QColor
(
0
,
0
,
255
,
100
));
linepen
->
setWidth
(
5
);
// Add the Points and the QPen to a LineString
LineString
*
ls
=
new
LineString
(
points
,
"Path"
,
linepen
);
// Add the LineString to the layer
osmLayer
->
addGeometry
(
ls
);
// Connect click events of the layer to this object
//connect(osmLayer, SIGNAL(geometryClicked(Geometry*, QPoint)),
// this, SLOT(geometryClicked(Geometry*, QPoint)));
// Sets the view to the interesting area
//QList<QPointF> view;
//view.append(QPointF(8.24764, 50.0319));
//view.append(QPointF(8.28412, 49.9998));
// mc->setView(view);
updatePosition
(
0
,
lat
,
lon
);
}
void
MapWidget
::
updatePosition
(
float
time
,
QPointF
coordinate
)
void
MapWidget
::
updatePosition
(
float
time
,
double
lat
,
double
lon
)
{
gpsposition
->
setText
(
QString
::
number
(
time
)
+
" / "
+
QString
::
number
(
coordinate
.
x
())
+
" / "
+
QString
::
number
(
coordinate
.
y
()
));
gpsposition
->
setText
(
QString
::
number
(
time
)
+
" / "
+
QString
::
number
(
lat
)
+
" / "
+
QString
::
number
(
lon
));
if
(
followgps
->
isChecked
())
{
mc
->
setView
(
coordinate
);
mc
->
setView
(
QPointF
(
lat
,
lon
)
);
}
}
...
...
src/ui/MapWidget.h
View file @
e6d7dec4
...
...
@@ -34,6 +34,7 @@ This file is part of the PIXHAWK project
#include <QtGui/QWidget>
#include "qmapcontrol.h"
#include "UASInterface.h"
namespace
Ui
{
class
MapWidget
;
...
...
@@ -48,7 +49,9 @@ public:
~
MapWidget
();
public
slots
:
void
updatePosition
(
float
time
,
QPointF
coordinate
);
void
addUAS
(
UASInterface
*
uas
);
void
updateGlobalPosition
(
UASInterface
*
uas
,
double
lat
,
double
lon
,
double
alt
,
quint64
usec
);
void
updatePosition
(
float
time
,
double
lat
,
double
lon
);
protected:
void
changeEvent
(
QEvent
*
e
);
...
...
@@ -68,6 +71,8 @@ protected:
Layer
*
osmLayer
;
Layer
*
gSatLayer
;
UASInterface
*
mav
;
private:
Ui
::
MapWidget
*
m_ui
;
};
...
...
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