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
d39079b9
Commit
d39079b9
authored
Dec 09, 2010
by
hengli
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of pixhawk.ethz.ch:qgroundcontrol into dev
parents
17cb2805
efc0e3c6
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
156 additions
and
75 deletions
+156
-75
.gitignore
.gitignore
+1
-0
qgroundcontrol.pri
qgroundcontrol.pri
+35
-46
Waypoint.cc
src/Waypoint.cc
+1
-2
MAVLinkProtocol.cc
src/comm/MAVLinkProtocol.cc
+1
-1
UAS.cc
src/uas/UAS.cc
+37
-0
UAS.h
src/uas/UAS.h
+2
-0
UASInterface.h
src/uas/UASInterface.h
+2
-0
UASWaypointManager.cc
src/uas/UASWaypointManager.cc
+2
-1
UASControl.ui
src/ui/UASControl.ui
+27
-10
WaypointList.cc
src/ui/WaypointList.cc
+0
-2
WaypointView.cc
src/ui/WaypointView.cc
+11
-8
QGCGoogleEarthView.cc
src/ui/map3D/QGCGoogleEarthView.cc
+12
-3
QGCGoogleEarthView.h
src/ui/map3D/QGCGoogleEarthView.h
+3
-2
UASControlWidget.cc
src/ui/uas/UASControlWidget.cc
+2
-0
UASView.cc
src/ui/uas/UASView.cc
+20
-0
No files found.
.gitignore
View file @
d39079b9
...
...
@@ -26,3 +26,4 @@ deploy/mac
deploy/linux
controller_log*
user_config.pri
*.app
qgroundcontrol.pri
View file @
d39079b9
...
...
@@ -65,7 +65,7 @@ macx {
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5
DESTDIR = $$BASEDIR/bin/mac
#
DESTDIR = $$BASEDIR/bin/mac
INCLUDEPATH += -framework SDL
LIBS += -framework IOKit \
...
...
@@ -77,11 +77,11 @@ macx {
ICON = $$BASEDIR/images/icons/macx.icns
# Copy audio files if needed
QMAKE_PRE_LINK += && cp -rf $$BASEDIR/audio $$
DES
TDIR/qgroundcontrol.app/Contents/MacOs/.
QMAKE_PRE_LINK += && cp -rf $$BASEDIR/audio $$
TARGE
TDIR/qgroundcontrol.app/Contents/MacOs/.
# Copy google earth starter file
QMAKE_PRE_LINK += && cp -f $$BASEDIR/images/earth.html $$
DES
TDIR/qgroundcontrol.app/Contents/MacOs/.
QMAKE_PRE_LINK += && cp -f $$BASEDIR/images/earth.html $$
TARGE
TDIR/qgroundcontrol.app/Contents/MacOs/.
# Copy model files
QMAKE_PRE_LINK += && cp -f $$BASEDIR/models/*.skp $$DES
TDIR/qgroundcontrol.app/Contents/MacOs/.
#QMAKE_PRE_LINK += && cp -f $$BASEDIR/models/*.dae $$TARGE
TDIR/qgroundcontrol.app/Contents/MacOs/.
exists(/Library/Frameworks/osg.framework):exists(/Library/Frameworks/OpenThreads.framework) {
# No check for GLUT.framework since it's a MAC default
...
...
@@ -146,12 +146,12 @@ macx {
linux-g++ {
debug {
DESTDIR = $$BUILDDIR/debug
#
DESTDIR = $$BUILDDIR/debug
CONFIG += debug
}
release {
DESTDIR = $$BUILDDIR/release
#
DESTDIR = $$BUILDDIR/release
}
QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
...
...
@@ -178,7 +178,8 @@ linux-g++ {
message("Building support for OpenSceneGraph")
DEPENDENCIES_PRESENT += osg
# Include OpenSceneGraph libraries
LIBS += -losg
LIBS += -losg \
-losgViewer
DEFINES += QGC_OSG_ENABLED
}
...
...
@@ -186,8 +187,7 @@ linux-g++ {
message("Building support for osgEarth")
DEPENDENCIES_PRESENT += osgearth
# Include osgEarth libraries
LIBS += -losgViewer \
-losgEarth \
LIBS += -losgEarth \
-losgEarthUtil
DEFINES += QGC_OSGEARTH_ENABLED
}
...
...
@@ -214,12 +214,12 @@ linux-g++ {
linux-g++-64 {
debug {
DESTDIR = $$BUILDDIR/debug
#
DESTDIR = $$BUILDDIR/debug
CONFIG += debug
}
release {
DESTDIR = $$BUILDDIR/release
#
DESTDIR = $$BUILDDIR/release
}
QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
...
...
@@ -247,7 +247,8 @@ linux-g++-64 {
message("Building support for OpenSceneGraph")
DEPENDENCIES_PRESENT += osg
# Include OpenSceneGraph libraries
LIBS += -losg
LIBS += -losg \
-losgViewer
DEFINES += QGC_OSG_ENABLED
}
...
...
@@ -255,8 +256,7 @@ linux-g++-64 {
message("Building support for osgEarth")
DEPENDENCIES_PRESENT += osgearth
# Include osgEarth libraries
LIBS += -losgViewer \
-losgEarth \
LIBS += -losgEarth \
-losgEarthUtil
DEFINES += QGC_OSGEARTH_ENABLED
}
...
...
@@ -321,28 +321,19 @@ exists($$BASEDIR/lib/osgEarth123) {
RC_FILE = $$BASEDIR/qgroundcontrol.rc
# Copy dependencies
QMAKE_PRE_LINK += && cp -f $$BASEDIR/lib/sdl/win32/SDL.dll $$TARGETDIR/debug/.
QMAKE_PRE_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/debug/.
#QMAKE_PRE_LINK += cp -f $$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/bin/osg55-osg.dll $$TARGETDIR/release/. &&
#QMAKE_PRE_LINK += cp -f $$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/bin/osg55-osgViewer.dll $$TARGETDIR/release/. &&
#QMAKE_PRE_LINK += cp -f $$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/bin/osg55-osgGA.dll $$TARGETDIR/release/. &&
#QMAKE_PRE_LINK += cp -f $$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/bin/osg55-osgDB.dll $$TARGETDIR/release/. &&
#QMAKE_PRE_LINK += cp -f $$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/bin/osg55-osgText.dll $$TARGETDIR/release/. &&
#QMAKE_PRE_LINK += cp -f $$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/bin/OpenThreads.dll $$TARGETDIR/release/. &&
BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")
QMAKE_PRE_LINK += && cp -f $$BASEDIR/lib/sdl/win32/SDL.dll $$TARGETDIR/release/.
QMAKE_PRE_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/release/.
QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug/.
QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/.
# osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details.
QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\debug\SDL.dll\"
QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\release\SDL.dll\"
QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\debug\audio\" /S /E /Y
QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\release\audio\" /S /E /Y
QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\debug\models\" /S /E /Y
QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\release\models\" /S /E /Y
# Copy google earth starter file
QMAKE_PRE_LINK += && c
p -f $$BASEDIR/images/earth.html $$TARGETDIR/release/
QMAKE_PRE_LINK += && c
p -f $$BASEDIR/images/earth.html $$TARGETDIR/debug/
QMAKE_PRE_LINK += && c
opy /Y \"$$BASEDIR/images/earth.html $$TARGETDIR_WIN\release\"
QMAKE_PRE_LINK += && c
opy /Y \"$$BASEDIR/images/earth.html $$TARGETDIR_WIN\debug\"
}
...
...
@@ -364,27 +355,25 @@ win32-g++ {
debug {
DESTDIR = $$BUILDDIR/debug
#
DESTDIR = $$BUILDDIR/debug
}
release {
DESTDIR = $$BUILDDIR/release
#
DESTDIR = $$BUILDDIR/release
}
RC_FILE = $$BASEDIR/qgroundcontrol.rc
# Copy dependencies
debug {
QMAKE_PRE_LINK += && cp -f $$BASEDIR/lib/sdl/win32/SDL.dll $$BUILDDIR/debug/.
QMAKE_PRE_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/debug/.
QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug/.
}
release {
QMAKE_PRE_LINK += && cp -f $$BASEDIR/lib/sdl/win32/SDL.dll $$BUILDDIR/release/.
QMAKE_PRE_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/release/.
QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/.
}
BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")
QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\debug\SDL.dll\"
QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\release\SDL.dll\"
QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\debug\audio\" /S /E /Y
QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\release\audio\" /S /E /Y
QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\debug\models\" /S /E /Y
QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\release\models\" /S /E /Y
# osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details.
...
...
src/Waypoint.cc
View file @
d39079b9
...
...
@@ -33,8 +33,7 @@ This file is part of the QGROUNDCONTROL project
#include "Waypoint.h"
#include <QStringList>
Waypoint
::
Waypoint
(
quint16
_id
,
float
_x
,
float
_y
,
float
_z
,
float
_yaw
,
bool
_autocontinue
,
bool
_current
,
float
_orbit
,
int
_holdTime
,
MAV_FRAME
_frame
,
MAV_ACTION
_action
)
Waypoint
::
Waypoint
(
quint16
_id
,
float
_x
,
float
_y
,
float
_z
,
float
_yaw
,
bool
_autocontinue
,
bool
_current
,
float
_orbit
,
int
_holdTime
,
MAV_FRAME
_frame
,
MAV_ACTION
_action
)
:
id
(
_id
),
x
(
_x
),
y
(
_y
),
...
...
src/comm/MAVLinkProtocol.cc
View file @
d39079b9
...
...
@@ -347,7 +347,7 @@ void MAVLinkProtocol::sendHeartbeat()
if
(
m_heartbeatsEnabled
)
{
mavlink_message_t
beat
;
mavlink_msg_heartbeat_pack
(
MG
::
SYSTEM
::
ID
,
MG
::
SYSTEM
::
COMPID
,
&
beat
,
OCU
,
MAV_AUTOPILOT_GENERIC
);
mavlink_msg_heartbeat_pack
(
getSystemId
(),
getComponentId
()
,
&
beat
,
OCU
,
MAV_AUTOPILOT_GENERIC
);
sendMessage
(
beat
);
}
}
...
...
src/uas/UAS.cc
View file @
d39079b9
...
...
@@ -421,6 +421,13 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
}
}
break
;
case
MAVLINK_MSG_ID_GPS_LOCAL_ORIGIN_SET
:
{
mavlink_gps_local_origin_set_t
pos
;
mavlink_msg_gps_local_origin_set_decode
(
&
message
,
&
pos
);
// FIXME Emit to other components
}
break
;
case
MAVLINK_MSG_ID_RC_CHANNELS_RAW
:
{
mavlink_rc_channels_raw_t
channels
;
...
...
@@ -657,6 +664,36 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
}
}
void
UAS
::
setLocalOriginAtCurrentGPSPosition
()
{
bool
result
=
false
;
QMessageBox
msgBox
;
msgBox
.
setIcon
(
QMessageBox
::
Warning
);
msgBox
.
setText
(
"Setting new World Coordinate Frame Origin"
);
msgBox
.
setInformativeText
(
"Do you want to set a new origin? Waypoints defined in the local frame will be shifted in their physical location"
);
msgBox
.
setStandardButtons
(
QMessageBox
::
Yes
|
QMessageBox
::
Cancel
);
msgBox
.
setDefaultButton
(
QMessageBox
::
Cancel
);
int
ret
=
msgBox
.
exec
();
// Close the message box shortly after the click to prevent accidental clicks
QTimer
::
singleShot
(
5000
,
&
msgBox
,
SLOT
(
reject
()));
if
(
ret
==
QMessageBox
::
Yes
)
{
mavlink_message_t
msg
;
mavlink_msg_action_pack
(
mavlink
->
getSystemId
(),
mavlink
->
getSystemId
(),
&
msg
,
this
->
getUASID
(),
0
,
MAV_ACTION_SET_ORIGIN
);
// Send message twice to increase chance that it reaches its goal
sendMessage
(
msg
);
// Wait 5 ms
MG
::
SLEEP
::
usleep
(
5000
);
// Send again
sendMessage
(
msg
);
result
=
true
;
}
}
void
UAS
::
setLocalPositionSetpoint
(
float
x
,
float
y
,
float
z
,
float
yaw
)
{
#ifdef MAVLINK_ENABLED_PIXHAWK
...
...
src/uas/UAS.h
View file @
d39079b9
...
...
@@ -243,6 +243,8 @@ public slots:
/** @brief Update the system state */
void
updateState
();
/** @brief Set world frame origin at current GPS position */
void
setLocalOriginAtCurrentGPSPosition
();
/** @brief Set local position setpoint */
void
setLocalPositionSetpoint
(
float
x
,
float
y
,
float
z
,
float
yaw
);
/** @brief Add an offset in body frame to the setpoint */
...
...
src/uas/UASInterface.h
View file @
d39079b9
...
...
@@ -194,6 +194,8 @@ public slots:
//virtual void requestWaypoints() = 0;
/** @brief Clear all existing waypoints on the robot */
//virtual void clearWaypointList() = 0;
/** @brief Set world frame origin at current GPS position */
virtual
void
setLocalOriginAtCurrentGPSPosition
()
=
0
;
/** @brief Request all onboard parameters of all components */
virtual
void
requestParameters
()
=
0
;
/** @brief Write parameter to permanent storage */
...
...
src/uas/UASWaypointManager.cc
View file @
d39079b9
...
...
@@ -131,7 +131,8 @@ void UASWaypointManager::handleWaypoint(quint8 systemId, quint8 compId, mavlink_
if
(
wp
->
seq
==
current_wp_id
)
{
Waypoint
*
lwp
=
new
Waypoint
(
wp
->
seq
,
wp
->
x
,
wp
->
y
,
wp
->
z
,
wp
->
yaw
,
wp
->
autocontinue
,
wp
->
current
,
wp
->
param1
,
wp
->
param2
);
qDebug
()
<<
"Got WP: "
<<
wp
->
seq
<<
wp
->
x
<<
wp
->
y
<<
wp
->
z
<<
wp
->
yaw
<<
wp
->
autocontinue
<<
wp
->
current
<<
wp
->
param1
<<
wp
->
param2
<<
(
MAV_FRAME
)
wp
->
frame
<<
(
MAV_ACTION
)
wp
->
action
;
Waypoint
*
lwp
=
new
Waypoint
(
wp
->
seq
,
wp
->
x
,
wp
->
y
,
wp
->
z
,
wp
->
yaw
,
wp
->
autocontinue
,
wp
->
current
,
wp
->
param1
,
wp
->
param2
,
(
MAV_FRAME
)
wp
->
frame
,
(
MAV_ACTION
)
wp
->
action
);
addWaypoint
(
lwp
);
//get next waypoint
...
...
src/ui/UASControl.ui
View file @
d39079b9
...
...
@@ -6,8 +6,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
210
</width>
<height>
130
</height>
<width>
328
</width>
<height>
357
</height>
</rect>
</property>
<property
name=
"minimumSize"
>
...
...
@@ -19,7 +19,7 @@
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
rowstretch=
"10,10,0,10,10,
5,100"
columnstretch=
"0,0,10,10
,10,0"
>
<layout
class=
"QGridLayout"
name=
"gridLayout"
rowstretch=
"10,10,0,10,10,
10,10,100"
columnstretch=
"0,10,5,5
,10,0"
>
<property
name=
"margin"
>
<number>
0
</number>
</property>
...
...
@@ -74,7 +74,7 @@
</property>
</spacer>
</item>
<item
row=
"0"
column=
"0"
rowspan=
"
6
"
>
<item
row=
"0"
column=
"0"
rowspan=
"
7
"
>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
...
...
@@ -91,7 +91,7 @@
<widget
class=
"QPushButton"
name=
"liftoffButton"
>
<property
name=
"minimumSize"
>
<size>
<width>
8
0
</width>
<width>
6
0
</width>
<height>
12
</height>
</size>
</property>
...
...
@@ -108,7 +108,7 @@
<widget
class=
"QPushButton"
name=
"landButton"
>
<property
name=
"minimumSize"
>
<size>
<width>
8
0
</width>
<width>
6
0
</width>
<height>
12
</height>
</size>
</property>
...
...
@@ -125,7 +125,7 @@
<widget
class=
"QPushButton"
name=
"shutdownButton"
>
<property
name=
"minimumSize"
>
<size>
<width>
8
0
</width>
<width>
6
0
</width>
<height>
12
</height>
</size>
</property>
...
...
@@ -138,7 +138,7 @@
</property>
</widget>
</item>
<item
row=
"0"
column=
"5"
rowspan=
"
6
"
>
<item
row=
"0"
column=
"5"
rowspan=
"
7
"
>
<spacer
name=
"horizontalSpacer_2"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
...
...
@@ -178,7 +178,7 @@
</property>
</widget>
</item>
<item
row=
"
5
"
column=
"1"
colspan=
"4"
>
<item
row=
"
6
"
column=
"1"
colspan=
"4"
>
<widget
class=
"QLabel"
name=
"lastActionLabel"
>
<property
name=
"minimumSize"
>
<size>
...
...
@@ -194,7 +194,7 @@
</property>
</widget>
</item>
<item
row=
"
6
"
column=
"0"
colspan=
"6"
>
<item
row=
"
7
"
column=
"0"
colspan=
"6"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
...
...
@@ -210,6 +210,23 @@
</property>
</spacer>
</item>
<item
row=
"5"
column=
"1"
colspan=
"2"
>
<widget
class=
"QPushButton"
name=
"setHomeButton"
>
<property
name=
"minimumSize"
>
<size>
<width>
60
</width>
<height>
16
</height>
</size>
</property>
<property
name=
"text"
>
<string>
Set Origin
</string>
</property>
<property
name=
"icon"
>
<iconset
resource=
"../../mavground.qrc"
>
<normaloff>
:/images/actions/go-home.svg
</normaloff>
:/images/actions/go-home.svg
</iconset>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
...
...
src/ui/WaypointList.cc
View file @
d39079b9
...
...
@@ -203,8 +203,6 @@ void WaypointList::add()
Waypoint
*
wp
=
new
Waypoint
(
0
,
uas
->
getLongitude
(),
uas
->
getLatitude
(),
uas
->
getAltitude
(),
0.0
,
true
,
true
,
0.15
,
2000
);
uas
->
getWaypointManager
().
addWaypoint
(
wp
);
}
}
}
...
...
src/ui/WaypointView.cc
View file @
d39079b9
...
...
@@ -60,13 +60,13 @@ WaypointView::WaypointView(Waypoint* wp, QWidget* parent) :
m_ui
->
comboBox_frame
->
addItem
(
"Global"
,
MAV_FRAME_GLOBAL
);
m_ui
->
comboBox_frame
->
addItem
(
"Local"
,
MAV_FRAME_LOCAL
);
// defaults
changedAction
(
0
);
changedFrame
(
wp
->
getFrame
());
// Read values and set user interface
updateValues
();
// defaults
//changedAction(wp->getAction());
//changedFrame(wp->getFrame());
connect
(
m_ui
->
posNSpinBox
,
SIGNAL
(
valueChanged
(
double
)),
wp
,
SLOT
(
setX
(
double
)));
connect
(
m_ui
->
posESpinBox
,
SIGNAL
(
valueChanged
(
double
)),
wp
,
SLOT
(
setY
(
double
)));
connect
(
m_ui
->
posDSpinBox
,
SIGNAL
(
valueChanged
(
double
)),
wp
,
SLOT
(
setZ
(
double
)));
...
...
@@ -133,7 +133,7 @@ void WaypointView::changedAction(int index)
m_ui
->
holdTimeSpinBox
->
hide
();
// set waypoint action
MAV_ACTION
action
=
(
MAV_ACTION
)
m_ui
->
comboBox_action
->
itemData
(
index
).
toUInt
();
MAV_ACTION
action
=
(
MAV_ACTION
)
m_ui
->
comboBox_action
->
itemData
(
index
).
toUInt
();
wp
->
setAction
(
action
);
// expose ui based on action
...
...
@@ -206,7 +206,8 @@ void WaypointView::updateValues()
{
// update frame
MAV_FRAME
frame
=
wp
->
getFrame
();
changedFrame
(
m_ui
->
comboBox_frame
->
findData
(
frame
));
int
frame_index
=
m_ui
->
comboBox_frame
->
findData
(
frame
);
m_ui
->
comboBox_frame
->
setCurrentIndex
(
frame_index
);
switch
(
frame
)
{
case
(
MAV_FRAME_LOCAL
):
...
...
@@ -220,11 +221,12 @@ void WaypointView::updateValues()
m_ui
->
altSpinBox
->
setValue
(
wp
->
getZ
());
break
;
}
changedFrame
(
frame_index
);
// update action
MAV_ACTION
action
=
wp
->
getAction
();
changedFrame
(
m_ui
->
comboBox_frame
->
findData
(
frame
)
);
changedAction
(
m_ui
->
comboBox_action
->
findData
(
action
)
);
int
action_index
=
m_ui
->
comboBox_action
->
findData
(
action
);
m_ui
->
comboBox_action
->
setCurrentIndex
(
action_index
);
switch
(
action
)
{
case
MAV_ACTION_TAKEOFF
:
...
...
@@ -238,6 +240,7 @@ void WaypointView::updateValues()
default:
std
::
cerr
<<
"unknown action"
<<
std
::
endl
;
}
changedAction
(
action_index
);
m_ui
->
yawSpinBox
->
setValue
(
wp
->
getYaw
()
/
M_PI
*
180.
);
m_ui
->
selectedBox
->
setChecked
(
wp
->
getCurrent
());
...
...
src/ui/map3D/QGCGoogleEarthView.cc
View file @
d39079b9
...
...
@@ -18,6 +18,7 @@ QGCGoogleEarthView::QGCGoogleEarthView(QWidget *parent) :
updateTimer
(
new
QTimer
(
this
)),
mav
(
NULL
),
followCamera
(
true
),
trailEnabled
(
true
),
#if (defined Q_OS_MAC)
webViewMac
(
new
QWebView
(
this
)),
#endif
...
...
@@ -51,6 +52,14 @@ QGCGoogleEarthView::QGCGoogleEarthView(QWidget *parent) :
updateTimer
->
start
(
200
);
#endif
// Follow checkbox
ui
->
followAirplaneCheckbox
->
setChecked
(
followCamera
);
connect
(
ui
->
followAirplaneCheckbox
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
follow
(
bool
)));
// Trail checkbox
ui
->
trailCheckbox
->
setChecked
(
trailEnabled
);
connect
(
ui
->
trailCheckbox
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
showTrail
(
bool
)));
// Get list of available 3D models
// Load HTML file
...
...
@@ -70,19 +79,19 @@ void QGCGoogleEarthView::setActiveUAS(UASInterface* uas)
mav
=
uas
;
}
void
QGCGoogleEarthView
::
showTrail
(
int
state
)
void
QGCGoogleEarthView
::
showTrail
(
bool
state
)
{
}
void
QGCGoogleEarthView
::
showWaypoints
(
int
state
)
void
QGCGoogleEarthView
::
showWaypoints
(
bool
state
)
{
}
void
QGCGoogleEarthView
::
follow
(
bool
follow
)
{
followCamera
=
follow
;
}
void
QGCGoogleEarthView
::
updateState
()
...
...
src/ui/map3D/QGCGoogleEarthView.h
View file @
d39079b9
...
...
@@ -57,9 +57,9 @@ public slots:
/** @brief Set the currently selected UAS */
void
setActiveUAS
(
UASInterface
*
uas
);
/** @brief Show the vehicle trail */
void
showTrail
(
int
state
);
void
showTrail
(
bool
state
);
/** @brief Show the waypoints */
void
showWaypoints
(
int
state
);
void
showWaypoints
(
bool
state
);
/** @brief Follow the aircraft during flight */
void
follow
(
bool
follow
);
...
...
@@ -68,6 +68,7 @@ protected:
QTimer
*
updateTimer
;
UASInterface
*
mav
;
bool
followCamera
;
bool
trailEnabled
;
#if (defined Q_OS_WIN) && !(defined __MINGW32__)
WebAxWidget
*
webViewWin
;
#endif
...
...
src/ui/uas/UASControlWidget.cc
View file @
d39079b9
...
...
@@ -95,6 +95,7 @@ void UASControlWidget::setUAS(UASInterface* uas)
disconnect
(
ui
.
liftoffButton
,
SIGNAL
(
clicked
()),
oldUAS
,
SLOT
(
launch
()));
disconnect
(
ui
.
landButton
,
SIGNAL
(
clicked
()),
oldUAS
,
SLOT
(
home
()));
disconnect
(
ui
.
shutdownButton
,
SIGNAL
(
clicked
()),
oldUAS
,
SLOT
(
shutdown
()));
connect
(
ui
.
setHomeButton
,
SIGNAL
(
clicked
()),
uas
,
SLOT
(
setLocalOriginAtCurrentGPSPosition
()));
disconnect
(
uas
,
SIGNAL
(
modeChanged
(
int
,
QString
,
QString
)),
this
,
SLOT
(
updateMode
(
int
,
QString
,
QString
)));
disconnect
(
uas
,
SIGNAL
(
statusChanged
(
int
)),
this
,
SLOT
(
updateState
(
int
)));
}
...
...
@@ -104,6 +105,7 @@ void UASControlWidget::setUAS(UASInterface* uas)
connect
(
ui
.
liftoffButton
,
SIGNAL
(
clicked
()),
uas
,
SLOT
(
launch
()));
connect
(
ui
.
landButton
,
SIGNAL
(
clicked
()),
uas
,
SLOT
(
home
()));
connect
(
ui
.
shutdownButton
,
SIGNAL
(
clicked
()),
uas
,
SLOT
(
shutdown
()));
connect
(
ui
.
setHomeButton
,
SIGNAL
(
clicked
()),
uas
,
SLOT
(
setLocalOriginAtCurrentGPSPosition
()));
connect
(
uas
,
SIGNAL
(
modeChanged
(
int
,
QString
,
QString
)),
this
,
SLOT
(
updateMode
(
int
,
QString
,
QString
)));
connect
(
uas
,
SIGNAL
(
statusChanged
(
int
)),
this
,
SLOT
(
updateState
(
int
)));
...
...
src/ui/uas/UASView.cc
View file @
d39079b9
...
...
@@ -229,7 +229,27 @@ void UASView::setSystemType(UASInterface* uas, unsigned int systemType)
m_ui
->
typeButton
->
setIcon
(
QIcon
(
":/images/mavs/helicopter.svg"
));
break
;
case
5
:
m_ui
->
typeButton
->
setIcon
(
QIcon
(
":/images/mavs/unknown.svg"
));
break
;
case
6
:
{
// A groundstation is a special system type, update widget
QString
result
;
m_ui
->
nameLabel
->
setText
(
tr
(
"OCU "
)
+
result
.
sprintf
(
"%03d"
,
uas
->
getUASID
()));
m_ui
->
waypointLabel
->
setText
(
""
);
m_ui
->
timeRemainingLabel
->
setText
(
"Online:"
);
m_ui
->
batteryBar
->
hide
();
m_ui
->
thrustBar
->
hide
();
m_ui
->
stateLabel
->
hide
();
m_ui
->
statusTextLabel
->
hide
();
m_ui
->
waypointLabel
->
hide
();
m_ui
->
liftoffButton
->
hide
();
m_ui
->
haltButton
->
hide
();
m_ui
->
landButton
->
hide
();
m_ui
->
shutdownButton
->
hide
();
m_ui
->
abortButton
->
hide
();
m_ui
->
typeButton
->
setIcon
(
QIcon
(
":/images/mavs/groundstation.svg"
));
}
break
;
default:
m_ui
->
typeButton
->
setIcon
(
QIcon
(
":/images/mavs/unknown.svg"
));
...
...
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