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
6e00bdcc
Commit
6e00bdcc
authored
Dec 16, 2010
by
lm
Browse files
Options
Browse Files
Download
Plain Diff
Merged experimental and dev;
parents
c9a863b7
fbedfdc4
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
484 additions
and
94 deletions
+484
-94
qgroundcontrol.pro
qgroundcontrol.pro
+4
-2
Core.cc
src/Core.cc
+3
-0
QGC.h
src/QGC.h
+3
-0
MAVLinkSimulationLink.cc
src/comm/MAVLinkSimulationLink.cc
+8
-7
SerialLink.cc
src/comm/SerialLink.cc
+31
-6
Freenect.cc
src/input/Freenect.cc
+1
-1
PxQuadMAV.cc
src/uas/PxQuadMAV.cc
+1
-1
UAS.cc
src/uas/UAS.cc
+4
-3
HUD.cc
src/ui/HUD.cc
+13
-0
HUD.h
src/ui/HUD.h
+2
-0
MainWindow.cc
src/ui/MainWindow.cc
+289
-14
MainWindow.h
src/ui/MainWindow.h
+4
-1
MainWindow.ui
src/ui/MainWindow.ui
+3
-8
QGCMainWindowAPConfigurator.cc
src/ui/QGCMainWindowAPConfigurator.cc
+6
-0
QGCMainWindowAPConfigurator.h
src/ui/QGCMainWindowAPConfigurator.h
+18
-0
SerialConfigurationWindow.cc
src/ui/SerialConfigurationWindow.cc
+1
-0
XMLCommProtocolWidget.cc
src/ui/XMLCommProtocolWidget.cc
+6
-3
LinechartWidget.cc
src/ui/linechart/LinechartWidget.cc
+9
-1
LinechartWidget.h
src/ui/linechart/LinechartWidget.h
+2
-0
QGCGoogleEarthView.cc
src/ui/map3D/QGCGoogleEarthView.cc
+69
-46
QGCGoogleEarthView.h
src/ui/map3D/QGCGoogleEarthView.h
+6
-0
UASControlWidget.cc
src/ui/uas/UASControlWidget.cc
+1
-1
No files found.
qgroundcontrol.pro
View file @
6e00bdcc
...
...
@@ -249,7 +249,8 @@ HEADERS += src/MG.h \
src
/
ui
/
SlugsHilSim
.
h
\
src
/
ui
/
SlugsPIDControl
.
h
\
src
/
ui
/
SlugsVideoCamControl
.
h
\
src
/
ui
/
SlugsPadCameraControl
.
h
src
/
ui
/
SlugsPadCameraControl
.
h
\
src
/
ui
/
QGCMainWindowAPConfigurator
.
h
contains
(
DEPENDENCIES_PRESENT
,
osg
)
{
message
(
"Including headers for OpenSceneGraph"
)
...
...
@@ -359,7 +360,8 @@ SOURCES += src/main.cc \
src
/
ui
/
SlugsHilSim
.
cc
\
src
/
ui
/
SlugsPIDControl
.
cpp
\
src
/
ui
/
SlugsVideoCamControl
.
cpp
\
src
/
ui
/
SlugsPadCameraControl
.
cpp
src
/
ui
/
SlugsPadCameraControl
.
cpp
\
src
/
ui
/
QGCMainWindowAPConfigurator
.
cc
contains
(
DEPENDENCIES_PRESENT
,
osg
)
{
message
(
"Including sources for OpenSceneGraph"
)
...
...
src/Core.cc
View file @
6e00bdcc
...
...
@@ -157,6 +157,9 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
**/
Core
::~
Core
()
{
//mainWindow->storeSettings();
mainWindow
->
hide
();
mainWindow
->
deleteLater
();
// Delete singletons
delete
LinkManager
::
instance
();
delete
UASManager
::
instance
();
...
...
src/QGC.h
View file @
6e00bdcc
...
...
@@ -14,6 +14,9 @@ namespace QGC
/** @brief Get the current ground time in microseconds */
quint64
groundTimeUsecs
();
const
QString
APPNAME
=
"QGROUNDCONTROL"
;
const
QString
COMPANYNAME
=
"OPENMAV"
;
}
#endif // QGC_H
src/comm/MAVLinkSimulationLink.cc
View file @
6e00bdcc
...
...
@@ -559,16 +559,17 @@ void MAVLinkSimulationLink::mainloop()
// Send controller states
// uint8_t attControl = 1;
// uint8_t posXYControl = 1;
// uint8_t posZControl = 0;
// uint8_t posYawControl = 1;
// uint8_t gpsLock = 2;
// uint8_t visLock = 3;
//uint8_t posLock = qMax(gpsLock, visLock);
#ifdef MAVLINK_ENABLED_PIXHAWK
uint8_t
attControl
=
1
;
uint8_t
posXYControl
=
1
;
uint8_t
posZControl
=
0
;
uint8_t
posYawControl
=
1
;
uint8_t
gpsLock
=
2
;
uint8_t
visLock
=
3
;
uint8_t
posLock
=
qMax
(
gpsLock
,
visLock
);
messageSize
=
mavlink_msg_control_status_pack
(
systemId
,
componentId
,
&
msg
,
posLock
,
visLock
,
gpsLock
,
attControl
,
posXYControl
,
posZControl
,
posYawControl
);
#endif
...
...
src/comm/SerialLink.cc
View file @
6e00bdcc
...
...
@@ -30,9 +30,11 @@ This file is part of the QGROUNDCONTROL project
#include <QTimer>
#include <QDebug>
#include <QSettings>
#include <QMutexLocker>
#include "SerialLink.h"
#include "LinkManager.h"
#include "QGC.h"
#include <MG.h>
#ifdef _WIN32
#include "windows.h"
...
...
@@ -54,12 +56,26 @@ SerialLink::SerialLink(QString portname, BaudRateType baudrate, FlowType flow, P
#endif
// Set unique ID and add link to the list of links
this
->
id
=
getNextLinkId
();
this
->
baudrate
=
baudrate
;
this
->
flow
=
flow
;
this
->
parity
=
parity
;
this
->
dataBits
=
dataBits
;
this
->
stopBits
=
stopBits
;
this
->
timeout
=
1
;
///< The timeout controls how long the program flow should wait for new serial bytes. As we're polling, we don't want to wait at all.
// Load defaults from settings
QSettings
settings
(
QGC
::
COMPANYNAME
,
QGC
::
APPNAME
);
if
(
settings
.
contains
(
"SERIALLINK_COMM_PORT"
))
{
this
->
porthandle
=
settings
.
value
(
"SERIALLINK_COMM_PORT"
).
toString
();
setBaudRate
(
settings
.
value
(
"SERIALLINK_COMM_BAUD"
).
toInt
());
setParityType
(
settings
.
value
(
"SERIALLINK_COMM_PARITY"
).
toInt
());
setStopBitsType
(
settings
.
value
(
"SERIALLINK_COMM_STOPBITS"
).
toInt
());
setDataBitsType
(
settings
.
value
(
"SERIALLINK_COMM_DATABITS"
).
toInt
());
}
else
{
this
->
baudrate
=
baudrate
;
this
->
flow
=
flow
;
this
->
parity
=
parity
;
this
->
dataBits
=
dataBits
;
this
->
stopBits
=
stopBits
;
this
->
timeout
=
1
;
///< The timeout controls how long the program flow should wait for new serial bytes. As we're polling, we don't want to wait at all.
}
// Set the port name
if
(
porthandle
==
""
)
...
...
@@ -282,6 +298,15 @@ bool SerialLink::connect()
**/
bool
SerialLink
::
hardwareConnect
()
{
// Store settings
QSettings
settings
(
QGC
::
COMPANYNAME
,
QGC
::
APPNAME
);
settings
.
setValue
(
"SERIALLINK_COMM_PORT"
,
this
->
porthandle
);
settings
.
setValue
(
"SERIALLINK_COMM_BAUD"
,
this
->
baudrate
);
settings
.
setValue
(
"SERIALLINK_COMM_PARITY"
,
this
->
parity
);
settings
.
setValue
(
"SERIALLINK_COMM_STOPBITS"
,
this
->
stopBits
);
settings
.
setValue
(
"SERIALLINK_COMM_DATABITS"
,
this
->
dataBits
);
settings
.
sync
();
QObject
::
connect
(
port
,
SIGNAL
(
aboutToClose
()),
this
,
SIGNAL
(
disconnected
()));
port
->
open
(
QIODevice
::
ReadWrite
);
...
...
src/input/Freenect.cc
View file @
6e00bdcc
...
...
@@ -341,7 +341,7 @@ Freenect::readConfigFile(void)
settings
.
value
(
"transform/R33"
).
toDouble
(),
settings
.
value
(
"transform/Tz"
).
toDouble
(),
0.0
,
0.0
,
0.0
,
1.0
);
transformMatrix
=
transformMatrix
.
transpos
ed
();
transformMatrix
=
transformMatrix
.
invert
ed
();
baseline
=
settings
.
value
(
"transform/baseline"
).
toDouble
();
disparityOffset
=
settings
.
value
(
"transform/disparity_offset"
).
toDouble
();
...
...
src/uas/PxQuadMAV.cc
View file @
6e00bdcc
...
...
@@ -41,12 +41,12 @@ void PxQuadMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
{
// Let UAS handle the default message set
UAS
::
receiveMessage
(
link
,
message
);
// mavlink_message_t* msg = &message;
//qDebug() << "PX RECEIVED" << msg->sysid << msg->compid << msg->msgid;
// Only compile this portion if matching MAVLink packets have been compiled
#ifdef MAVLINK_ENABLED_PIXHAWK
mavlink_message_t
*
msg
=
&
message
;
if
(
message
.
sysid
==
uasId
)
{
...
...
src/uas/UAS.cc
View file @
6e00bdcc
...
...
@@ -373,9 +373,10 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
positionLock
=
true
;
// Send to patch antenna
mavlink_message_t
msg
;
mavlink_msg_global_position_pack
(
MG
::
SYSTEM
::
ID
,
MG
::
SYSTEM
::
COMPID
,
&
msg
,
pos
.
usec
,
pos
.
lat
,
pos
.
lon
,
pos
.
alt
,
pos
.
vx
,
pos
.
vy
,
pos
.
vz
);
sendMessage
(
msg
);
// FIXME Message re-routing should be implemented differently
//mavlink_message_t msg;
//mavlink_msg_global_position_pack(MG::SYSTEM::ID, MG::SYSTEM::COMPID, &msg, pos.usec, pos.lat, pos.lon, pos.alt, pos.vx, pos.vy, pos.vz);
//sendMessage(msg);
}
break
;
case
MAVLINK_MSG_ID_GPS_RAW
:
...
...
src/ui/HUD.cc
View file @
6e00bdcc
...
...
@@ -165,6 +165,19 @@ HUD::~HUD()
}
void
HUD
::
showEvent
(
QShowEvent
*
event
)
{
Q_UNUSED
(
event
);
if
(
isVisible
())
{
refreshTimer
->
start
();
}
else
{
refreshTimer
->
stop
();
}
}
void
HUD
::
start
()
{
refreshTimer
->
start
();
...
...
src/ui/HUD.h
View file @
6e00bdcc
...
...
@@ -123,6 +123,8 @@ protected:
float
refLineWidthToPen
(
float
line
);
/** @brief Rotate a polygon around a point clockwise */
void
rotatePolygonClockWiseRad
(
QPolygonF
&
p
,
float
angle
,
QPointF
origin
);
/** @brief Override base class show */
virtual
void
showEvent
(
QShowEvent
*
event
);
QImage
*
image
;
///< Double buffer image
QImage
glImage
;
///< The background / camera image
...
...
src/ui/MainWindow.cc
View file @
6e00bdcc
This diff is collapsed.
Click to expand it.
src/ui/MainWindow.h
View file @
6e00bdcc
...
...
@@ -87,6 +87,9 @@ public:
~
MainWindow
();
public
slots
:
// /** @brief Store the mainwindow settings */
// void storeSettings();
/**
* @brief Shows a status message on the bottom status bar
*
...
...
@@ -324,7 +327,6 @@ protected:
void
configureWindowName
();
// TODO Should be moved elsewhere, as the protocol does not belong to the UI
MAVLinkProtocol
*
mavlink
;
AS4Protocol
*
as4link
;
...
...
@@ -367,6 +369,7 @@ protected:
QPointer
<
QDockWidget
>
hsiDockWidget
;
QPointer
<
QDockWidget
>
rcViewDockWidget
;
QPointer
<
QDockWidget
>
hudDockWidget
;
QPointer
<
QDockWidget
>
slugsDataWidget
;
QPointer
<
QDockWidget
>
slugsPIDControlWidget
;
QPointer
<
QDockWidget
>
slugsHilSimWidget
;
...
...
src/ui/MainWindow.ui
View file @
6e00bdcc
...
...
@@ -108,14 +108,7 @@
<addaction
name=
"menuPerspectives"
/>
<addaction
name=
"menuHelp"
/>
</widget>
<widget
class=
"QToolBar"
name=
"mainToolBar"
>
<attribute
name=
"toolBarArea"
>
<enum>
TopToolBarArea
</enum>
</attribute>
<attribute
name=
"toolBarBreak"
>
<bool>
false
</bool>
</attribute>
</widget>
<widget
class=
"QStatusBar"
name=
"statusBar"
/>
<action
name=
"actionExit"
>
<property
name=
"icon"
>
...
...
@@ -461,3 +454,5 @@
</connection>
</connections>
</ui>
src/ui/QGCMainWindowAPConfigurator.cc
0 → 100644
View file @
6e00bdcc
#include "QGCMainWindowAPConfigurator.h"
QGCMainWindowAPConfigurator
::
QGCMainWindowAPConfigurator
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
src/ui/QGCMainWindowAPConfigurator.h
0 → 100644
View file @
6e00bdcc
#ifndef QGCMAINWINDOWAPCONFIGURATOR_H
#define QGCMAINWINDOWAPCONFIGURATOR_H
#include <QObject>
class
QGCMainWindowAPConfigurator
:
public
QObject
{
Q_OBJECT
public:
explicit
QGCMainWindowAPConfigurator
(
QObject
*
parent
=
0
);
signals:
public
slots
:
};
#endif // QGCMAINWINDOWAPCONFIGURATOR_H
src/ui/SerialConfigurationWindow.cc
View file @
6e00bdcc
...
...
@@ -33,6 +33,7 @@ This file is part of the QGROUNDCONTROL project
#include <SerialConfigurationWindow.h>
#include <SerialLinkInterface.h>
#include <QDir>
#include <QSettings>
#include <QFileInfoList>
#ifdef _WIN32
#include <QextSerialEnumerator.h>
...
...
src/ui/XMLCommProtocolWidget.cc
View file @
6e00bdcc
...
...
@@ -7,6 +7,7 @@
#include "ui_XMLCommProtocolWidget.h"
#include "MAVLinkXMLParser.h"
#include "MAVLinkSyntaxHighlighter.h"
#include "QGC.h"
#include <QDebug>
#include <iostream>
...
...
@@ -31,7 +32,7 @@ XMLCommProtocolWidget::XMLCommProtocolWidget(QWidget *parent) :
void
XMLCommProtocolWidget
::
selectXMLFile
()
{
//QString fileName = QFileDialog::getOpenFileName(this, tr("Load Protocol Definition File"), ".", "*.xml");
QSettings
settings
;
QSettings
settings
(
QGC
::
COMPANYNAME
,
QGC
::
APPNAME
)
;
const
QString
mavlinkXML
=
"MAVLINK_XML_FILE"
;
QString
dirPath
=
settings
.
value
(
mavlinkXML
,
QCoreApplication
::
applicationDirPath
()
+
"../"
).
toString
();
QFileDialog
dialog
;
...
...
@@ -56,6 +57,7 @@ void XMLCommProtocolWidget::selectXMLFile()
setXML
(
instanceText
);
// Store filename for next time
settings
.
setValue
(
mavlinkXML
,
QFileInfo
(
file
).
absoluteFilePath
());
settings
.
sync
();
}
else
{
...
...
@@ -92,7 +94,7 @@ void XMLCommProtocolWidget::setXML(const QString& xml)
void
XMLCommProtocolWidget
::
selectOutputDirectory
()
{
QSettings
settings
;
QSettings
settings
(
QGC
::
COMPANYNAME
,
QGC
::
APPNAME
)
;
const
QString
mavlinkOutputDir
=
"MAVLINK_OUTPUT_DIR"
;
QString
dirPath
=
settings
.
value
(
mavlinkOutputDir
,
QCoreApplication
::
applicationDirPath
()
+
"../"
).
toString
();
QFileDialog
dialog
;
...
...
@@ -110,7 +112,8 @@ void XMLCommProtocolWidget::selectOutputDirectory()
{
m_ui
->
outputDirNameLabel
->
setText
(
fileNames
.
first
());
// Store directory for next time
settings
.
setValue
(
mavlinkOutputDir
,
fileNames
.
first
());
settings
.
setValue
(
mavlinkOutputDir
,
QFileInfo
(
fileNames
.
first
()).
absoluteFilePath
());
settings
.
sync
();
//QFile file(fileName);
}
}
...
...
src/ui/linechart/LinechartWidget.cc
View file @
6e00bdcc
...
...
@@ -159,7 +159,9 @@ void LinechartWidget::createLayout()
QToolButton
*
timeButton
=
new
QToolButton
(
this
);
timeButton
->
setText
(
tr
(
"Ground Time"
));
timeButton
->
setCheckable
(
true
);
timeButton
->
setChecked
(
false
);
bool
gTimeDefault
=
true
;
if
(
activePlot
)
activePlot
->
enforceGroundTime
(
gTimeDefault
);
timeButton
->
setChecked
(
gTimeDefault
);
layout
->
addWidget
(
timeButton
,
1
,
4
);
layout
->
setColumnStretch
(
4
,
0
);
connect
(
timeButton
,
SIGNAL
(
clicked
(
bool
)),
activePlot
,
SLOT
(
enforceGroundTime
(
bool
)));
...
...
@@ -442,6 +444,12 @@ void LinechartWidget::removeCurve(QString curve)
// Remove name
}
void
LinechartWidget
::
showEvent
(
QShowEvent
*
event
)
{
Q_UNUSED
(
event
);
setActive
(
isVisible
());
}
void
LinechartWidget
::
setActive
(
bool
active
)
{
if
(
activePlot
)
...
...
src/ui/linechart/LinechartWidget.h
View file @
6e00bdcc
...
...
@@ -77,6 +77,8 @@ public slots:
void
setPlotWindowPosition
(
int
scrollBarValue
);
void
setPlotWindowPosition
(
quint64
position
);
void
setPlotInterval
(
quint64
interval
);
/** @brief Override base class show */
virtual
void
showEvent
(
QShowEvent
*
event
);
void
setActive
(
bool
active
);
/** @brief Set the number of values to average over */
void
setAverageWindow
(
int
windowSize
);
...
...
src/ui/map3D/QGCGoogleEarthView.cc
View file @
6e00bdcc
...
...
@@ -16,9 +16,11 @@
QGCGoogleEarthView
::
QGCGoogleEarthView
(
QWidget
*
parent
)
:
QWidget
(
parent
),
updateTimer
(
new
QTimer
(
this
)),
refreshRateMs
(
200
),
mav
(
NULL
),
followCamera
(
true
),
trailEnabled
(
true
),
webViewInitialized
(
false
),
#if (defined Q_OS_MAC)
webViewMac
(
new
QWebView
(
this
)),
#endif
...
...
@@ -34,22 +36,14 @@ QGCGoogleEarthView::QGCGoogleEarthView(QWidget *parent) :
#endif
ui
->
setupUi
(
this
);
#if (defined Q_OS_MAC)
ui
->
webViewLayout
->
addWidget
(
webViewMac
);
webViewMac
->
setPage
(
new
QGCWebPage
(
webViewMac
));
webViewMac
->
settings
()
->
setAttribute
(
QWebSettings
::
PluginsEnabled
,
true
);
webViewMac
->
load
(
QUrl
(
"earth.html"
));
#endif
#if (defined Q_OS_WIN) & !(defined __MINGW32__)
webViewWin
->
load
(
QUrl
(
"earth.html"
));
#endif
#if ((defined Q_OS_MAC) | ((defined Q_OS_WIN) & !(defined __MINGW32__)))
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
setActiveUAS
(
UASInterface
*
)));
connect
(
updateTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
updateState
()));
updateTimer
->
start
(
200
);
updateTimer
->
start
(
refreshRateMs
);
#endif
// Follow checkbox
...
...
@@ -94,53 +88,82 @@ void QGCGoogleEarthView::follow(bool follow)
followCamera
=
follow
;
}
void
QGCGoogleEarthView
::
updateStat
e
()
void
QGCGoogleEarthView
::
hid
e
()
{
#ifdef Q_OS_MAC
if
(
webViewMac
->
page
()
->
currentFrame
()
->
evaluateJavaScript
(
"isInitialized();"
).
toBool
())
updateTimer
->
stop
();
QWidget
::
hide
();
}
void
QGCGoogleEarthView
::
show
()
{
if
(
!
webViewInitialized
)
{
static
bool
initialized
=
false
;
if
(
!
initialized
)
{
webViewMac
->
page
()
->
currentFrame
()
->
evaluateJavaScript
(
"setGCSHome(22.679833,8.549444, 470);"
);
initialized
=
true
;
}
int
uasId
=
0
;
double
lat
=
22.679833
;
double
lon
=
8.549444
;
double
alt
=
470.0
;
#if (defined Q_OS_MAC)
webViewMac
->
setPage
(
new
QGCWebPage
(
webViewMac
));
webViewMac
->
settings
()
->
setAttribute
(
QWebSettings
::
PluginsEnabled
,
true
);
webViewMac
->
load
(
QUrl
(
"earth.html"
));
#endif
float
roll
=
0.0
f
;
float
pitch
=
0.0
f
;
float
yaw
=
0.0
f
;
#if (defined Q_OS_WIN) & !(defined __MINGW32__)
webViewWin
->
load
(
QUrl
(
"earth.html"
));
#endif
webViewInitialized
=
true
;
}
updateTimer
->
start
();
QWidget
::
show
();
}
if
(
mav
)
{
uasId
=
mav
->
getUASID
();
lat
=
mav
->
getLatitude
();
lon
=
mav
->
getLongitude
();
alt
=
mav
->
getAltitude
();
roll
=
mav
->
getRoll
();
pitch
=
mav
->
getPitch
();
yaw
=
mav
->
getYaw
();
}
webViewMac
->
page
()
->
currentFrame
()
->
evaluateJavaScript
(
QString
(
"setAircraftPositionAttitude(%1, %2, %3, %4, %6, %7, %8);"
)
.
arg
(
uasId
)
.
arg
(
lat
)
.
arg
(
lon
)
.
arg
(
alt
+
500
)
.
arg
(
roll
)
.
arg
(
pitch
)
.
arg
(
yaw
));
if
(
followCamera
)
void
QGCGoogleEarthView
::
updateState
()
{
#ifdef Q_OS_MAC
if
(
isVisible
())
{
if
(
webViewMac
->
page
()
->
currentFrame
()
->
evaluateJavaScript
(
"isInitialized();"
).
toBool
())
{
webViewMac
->
page
()
->
currentFrame
()
->
evaluateJavaScript
(
QString
(
"updateFollowAircraft()"
));
static
bool
initialized
=
false
;
if
(
!
initialized
)
{
webViewMac
->
page
()
->
currentFrame
()
->
evaluateJavaScript
(
"setGCSHome(22.679833,8.549444, 470);"
);
initialized
=
true
;
}
int
uasId
=
0
;
double
lat
=
22.679833
;
double
lon
=
8.549444
;
double
alt
=
470.0
;
float
roll
=
0.0
f
;
float
pitch
=
0.0
f
;
float
yaw
=
0.0
f
;
if
(
mav
)
{
uasId
=
mav
->
getUASID
();
lat
=
mav
->
getLatitude
();
lon
=
mav
->
getLongitude
();
alt
=
mav
->
getAltitude
();
roll
=
mav
->
getRoll
();
pitch
=
mav
->
getPitch
();
yaw
=
mav
->
getYaw
();
}
webViewMac
->
page
()
->
currentFrame
()
->
evaluateJavaScript
(
QString
(
"setAircraftPositionAttitude(%1, %2, %3, %4, %6, %7, %8);"
)
.
arg
(
uasId
)
.
arg
(
lat
)
.
arg
(
lon
)
.
arg
(
alt
+
500
)
.
arg
(
roll
)
.
arg
(
pitch
)
.
arg
(
yaw
));
if
(
followCamera
)
{
webViewMac
->
page
()
->
currentFrame
()
->
evaluateJavaScript
(
QString
(
"updateFollowAircraft()"
));
}
}
}
#endif
}
void
QGCGoogleEarthView
::
changeEvent
(
QEvent
*
e
)
{
QWidget
::
changeEvent
(
e
);
...
...
src/ui/map3D/QGCGoogleEarthView.h
View file @
6e00bdcc
...
...
@@ -62,13 +62,19 @@ public slots:
void
showWaypoints
(
bool
state
);
/** @brief Follow the aircraft during flight */
void
follow
(
bool
follow
);
/** @brief Hide and deactivate */
void
hide
();
/** @brief Show and activate */
void
show
();
protected:
void
changeEvent
(
QEvent
*
e
);
QTimer
*
updateTimer
;
int
refreshRateMs
;
UASInterface
*
mav
;
bool
followCamera
;
bool
trailEnabled
;
bool
webViewInitialized
;
#if (defined Q_OS_WIN) && !(defined __MINGW32__)
WebAxWidget
*
webViewWin
;
#endif
...
...
src/ui/uas/UASControlWidget.cc
View file @
6e00bdcc
...
...
@@ -50,7 +50,7 @@ This file is part of the PIXHAWK project
#define CONTROL_MODE_TEST2 "MODE TEST2"
#define CONTROL_MODE_TEST3 "MODE TEST3"
#define CONTROL_MODE_READY "MODE TEST3"
#define CONTROL_MODE_RC_TRAINING "
MODE RC TRAINING
"
#define CONTROL_MODE_RC_TRAINING "
RC SIMULATION
"
#define CONTROL_MODE_LOCKED_INDEX 1
#define CONTROL_MODE_MANUAL_INDEX 2
...
...
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