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
bccbfd14
Unverified
Commit
bccbfd14
authored
Apr 28, 2019
by
Don Gagne
Committed by
GitHub
Apr 28, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into ArduPilotVersion
parents
c389bcc5
b60fe0e7
Changes
27
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
411 additions
and
596 deletions
+411
-596
ChangeLog.md
ChangeLog.md
+1
-0
qgroundcontrol.pro
qgroundcontrol.pro
+0
-4
APMAirframeComponent.qml
src/AutoPilotPlugins/APM/APMAirframeComponent.qml
+137
-72
APMAirframeComponentAirframes.cc
src/AutoPilotPlugins/APM/APMAirframeComponentAirframes.cc
+0
-47
APMAirframeComponentAirframes.h
src/AutoPilotPlugins/APM/APMAirframeComponentAirframes.h
+0
-49
APMAirframeComponentController.cc
src/AutoPilotPlugins/APM/APMAirframeComponentController.cc
+112
-133
APMAirframeComponentController.h
src/AutoPilotPlugins/APM/APMAirframeComponentController.h
+26
-74
APMAirframeFactMetaData.xml
src/AutoPilotPlugins/APM/APMAirframeFactMetaData.xml
+0
-34
APMAirframeLoader.cc
src/AutoPilotPlugins/APM/APMAirframeLoader.cc
+0
-87
APMAirframeLoader.h
src/AutoPilotPlugins/APM/APMAirframeLoader.h
+0
-46
APMAutoPilotPlugin.cc
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc
+1
-5
APMAutoPilotPlugin.h
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.h
+0
-2
APMPowerComponent.qml
src/AutoPilotPlugins/APM/APMPowerComponent.qml
+57
-0
APMFirmwarePlugin.cc
src/FirmwarePlugin/APM/APMFirmwarePlugin.cc
+2
-2
APMFirmwarePlugin.h
src/FirmwarePlugin/APM/APMFirmwarePlugin.h
+2
-1
APMResources.qrc
src/FirmwarePlugin/APM/APMResources.qrc
+0
-3
ArduCopterFirmwarePlugin.cc
src/FirmwarePlugin/APM/ArduCopterFirmwarePlugin.cc
+19
-20
ArduCopterFirmwarePlugin.h
src/FirmwarePlugin/APM/ArduCopterFirmwarePlugin.h
+3
-2
ArduRoverFirmwarePlugin.h
src/FirmwarePlugin/APM/ArduRoverFirmwarePlugin.h
+5
-4
FirmwarePlugin.cc
src/FirmwarePlugin/FirmwarePlugin.cc
+2
-1
FirmwarePlugin.h
src/FirmwarePlugin/FirmwarePlugin.h
+6
-1
PX4FirmwarePlugin.cc
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
+2
-1
PX4FirmwarePlugin.h
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.h
+1
-1
GuidedActionConfirm.qml
src/FlightDisplay/GuidedActionConfirm.qml
+10
-1
GuidedActionsController.qml
src/FlightDisplay/GuidedActionsController.qml
+8
-3
Vehicle.cc
src/Vehicle/Vehicle.cc
+12
-2
Vehicle.h
src/Vehicle/Vehicle.h
+5
-1
No files found.
ChangeLog.md
View file @
bccbfd14
...
...
@@ -9,6 +9,7 @@ Note: This file only contains high level features or important fixes.
*
ArduPilot: Copter - Update support to 3.5+
*
ArduPilot: Plane - Update support to 3.8+
*
ArduPilot: Rover - Update support to 3.4+
*
ArduPilot: Rework Airframe setup ui
*
Plan/Pattern: Support named presets to simplify commonly used settings setup. Currently only supported by Survey.
*
ArduCopter: Handle 3.7 parameter name change from CH#_OPT to RC#_OPTION.
*
Improved support for flashing/connecting to ChibiOS bootloaders boards.
...
...
qgroundcontrol.pro
View file @
bccbfd14
...
...
@@ -984,9 +984,7 @@ APMFirmwarePlugin {
HEADERS
+=
\
src
/
AutoPilotPlugins
/
APM
/
APMAirframeComponent
.
h
\
src
/
AutoPilotPlugins
/
APM
/
APMAirframeComponentAirframes
.
h
\
src
/
AutoPilotPlugins
/
APM
/
APMAirframeComponentController
.
h
\
src
/
AutoPilotPlugins
/
APM
/
APMAirframeLoader
.
h
\
src
/
AutoPilotPlugins
/
APM
/
APMAutoPilotPlugin
.
h
\
src
/
AutoPilotPlugins
/
APM
/
APMCameraComponent
.
h
\
src
/
AutoPilotPlugins
/
APM
/
APMCompassCal
.
h
\
...
...
@@ -1011,9 +1009,7 @@ APMFirmwarePlugin {
SOURCES
+=
\
src
/
AutoPilotPlugins
/
APM
/
APMAirframeComponent
.
cc
\
src
/
AutoPilotPlugins
/
APM
/
APMAirframeComponentAirframes
.
cc
\
src
/
AutoPilotPlugins
/
APM
/
APMAirframeComponentController
.
cc
\
src
/
AutoPilotPlugins
/
APM
/
APMAirframeLoader
.
cc
\
src
/
AutoPilotPlugins
/
APM
/
APMAutoPilotPlugin
.
cc
\
src
/
AutoPilotPlugins
/
APM
/
APMCameraComponent
.
cc
\
src
/
AutoPilotPlugins
/
APM
/
APMCompassCal
.
cc
\
...
...
src/AutoPilotPlugins/APM/APMAirframeComponent.qml
View file @
bccbfd14
...
...
@@ -22,90 +22,155 @@ import QGroundControl.ScreenTools 1.0
SetupPage
{
id
:
airframePage
pageComponent
:
_useOldFrameParam
?
oldFramePageComponent
:
newFramePageComponent
property
real
_margins
:
ScreenTools
.
defaultFontPixelWidth
property
bool
_useOldFrameParam
:
controller
.
parameterExists
(
-
1
,
"
FRAME
"
)
property
Fact
_oldFrameParam
:
controller
.
getParameterFact
(
-
1
,
"
FRAME
"
,
false
)
property
Fact
_newFrameParam
:
controller
.
getParameterFact
(
-
1
,
"
FRAME_CLASS
"
,
false
)
property
Fact
_frameTypeParam
:
controller
.
getParameterFact
(
-
1
,
"
FRAME_TYPE
"
,
false
)
APMAirframeComponentController
{
id
:
controller
factPanel
:
airframePage
.
viewPanel
}
ExclusiveGroup
{
id
:
airframeTypeExclusive
}
pageComponent
:
pageComponent
Component
{
id
:
oldFramePageComponent
Column
{
width
:
availableWidth
height
:
1000
spacing
:
_margins
RowLayout
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
spacing
:
_margins
QGCLabel
{
font.pointSize
:
ScreenTools
.
mediumFontPointSize
wrapMode
:
Text
.
WordWrap
text
:
qsTr
(
"
Please select your airframe type
"
)
Layout.fillWidth
:
true
id
:
pageComponent
ColumnLayout
{
id
:
mainColumn
width
:
availableWidth
property
real
_minW
:
ScreenTools
.
defaultFontPixelWidth
*
20
property
real
_boxWidth
:
_minW
property
real
_boxSpace
:
ScreenTools
.
defaultFontPixelWidth
property
real
_margins
:
ScreenTools
.
defaultFontPixelWidth
property
Fact
_frameClass
:
controller
.
getParameterFact
(
-
1
,
"
FRAME_CLASS
"
)
property
Fact
_frameType
:
controller
.
getParameterFact
(
-
1
,
"
FRAME_TYPE
"
)
readonly
property
real
spacerHeight
:
ScreenTools
.
defaultFontPixelHeight
onWidthChanged
:
computeDimensions
()
Component.onCompleted
:
computeDimensions
()
function
computeDimensions
()
{
var
sw
=
0
var
rw
=
0
var
idx
=
Math
.
floor
(
mainColumn
.
width
/
(
_minW
+
ScreenTools
.
defaultFontPixelWidth
))
if
(
idx
<
1
)
{
_boxWidth
=
mainColumn
.
width
_boxSpace
=
0
}
else
{
_boxSpace
=
0
if
(
idx
>
1
)
{
_boxSpace
=
ScreenTools
.
defaultFontPixelWidth
sw
=
_boxSpace
*
(
idx
-
1
)
}
rw
=
mainColumn
.
width
-
sw
_boxWidth
=
rw
/
idx
}
}
Repeater
{
model
:
controller
.
airframeTypesModel
APMAirframeComponentController
{
id
:
controller
factPanel
:
airframePage
.
viewPanel
}
QGCRadioButton
{
text
:
object
.
name
checked
:
controller
.
currentAirframeType
==
object
exclusiveGroup
:
airframeTypeExclusive
QGCLabel
{
id
:
helpText
Layout.fillWidth
:
true
text
:
(
_frameClass
.
rawValue
===
0
?
qsTr
(
"
Airframe is currently not set.
"
)
:
qsTr
(
"
Currently set to frame class '%1' and frame type '%2'.
"
).
arg
(
_frameClass
.
enumStringValue
).
arg
(
_frameType
.
enumStringValue
))
+
qsTr
(
"
To change this configuration, select the desired frame class below and frame type.
"
)
font.family
:
ScreenTools
.
demiboldFontFamily
wrapMode
:
Text
.
WordWrap
}
onCheckedChanged
:
{
if
(
checked
)
{
controller
.
currentAirframeType
=
object
}
}
}
Item
{
id
:
lastSpacer
height
:
parent
.
spacerHeight
width
:
10
}
}
// Column
}
// Component - oldFramePageComponent
Component
{
id
:
newFramePageComponent
Flow
{
id
:
flowView
Layout.fillWidth
:
true
spacing
:
_boxSpace
Grid
{
width
:
availableWidth
spacing
:
_margins
columns
:
2
ExclusiveGroup
{
id
:
airframeTypeExclusive
}
QGCLabel
{
text
:
qsTr
(
"
Frame Class:
"
)
}
Repeater
{
model
:
controller
.
frameClassModel
FactComboBox
{
fact
:
_newFrameParam
indexModel
:
false
width
:
ScreenTools
.
defaultFontPixelWidth
*
15
}
// Outer summary item rectangle
Rectangle
{
id
:
outerRect
width
:
_boxWidth
height
:
ScreenTools
.
defaultFontPixelHeight
*
14
color
:
qgcPal
.
window
QGCLabel
{
text
:
qsTr
(
"
Frame Type:
"
)
}
readonly
property
real
titleHeight
:
ScreenTools
.
defaultFontPixelHeight
*
1.75
readonly
property
real
innerMargin
:
ScreenTools
.
defaultFontPixelWidth
FactComboBox
{
fact
:
_frameTypeParam
indexModel
:
false
width
:
ScreenTools
.
defaultFontPixelWidth
*
15
}
}
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
airframeCheckBox
.
checked
=
true
}
QGCLabel
{
id
:
title
text
:
object
.
name
}
Rectangle
{
anchors.topMargin
:
ScreenTools
.
defaultFontPixelHeight
/
2
anchors.top
:
title
.
bottom
anchors.bottom
:
parent
.
bottom
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
color
:
airframeCheckBox
.
checked
?
qgcPal
.
buttonHighlight
:
qgcPal
.
windowShade
ColumnLayout
{
anchors.margins
:
innerMargin
anchors.fill
:
parent
spacing
:
innerMargin
Image
{
id
:
image
Layout.fillWidth
:
true
Layout.fillHeight
:
true
fillMode
:
Image
.
PreserveAspectFit
smooth
:
true
mipmap
:
true
source
:
object
.
imageResource
}
QGCCheckBox
{
// Although this item is invisible we still use it to manage state
id
:
airframeCheckBox
checked
:
object
.
frameClass
===
_frameClass
.
rawValue
exclusiveGroup
:
airframeTypeExclusive
visible
:
false
onCheckedChanged
:
{
if
(
checked
)
{
_frameClass
.
rawValue
=
object
.
frameClass
}
}
}
QGCLabel
{
text
:
qsTr
(
"
Frame Type
"
)
font.pointSize
:
ScreenTools
.
smallFontPointSize
color
:
qgcPal
.
buttonHighlightText
visible
:
airframeCheckBox
.
checked
&&
object
.
frameTypeSupported
}
FactComboBox
{
id
:
combo
Layout.fillWidth
:
true
fact
:
_frameType
indexModel
:
false
visible
:
airframeCheckBox
.
checked
&&
object
.
frameTypeSupported
}
}
}
}
}
// Repeater - summary boxes
}
// Flow - summary boxes
}
// Column
}
// Component
}
// SetupPage
src/AutoPilotPlugins/APM/APMAirframeComponentAirframes.cc
deleted
100644 → 0
View file @
c389bcc5
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
/// @file
/// @author Don Gagne <don@thegagnes.com>
#include "APMAirframeComponentAirframes.h"
#include "APMAirframeComponentController.h"
QMap
<
QString
,
APMAirframeComponentAirframes
::
AirframeType_t
*>
APMAirframeComponentAirframes
::
rgAirframeTypes
;
QMap
<
QString
,
APMAirframeComponentAirframes
::
AirframeType_t
*>&
APMAirframeComponentAirframes
::
get
()
{
return
rgAirframeTypes
;
}
void
APMAirframeComponentAirframes
::
insert
(
const
QString
&
group
,
int
groupId
,
const
QString
&
image
,
const
QString
&
name
,
const
QString
&
file
)
{
AirframeType_t
*
g
;
if
(
!
rgAirframeTypes
.
contains
(
group
))
{
g
=
new
AirframeType_t
;
g
->
name
=
group
;
g
->
type
=
groupId
;
g
->
imageResource
=
image
.
isEmpty
()
?
QString
()
:
QStringLiteral
(
"qrc:/qmlimages/"
)
+
image
;
rgAirframeTypes
.
insert
(
group
,
g
);
}
else
{
g
=
rgAirframeTypes
.
value
(
group
);
}
if
(
!
name
.
isEmpty
()
&&
!
file
.
isEmpty
())
g
->
rgAirframeInfo
.
append
(
new
APMAirframe
(
name
,
file
,
g
->
type
));
}
void
APMAirframeComponentAirframes
::
clear
()
{
QList
<
AirframeType_t
*>
valueList
=
get
().
values
();
foreach
(
AirframeType_t
*
pType
,
valueList
)
{
qDeleteAll
(
pType
->
rgAirframeInfo
);
delete
pType
;
}
rgAirframeTypes
.
clear
();
}
src/AutoPilotPlugins/APM/APMAirframeComponentAirframes.h
deleted
100644 → 0
View file @
c389bcc5
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
/// @file
/// @author Don Gagne <don@thegagnes.com>
#ifndef APMAirframeComponentAirframes_H
#define APMAirframeComponentAirframes_H
#include <QObject>
#include <QQuickItem>
#include <QList>
#include <QMap>
#include "UASInterface.h"
#include "AutoPilotPlugin.h"
class
APMAirframe
;
/// MVC Controller for AirframeComponent.qml.
class
APMAirframeComponentAirframes
{
public:
typedef
struct
{
QString
name
;
QString
imageResource
;
int
type
;
QList
<
APMAirframe
*>
rgAirframeInfo
;
}
AirframeType_t
;
typedef
QMap
<
QString
,
AirframeType_t
*>
AirframeTypeMap
;
static
AirframeTypeMap
&
get
();
static
void
clear
();
static
void
insert
(
const
QString
&
group
,
int
groupId
,
const
QString
&
image
,
const
QString
&
name
=
QString
(),
const
QString
&
file
=
QString
());
protected:
static
AirframeTypeMap
rgAirframeTypes
;
private:
};
#endif
src/AutoPilotPlugins/APM/APMAirframeComponentController.cc
View file @
bccbfd14
This diff is collapsed.
Click to expand it.
src/AutoPilotPlugins/APM/APMAirframeComponentController.h
View file @
bccbfd14
...
...
@@ -7,12 +7,7 @@
*
****************************************************************************/
/// @file
/// @author Don Gagne <don@thegagnes.com>
#ifndef APMAirframeComponentController_H
#define APMAirframeComponentController_H
#pragma once
#include <QObject>
#include <QQuickItem>
...
...
@@ -22,7 +17,6 @@
#include "UASInterface.h"
#include "AutoPilotPlugin.h"
#include "FactPanelController.h"
#include "APMAirframeComponentAirframes.h"
class
APMAirframeModel
;
class
APMAirframeType
;
...
...
@@ -33,98 +27,56 @@ class APMAirframeComponentController : public FactPanelController
Q_OBJECT
public:
enum
FrameId
{
FRAME_TYPE_PLUS
=
0
,
FRAME_TYPE_X
=
1
,
FRAME_TYPE_V
=
2
,
FRAME_TYPE_H
=
3
,
FRAME_TYPE_NEWY6
=
10
};
Q_ENUM
(
FrameId
)
APMAirframeComponentController
(
void
);
~
APMAirframeComponentController
();
Q_PROPERTY
(
QmlObjectListModel
*
airframeTypesModel
MEMBER
_airframeTypesModel
CONSTANT
)
Q_PROPERTY
(
APMAirframeType
*
currentAirframeType
READ
currentAirframeType
WRITE
setCurrentAirframeType
NOTIFY
currentAirframeTypeChanged
)
Q_PROPERTY
(
QmlObjectListModel
*
frameClassModel
MEMBER
_frameClassModel
CONSTANT
)
Q_INVOKABLE
void
loadParameters
(
const
QString
&
paramFile
);
int
currentAirframeIndex
(
void
);
void
setCurrentAirframeIndex
(
int
newIndex
);
signals:
void
loadAirframesCompleted
();
void
currentAirframeTypeChanged
(
APMAirframeType
*
airframeType
);
public
slots
:
APMAirframeType
*
currentAirframeType
()
const
;
Q_INVOKABLE
QString
currentAirframeTypeName
()
const
;
void
setCurrentAirframeType
(
APMAirframeType
*
t
);
private
slots
:
void
_fillAirFrames
(
void
);
void
_factFrameChanged
(
QVariant
v
);
void
_githubJsonDownloadFinished
(
QString
remoteFile
,
QString
localFile
);
void
_githubJsonDownloadError
(
QString
errorMsg
);
void
_paramFileDownloadFinished
(
QString
remoteFile
,
QString
localFile
);
void
_paramFileDownloadError
(
QString
errorMsg
);
private:
void
_fillFrameClasses
(
void
);
void
_loadParametersFromDownloadFile
(
const
QString
&
downloadedParamFile
);
APMAirframeType
*
_currentAirframeType
;
QmlObjectListModel
*
_airframeTypesModel
;
static
bool
_typesRegistered
;
static
const
char
*
_oldFrameParam
;
static
const
char
*
_newFrameParam
;
Fact
*
_frameClassFact
;
Fact
*
_frameTypeFact
;
QmlObjectListModel
*
_frameClassModel
;
};
class
APM
Airframe
:
public
QObject
class
APM
FrameClass
:
public
QObject
{
Q_OBJECT
public:
APM
Airframe
(
const
QString
&
name
,
const
QString
&
paramsFile
,
int
type
,
QObject
*
parent
=
NULL
);
~
APM
Airframe
();
APM
FrameClass
(
const
QString
&
name
,
int
frameClass
,
Fact
*
frameTypeFact
,
int
defaultFrameType
,
QObject
*
parent
=
nullptr
);
~
APM
FrameClass
();
Q_PROPERTY
(
QString
name
MEMBER
_name
CONSTANT
)
Q_PROPERTY
(
int
type
MEMBER
_type
CONSTANT
)
Q_PROPERTY
(
QString
params
MEMBER
_paramsFile
CONSTANT
)
QString
name
()
const
;
QString
params
()
const
;
int
type
()
const
;
Q_PROPERTY
(
QString
name
MEMBER
_name
CONSTANT
)
Q_PROPERTY
(
int
frameClass
MEMBER
_frameClass
CONSTANT
)
Q_PROPERTY
(
int
frameType
READ
frameType
NOTIFY
frameTypeChanged
)
Q_PROPERTY
(
int
defaultFrameType
MEMBER
_defaultFrameType
CONSTANT
)
Q_PROPERTY
(
QString
imageResource
READ
imageResource
NOTIFY
imageResourceChanged
)
Q_PROPERTY
(
bool
frameTypeSupported
MEMBER
_frameTypeSupported
CONSTANT
)
int
frameType
(
void
)
{
return
_frameTypeFact
->
rawValue
().
toInt
();
};
QString
imageResource
(
void
);
private:
QString
_name
;
QString
_paramsFile
;
int
_type
;
};
QString
_imageResource
;
int
_frameClass
;
int
_defaultFrameType
;
bool
_frameTypeSupported
;
class
APMAirframeType
:
public
QObject
{
Q_OBJECT
public:
APMAirframeType
(
const
QString
&
name
,
const
QString
&
imageResource
,
int
type
,
QObject
*
parent
=
NULL
);
~
APMAirframeType
();
Q_PROPERTY
(
QString
name
MEMBER
_name
CONSTANT
)
Q_PROPERTY
(
QString
imageResource
MEMBER
_imageResource
CONSTANT
)
Q_PROPERTY
(
QVariantList
airframes
MEMBER
_airframes
CONSTANT
)
Q_PROPERTY
(
int
type
MEMBER
_type
CONSTANT
)
Q_PROPERTY
(
bool
dirty
MEMBER
_dirty
CONSTANT
)
void
addAirframe
(
const
QString
&
name
,
const
QString
&
paramsFile
,
int
type
);
signals:
void
imageResourceChanged
(
void
);
void
frameTypeChanged
();
QString
name
()
const
;
QString
imageResource
()
const
;
int
type
()
const
;
private:
QString
_name
;
QString
_imageResource
;
QVariantList
_airframes
;
int
_type
;
bool
_dirty
;
Fact
*
_frameTypeFact
;
};
#endif
src/AutoPilotPlugins/APM/APMAirframeFactMetaData.xml
deleted
100644 → 0
View file @
c389bcc5
<?xml version='1.0' encoding='UTF-8'?>
<airframes>
<version>
1
</version>
<airframe_group
image=
"AirframeQuadRotorPlus.png"
name=
"Plus Style: Quad, Hexa, Octo, Heli"
id=
"0"
>
<airframe
name=
"3DR Aero M"
file=
"3DR_AERO_M.param"
/>
<airframe
name=
"3DR Aero RTF"
file=
"3DR_Aero_RTF.param"
/>
<airframe
name=
"3DR Rover"
file=
"3DR_Rover.param"
/>
<airframe
name=
"3DR Tarot"
file=
"3DR_Tarot.bgsc"
/>
<airframe
name=
"Parrot Bebop"
file=
"Parrot_Bebop.param"
/>
<airframe
name=
"Storm32"
file=
"SToRM32-MAVLink.param"
/>
</airframe_group>
<airframe_group
image=
"AirframeQuadRotorX.png"
name=
"X Style, Y6A Style: Quad, Hexa, Octo, X8, Tri, Y6A"
id=
"1"
>
<airframe
name=
"3DR X8-M RTF"
file=
"3DR_X8-M_RTF.param"
/>
<airframe
name=
"3DR Y6A"
file=
"3DR_Y6A_RTF.param"
/>
<airframe
name=
"3DR X8+ RTF"
file=
"3DR_X8+_RTF.param"
/>
<airframe
name=
"3DR QUAD X4 RTF"
file=
"3DR_QUAD_X4_RTF.param"
/>
<airframe
name=
"3DR X8"
file=
"3DR_X8_RTF.param"
/>
</airframe_group>
<airframe_group
image=
"AirframeQuadRotorH.png"
name=
"V (3DR Iris)"
id=
"2"
>
<airframe
name=
"Iris with GoPro"
file=
"Iris with Front Mount Go Pro.param"
/>
<airframe
name=
"Iris with Tarot"
file=
"Iris with Tarot Gimbal.param"
/>
<airframe
name=
"3DR Iris+"
file=
"3DR_Iris+.param"
/>
<airframe
name=
"Iris"
file=
"Iris.param"
/>
</airframe_group>
<airframe_group
image=
"AirframeQuadRotorH.png"
name=
"V Tail"
id=
"4"
>
</airframe_group>
<airframe_group
image=
"AirframeQuadRotorH.png"
name=
"A Tail"
id=
"5"
>
</airframe_group>
<airframe_group
name=
"H: X and H differ in prop rotation"
id=
"3"
>
</airframe_group>
<airframe_group
name=
"Y6B Frame (3DR TriCopter): Y6B and Y6A differ in prop rotation"
id=
"10"
>
<airframe
name=
"3DR Y6B"
file=
"3DR_Y6B_RTF.param"
/>
</airframe_group>
<airframes>
src/AutoPilotPlugins/APM/APMAirframeLoader.cc
deleted
100644 → 0
View file @
c389bcc5
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
/// @file
/// @author Don Gagne <don@thegagnes.com>
#include "APMAirframeLoader.h"
#include "QGCApplication.h"
#include "QGCLoggingCategory.h"
#include "APMAirframeComponentAirframes.h"
#include <QFile>
#include <QFileInfo>
#include <QDir>
#include <QDebug>
QGC_LOGGING_CATEGORY
(
APMAirframeLoaderLog
,
"APMAirframeLoaderLog"
)
bool
APMAirframeLoader
::
_airframeMetaDataLoaded
=
false
;
APMAirframeLoader
::
APMAirframeLoader
(
AutoPilotPlugin
*
autopilot
,
UASInterface
*
uas
,
QObject
*
parent
)
{
Q_UNUSED
(
autopilot
);
Q_UNUSED
(
uas
);
Q_UNUSED
(
parent
);
Q_ASSERT
(
uas
);
}
/// Load Airframe Fact meta data
void
APMAirframeLoader
::
loadAirframeFactMetaData
(
void
)
{
if
(
_airframeMetaDataLoaded
)
{
return
;
}
qCDebug
(
APMAirframeLoaderLog
)
<<
"Loading APM airframe fact meta data"
;
Q_ASSERT
(
APMAirframeComponentAirframes
::
get
().
count
()
==
0
);
QString
airframeFilename
(
QStringLiteral
(
":/AutoPilotPlugins/APM/APMAirframeFactMetaData.xml"
));
qCDebug
(
APMAirframeLoaderLog
)
<<
"Loading meta data file:"
<<
airframeFilename
;
QFile
xmlFile
(
airframeFilename
);
Q_ASSERT
(
xmlFile
.
exists
());
bool
success
=
xmlFile
.
open
(
QIODevice
::
ReadOnly
);
Q_UNUSED
(
success
);
Q_ASSERT
(
success
);
QXmlStreamReader
xml
(
xmlFile
.
readAll
());
xmlFile
.
close
();
if
(
xml
.
hasError
())
{
qCWarning
(
APMAirframeLoaderLog
)
<<
"Badly formed XML"
<<
xml
.
errorString
();
return
;
}
QString
airframeGroup
;
QString
image
;
int
groupId
=
0
;
while
(
!
xml
.
atEnd
())
{
if
(
xml
.
isStartElement
())
{
QString
elementName
=
xml
.
name
().
toString
();
QXmlStreamAttributes
attr
=
xml
.
attributes
();
if
(
elementName
==
QLatin1Literal
(
"airframe_group"
))
{
airframeGroup
=
attr
.
value
(
QStringLiteral
(
"name"
)).
toString
();
image
=
attr
.
value
(
QStringLiteral
(
"image"
)).
toString
();
groupId
=
attr
.
value
(
QStringLiteral
(
"id"
)).
toInt
();
APMAirframeComponentAirframes
::
insert
(
airframeGroup
,
groupId
,
image
);
}
else
if
(
elementName
==
QLatin1Literal
(
"airframe"
))
{
QString
name
=
attr
.
value
(
QStringLiteral
(
"name"
)).
toString
();
QString
file
=
attr
.
value
(
QStringLiteral
(
"file"
)).
toString
();
APMAirframeComponentAirframes
::
insert
(
airframeGroup
,
groupId
,
image
,
name
,
file
);
}
}
xml
.
readNext
();
}
_airframeMetaDataLoaded
=
true
;
}
src/AutoPilotPlugins/APM/APMAirframeLoader.h
deleted
100644 → 0
View file @
c389bcc5
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#ifndef APMAirframeLoader_H
#define APMAirframeLoader_H
#include <QObject>
#include <QMap>
#include <QXmlStreamReader>
#include <QLoggingCategory>
#include "ParameterManager.h"
#include "FactSystem.h"
#include "UASInterface.h"
#include "AutoPilotPlugin.h"
/// @file APMAirframeLoader.h
/// @author Lorenz Meier <lm@qgroundcontrol.org>
Q_DECLARE_LOGGING_CATEGORY
(
APMAirframeLoaderLog
)
/// Collection of Parameter Facts for PX4 AutoPilot
class
APMAirframeLoader
:
QObject
{
Q_OBJECT
public:
/// @param uas Uas which this set of facts is associated with
APMAirframeLoader
(
AutoPilotPlugin
*
autpilot
,
UASInterface
*
uas
,
QObject
*
parent
=
NULL
);
static
void
loadAirframeFactMetaData
(
void
);
private:
static
bool
_airframeMetaDataLoaded
;
///< true: parameter meta data already loaded
static
QMap
<
QString
,
FactMetaData
*>
_mapParameterName2FactMetaData
;
///< Maps from a parameter name to FactMetaData
};
#endif // APMAirframeLoader_H
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc
View file @
bccbfd14
...
...
@@ -15,8 +15,6 @@
#include "FirmwarePlugin/APM/ArduCopterFirmwarePlugin.h"
#include "VehicleComponent.h"
#include "APMAirframeComponent.h"
#include "APMAirframeComponentAirframes.h"
#include "APMAirframeLoader.h"
#include "APMFlightModesComponent.h"
#include "APMRadioComponent.h"
#include "APMSafetyComponent.h"
...
...
@@ -30,6 +28,7 @@
#include "ESP8266Component.h"
#include "APMHeliComponent.h"
#include "QGCApplication.h"
#include "ParameterManager.h"
#if !defined(NO_SERIAL_LINK) && !defined(__android__)
#include <QSerialPortInfo>
...
...
@@ -50,12 +49,9 @@ APMAutoPilotPlugin::APMAutoPilotPlugin(Vehicle* vehicle, QObject* parent)
,
_safetyComponent
(
NULL
)
,
_sensorsComponent
(
NULL
)
,
_tuningComponent
(
NULL
)
,
_airframeFacts
(
new
APMAirframeLoader
(
this
,
vehicle
->
uas
(),
this
))
,
_esp8266Component
(
NULL
)
,
_heliComponent
(
NULL
)
{
APMAirframeLoader
::
loadAirframeFactMetaData
();
#if !defined(NO_SERIAL_LINK) && !defined(__android__)
connect
(
vehicle
->
parameterManager
(),
&
ParameterManager
::
parametersReadyChanged
,
this
,
&
APMAutoPilotPlugin
::
_checkForBadCubeBlack
);
#endif
...
...
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.h
View file @
bccbfd14
...
...
@@ -15,7 +15,6 @@
#include "Vehicle.h"
class
APMAirframeComponent
;
class
APMAirframeLoader
;
class
APMFlightModesComponent
;
class
APMRadioComponent
;
class
APMTuningComponent
;
...
...
@@ -55,7 +54,6 @@ protected:
APMSafetyComponent
*
_safetyComponent
;
APMSensorsComponent
*
_sensorsComponent
;
APMTuningComponent
*
_tuningComponent
;
APMAirframeLoader
*
_airframeFacts
;
ESP8266Component
*
_esp8266Component
;
APMHeliComponent
*
_heliComponent
;
...
...
src/AutoPilotPlugins/APM/APMPowerComponent.qml
View file @
bccbfd14
...
...
@@ -45,6 +45,8 @@ SetupPage {
property
bool
_batt2ParamsAvailable
:
controller
.
parameterExists
(
-
1
,
"
BATT2_CAPACITY
"
)
property
bool
_showBatt1Reboot
:
_batt1MonitorEnabled
&&
!
_batt1ParamsAvailable
property
bool
_showBatt2Reboot
:
_batt2MonitorEnabled
&&
!
_batt2ParamsAvailable
property
bool
_escCalibrationAvailable
:
controller
.
parameterExists
(
-
1
,
"
ESC_CALIBRATION
"
)
property
Fact
_escCalibration
:
controller
.
getParameterFact
(
-
1
,
"
ESC_CALIBRATION
"
,
false
/* reportMissing */
)
property
string
_restartRequired
:
qsTr
(
"
Requires vehicle reboot
"
)
...
...
@@ -217,6 +219,61 @@ SetupPage {
}
}
}
Column
{
spacing
:
_margins
/
2
visible
:
_escCalibrationAvailable
QGCLabel
{
text
:
qsTr
(
"
ESC Calibration
"
)
font.family
:
ScreenTools
.
demiboldFontFamily
}
Rectangle
{
width
:
escCalibrationHolder
.
x
+
escCalibrationHolder
.
width
+
_margins
height
:
escCalibrationHolder
.
y
+
escCalibrationHolder
.
height
+
_margins
color
:
ggcPal
.
windowShade
Column
{
id
:
escCalibrationHolder
x
:
_margins
y
:
_margins
spacing
:
_margins
Column
{
spacing
:
_margins
QGCLabel
{
text
:
qsTr
(
"
WARNING: Remove props prior to calibration!
"
)
color
:
qgcPal
.
warningText
}
Row
{
spacing
:
_margins
QGCButton
{
text
:
qsTr
(
"
Calibrate
"
)
enabled
:
_escCalibration
.
rawValue
===
0
onClicked
:
_escCalibration
.
rawValue
=
3
}
Column
{
enabled
:
_escCalibration
.
rawValue
===
3
QGCLabel
{
text
:
_escCalibration
.
rawValue
===
3
?
qsTr
(
"
Now perform these steps:
"
)
:
qsTr
(
"
Click Calibrate to start, then:
"
)
}
QGCLabel
{
text
:
qsTr
(
"
- Disconnect USB and battery so flight controller powers down
"
)
}
QGCLabel
{
text
:
qsTr
(
"
- Connect the battery
"
)
}
QGCLabel
{
text
:
qsTr
(
"
- The arming tone will be played (if the vehicle has a buzzer attached)
"
)
}
QGCLabel
{
text
:
qsTr
(
"
- If using a flight controller with a safety button press it until it displays solid red
"
)
}
QGCLabel
{
text
:
qsTr
(
"
- You will hear a musical tone then two beeps
"
)
}
QGCLabel
{
text
:
qsTr
(
"
- A few seconds later you should hear a number of beeps (one for each battery cell you’re using)
"
)
}
QGCLabel
{
text
:
qsTr
(
"
- And finally a single long beep indicating the end points have been set and the ESC is calibrated
"
)
}
QGCLabel
{
text
:
qsTr
(
"
- Disconnect the battery and power up again normally
"
)
}
}
}
}
}
}
}
}
// Flow
}
// Component - powerPageComponent
...
...
src/FirmwarePlugin/APM/APMFirmwarePlugin.cc
View file @
bccbfd14
...
...
@@ -889,9 +889,9 @@ void APMFirmwarePlugin::guidedModeGotoLocation(Vehicle* vehicle, const QGeoCoord
vehicle
->
missionManager
()
->
writeArduPilotGuidedMissionItem
(
coordWithAltitude
,
false
/* altChangeOnly */
);
}
void
APMFirmwarePlugin
::
guidedModeRTL
(
Vehicle
*
vehicle
)
void
APMFirmwarePlugin
::
guidedModeRTL
(
Vehicle
*
vehicle
,
bool
smartRTL
)
{
_setFlightModeAndValidate
(
vehicle
,
rtlFlightMode
());
_setFlightModeAndValidate
(
vehicle
,
smartRTL
?
smartRTLFlightMode
()
:
rtlFlightMode
());
}
void
APMFirmwarePlugin
::
guidedModeChangeAltitude
(
Vehicle
*
vehicle
,
double
altitudeChange
)
...
...
src/FirmwarePlugin/APM/APMFirmwarePlugin.h
View file @
bccbfd14
...
...
@@ -86,9 +86,10 @@ public:
bool
isGuidedMode
(
const
Vehicle
*
vehicle
)
const
override
;
QString
gotoFlightMode
(
void
)
const
override
{
return
QStringLiteral
(
"Guided"
);
}
QString
rtlFlightMode
(
void
)
const
override
{
return
QString
(
"RTL"
);
}
QString
smartRTLFlightMode
(
void
)
const
override
{
return
QString
(
"Smart RTL"
);
}
QString
missionFlightMode
(
void
)
const
override
{
return
QString
(
"Auto"
);
}
void
pauseVehicle
(
Vehicle
*
vehicle
)
override
;
void
guidedModeRTL
(
Vehicle
*
vehicle
)
override
;
void
guidedModeRTL
(
Vehicle
*
vehicle
,
bool
smartRTL
)
override
;
void
guidedModeChangeAltitude
(
Vehicle
*
vehicle
,
double
altitudeChange
)
override
;
bool
adjustIncomingMavlinkMessage
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
)
override
;
void
adjustOutgoingMavlinkMessage
(
Vehicle
*
vehicle
,
LinkInterface
*
outgoingLink
,
mavlink_message_t
*
message
)
override
;
...
...
src/FirmwarePlugin/APM/APMResources.qrc
View file @
bccbfd14
...
...
@@ -37,9 +37,6 @@
<file alias="APM/MavCmdInfoSub.json">MavCmdInfoSub.json</file>
<file alias="APM/MavCmdInfoVTOL.json">MavCmdInfoVTOL.json</file>
</qresource>
<qresource prefix="/AutoPilotPlugins/APM">
<file alias="APMAirframeFactMetaData.xml">../../AutoPilotPlugins/APM/APMAirframeFactMetaData.xml</file>
</qresource>
<qresource prefix="/FirmwarePlugin/APM">
<file alias="APMParameterFactMetaData.Plane.3.8.xml">APMParameterFactMetaData.Plane.3.8.xml</file>
<file alias="APMParameterFactMetaData.Plane.3.9.xml">APMParameterFactMetaData.Plane.3.9.xml</file>
...
...
src/FirmwarePlugin/APM/ArduCopterFirmwarePlugin.cc
View file @
bccbfd14
...
...
@@ -23,26 +23,25 @@ APMCopterMode::APMCopterMode(uint32_t mode, bool settable) :
APMCustomMode
(
mode
,
settable
)
{
QMap
<
uint32_t
,
QString
>
enumToString
;
enumToString
.
insert
(
STABILIZE
,
"Stabilize"
);
enumToString
.
insert
(
ACRO
,
"Acro"
);
enumToString
.
insert
(
ALT_HOLD
,
"Altitude Hold"
);
enumToString
.
insert
(
AUTO
,
"Auto"
);
enumToString
.
insert
(
GUIDED
,
"Guided"
);
enumToString
.
insert
(
LOITER
,
"Loiter"
);
enumToString
.
insert
(
RTL
,
"RTL"
);
enumToString
.
insert
(
CIRCLE
,
"Circle"
);
enumToString
.
insert
(
LAND
,
"Land"
);
enumToString
.
insert
(
DRIFT
,
"Drift"
);
enumToString
.
insert
(
SPORT
,
"Sport"
);
enumToString
.
insert
(
FLIP
,
"Flip"
);
enumToString
.
insert
(
AUTOTUNE
,
"Autotune"
);
enumToString
.
insert
(
POS_HOLD
,
"Position Hold"
);
enumToString
.
insert
(
BRAKE
,
"Brake"
);
enumToString
.
insert
(
THROW
,
"Throw"
);
enumToString
.
insert
(
AVOID_ADSB
,
"Avoid ADSB"
);
enumToString
.
insert
(
GUIDED_NOGPS
,
"Guided No GPS"
);
enumToString
.
insert
(
SAFE_RTL
,
"Smart RTL"
);
enumToString
.
insert
(
STABILIZE
,
"Stabilize"
);
enumToString
.
insert
(
ACRO
,
"Acro"
);
enumToString
.
insert
(
ALT_HOLD
,
"Altitude Hold"
);
enumToString
.
insert
(
AUTO
,
"Auto"
);
enumToString
.
insert
(
GUIDED
,
"Guided"
);
enumToString
.
insert
(
LOITER
,
"Loiter"
);
enumToString
.
insert
(
RTL
,
"RTL"
);
enumToString
.
insert
(
CIRCLE
,
"Circle"
);
enumToString
.
insert
(
LAND
,
"Land"
);
enumToString
.
insert
(
DRIFT
,
"Drift"
);
enumToString
.
insert
(
SPORT
,
"Sport"
);
enumToString
.
insert
(
FLIP
,
"Flip"
);
enumToString
.
insert
(
AUTOTUNE
,
"Autotune"
);
enumToString
.
insert
(
POS_HOLD
,
"Position Hold"
);
enumToString
.
insert
(
BRAKE
,
"Brake"
);
enumToString
.
insert
(
THROW
,
"Throw"
);
enumToString
.
insert
(
AVOID_ADSB
,
"Avoid ADSB"
);
enumToString
.
insert
(
GUIDED_NOGPS
,
"Guided No GPS"
);
enumToString
.
insert
(
SAFE_RTL
,
"Smart RTL"
);
setEnumToStringMapping
(
enumToString
);
}
...
...
src/FirmwarePlugin/APM/ArduCopterFirmwarePlugin.h
View file @
bccbfd14
...
...
@@ -65,8 +65,9 @@ public:
QString
pauseFlightMode
(
void
)
const
override
{
return
QString
(
"Brake"
);
}
QString
landFlightMode
(
void
)
const
override
{
return
QString
(
"Land"
);
}
QString
takeControlFlightMode
(
void
)
const
override
{
return
QString
(
"Loiter"
);
}
bool
vehicleYawsToNextWaypointInMission
(
const
Vehicle
*
vehicle
)
const
final
;
QString
autoDisarmParameter
(
Vehicle
*
vehicle
)
final
{
Q_UNUSED
(
vehicle
);
return
QStringLiteral
(
"DISARM_DELAY"
);
}
bool
vehicleYawsToNextWaypointInMission
(
const
Vehicle
*
vehicle
)
const
override
;
QString
autoDisarmParameter
(
Vehicle
*
vehicle
)
override
{
Q_UNUSED
(
vehicle
);
return
QStringLiteral
(
"DISARM_DELAY"
);
}
bool
supportsSmartRTL
(
void
)
const
override
{
return
true
;
}
private:
static
bool
_remapParamNameIntialized
;
...
...
src/FirmwarePlugin/APM/ArduRoverFirmwarePlugin.h
View file @
bccbfd14
...
...
@@ -47,10 +47,11 @@ public:
// Overrides from FirmwarePlugin
QString
pauseFlightMode
(
void
)
const
override
{
return
QString
(
"Hold"
);
}
void
guidedModeChangeAltitude
(
Vehicle
*
vehicle
,
double
altitudeChange
)
override
;
int
remapParamNameHigestMinorVersionNumber
(
int
majorVersionNumber
)
const
override
;
const
FirmwarePlugin
::
remapParamNameMajorVersionMap_t
&
paramNameRemapMajorVersionMap
(
void
)
const
override
{
return
_remapParamName
;
}
bool
supportsNegativeThrust
(
void
)
override
;
void
guidedModeChangeAltitude
(
Vehicle
*
vehicle
,
double
altitudeChange
)
final
;
int
remapParamNameHigestMinorVersionNumber
(
int
majorVersionNumber
)
const
final
;
const
FirmwarePlugin
::
remapParamNameMajorVersionMap_t
&
paramNameRemapMajorVersionMap
(
void
)
const
final
{
return
_remapParamName
;
}
bool
supportsNegativeThrust
(
void
)
final
;
bool
supportsSmartRTL
(
void
)
const
override
{
return
true
;
}
QString
offlineEditingParamFile
(
Vehicle
*
vehicle
)
override
{
Q_UNUSED
(
vehicle
);
return
QStringLiteral
(
":/FirmwarePlugin/APM/Rover.OfflineEditing.params"
);
}
private:
...
...
src/FirmwarePlugin/FirmwarePlugin.cc
View file @
bccbfd14
...
...
@@ -240,10 +240,11 @@ void FirmwarePlugin::pauseVehicle(Vehicle* vehicle)
qgcApp
()
->
showMessage
(
guided_mode_not_supported_by_vehicle
);
}
void
FirmwarePlugin
::
guidedModeRTL
(
Vehicle
*
vehicle
)
void
FirmwarePlugin
::
guidedModeRTL
(
Vehicle
*
vehicle
,
bool
smartRTL
)
{
// Not supported by generic vehicle
Q_UNUSED
(
vehicle
);
Q_UNUSED
(
smartRTL
);
qgcApp
()
->
showMessage
(
guided_mode_not_supported_by_vehicle
);
}
...
...
src/FirmwarePlugin/FirmwarePlugin.h
View file @
bccbfd14
...
...
@@ -105,6 +105,11 @@ public:
/// Returns the flight mode for RTL
virtual
QString
rtlFlightMode
(
void
)
const
{
return
QString
();
}
/// Returns the flight mode for Smart RTL
virtual
QString
smartRTLFlightMode
(
void
)
const
{
return
QString
();
}
virtual
bool
supportsSmartRTL
(
void
)
const
{
return
false
;
}
/// Returns the flight mode for Land
virtual
QString
landFlightMode
(
void
)
const
{
return
QString
();
}
...
...
@@ -125,7 +130,7 @@ public:
virtual
void
pauseVehicle
(
Vehicle
*
vehicle
);
/// Command vehicle to return to launch
virtual
void
guidedModeRTL
(
Vehicle
*
vehicle
);
virtual
void
guidedModeRTL
(
Vehicle
*
vehicle
,
bool
smartRTL
);
/// Command vehicle to land at current location
virtual
void
guidedModeLand
(
Vehicle
*
vehicle
);
...
...
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
View file @
bccbfd14
...
...
@@ -351,8 +351,9 @@ void PX4FirmwarePlugin::pauseVehicle(Vehicle* vehicle)
NAN
);
}
void
PX4FirmwarePlugin
::
guidedModeRTL
(
Vehicle
*
vehicle
)
void
PX4FirmwarePlugin
::
guidedModeRTL
(
Vehicle
*
vehicle
,
bool
smartRTL
)
{
Q_UNUSED
(
smartRTL
);
_setFlightModeAndValidate
(
vehicle
,
_rtlFlightMode
);
}
...
...
src/FirmwarePlugin/PX4/PX4FirmwarePlugin.h
View file @
bccbfd14
...
...
@@ -44,7 +44,7 @@ public:
QString
takeControlFlightMode
(
void
)
const
override
{
return
_manualFlightMode
;
}
QString
gotoFlightMode
(
void
)
const
override
{
return
_holdFlightMode
;
}
void
pauseVehicle
(
Vehicle
*
vehicle
)
override
;
void
guidedModeRTL
(
Vehicle
*
vehicle
)
override
;
void
guidedModeRTL
(
Vehicle
*
vehicle
,
bool
smartRTL
)
override
;
void
guidedModeLand
(
Vehicle
*
vehicle
)
override
;
void
guidedModeTakeoff
(
Vehicle
*
vehicle
,
double
takeoffAltRel
)
override
;
void
guidedModeGotoLocation
(
Vehicle
*
vehicle
,
const
QGeoCoordinate
&
gotoCoord
)
override
;
...
...
src/FlightDisplay/GuidedActionConfirm.qml
View file @
bccbfd14
...
...
@@ -35,6 +35,8 @@ Rectangle {
property
var
actionData
property
bool
hideTrigger
:
false
property
var
mapIndicator
property
alias
optionText
:
optionCheckBox
.
text
property
alias
optionChecked
:
optionCheckBox
.
checked
property
real
_margins
:
ScreenTools
.
defaultFontPixelWidth
property
bool
_emergencyAction
:
action
===
guidedController
.
actionEmergencyStop
...
...
@@ -101,6 +103,13 @@ Rectangle {
wrapMode
:
Text
.
WordWrap
}
QGCCheckBox
{
id
:
optionCheckBox
anchors.horizontalCenter
:
parent
.
horizontalCenter
text
:
""
visible
:
text
!==
""
}
// Action confirmation control
SliderSwitch
{
id
:
slider
...
...
@@ -115,7 +124,7 @@ Rectangle {
altitudeSlider
.
visible
=
false
}
hideTrigger
=
false
guidedController
.
executeAction
(
_root
.
action
,
_root
.
actionData
,
altitudeChange
)
guidedController
.
executeAction
(
_root
.
action
,
_root
.
actionData
,
altitudeChange
,
_root
.
optionChecked
)
if
(
mapIndicator
)
{
mapIndicator
.
actionConfirmed
()
mapIndicator
=
undefined
...
...
src/FlightDisplay/GuidedActionsController.qml
View file @
bccbfd14
...
...
@@ -203,7 +203,7 @@ Item {
on_FlightModeChanged
:
{
_vehiclePaused
=
_activeVehicle
?
_flightMode
===
_activeVehicle
.
pauseFlightMode
:
false
_vehicleInRTLMode
=
_activeVehicle
?
_flightMode
===
_activeVehicle
.
rtlFlightMode
:
false
_vehicleInRTLMode
=
_activeVehicle
?
_flightMode
===
_activeVehicle
.
rtlFlightMode
||
_flightMode
===
_activeVehicle
.
smartRTLFlightMode
:
false
_vehicleInLandMode
=
_activeVehicle
?
_flightMode
===
_activeVehicle
.
landFlightMode
:
false
_vehicleInMissionMode
=
_activeVehicle
?
_flightMode
===
_activeVehicle
.
missionFlightMode
:
false
// Must be last to get correct signalling for showStartMission popups
}
...
...
@@ -216,6 +216,7 @@ Item {
confirmDialog
.
actionData
=
actionData
confirmDialog
.
hideTrigger
=
true
confirmDialog
.
mapIndicator
=
mapIndicator
confirmDialog
.
optionText
=
""
_actionData
=
actionData
switch
(
actionCode
)
{
case
actionArm
:
...
...
@@ -279,6 +280,10 @@ Item {
case
actionRTL
:
confirmDialog
.
title
=
rtlTitle
confirmDialog
.
message
=
rtlMessage
if
(
_activeVehicle
.
supportsSmartRTL
)
{
confirmDialog
.
optionText
=
qsTr
(
"
Smart RTL
"
)
confirmDialog
.
optionChecked
=
false
}
confirmDialog
.
hideTrigger
=
Qt
.
binding
(
function
()
{
return
!
showRTL
})
break
;
case
actionChangeAlt
:
...
...
@@ -339,12 +344,12 @@ Item {
}
// Executes the specified action
function
executeAction
(
actionCode
,
actionData
,
actionAltitudeChange
)
{
function
executeAction
(
actionCode
,
actionData
,
actionAltitudeChange
,
optionChecked
)
{
var
i
;
var
rgVehicle
;
switch
(
actionCode
)
{
case
actionRTL
:
_activeVehicle
.
guidedModeRTL
()
_activeVehicle
.
guidedModeRTL
(
optionChecked
)
break
case
actionLand
:
_activeVehicle
.
guidedModeLand
()
...
...
src/Vehicle/Vehicle.cc
View file @
bccbfd14
...
...
@@ -2975,13 +2975,13 @@ QString Vehicle::gotoFlightMode() const
return
_firmwarePlugin
->
gotoFlightMode
();
}
void
Vehicle
::
guidedModeRTL
(
void
)
void
Vehicle
::
guidedModeRTL
(
bool
smartRTL
)
{
if
(
!
guidedModeSupported
())
{
qgcApp
()
->
showMessage
(
guided_mode_not_supported_by_vehicle
);
return
;
}
_firmwarePlugin
->
guidedModeRTL
(
this
);
_firmwarePlugin
->
guidedModeRTL
(
this
,
smartRTL
);
}
void
Vehicle
::
guidedModeLand
(
void
)
...
...
@@ -3602,6 +3602,16 @@ QString Vehicle::rtlFlightMode(void) const
return
_firmwarePlugin
->
rtlFlightMode
();
}
QString
Vehicle
::
smartRTLFlightMode
(
void
)
const
{
return
_firmwarePlugin
->
smartRTLFlightMode
();
}
bool
Vehicle
::
supportsSmartRTL
(
void
)
const
{
return
_firmwarePlugin
->
supportsSmartRTL
();
}
QString
Vehicle
::
landFlightMode
(
void
)
const
{
return
_firmwarePlugin
->
landFlightMode
();
...
...
src/Vehicle/Vehicle.h
View file @
bccbfd14
...
...
@@ -600,6 +600,8 @@ public:
Q_PROPERTY
(
QString
missionFlightMode
READ
missionFlightMode
CONSTANT
)
Q_PROPERTY
(
QString
pauseFlightMode
READ
pauseFlightMode
CONSTANT
)
Q_PROPERTY
(
QString
rtlFlightMode
READ
rtlFlightMode
CONSTANT
)
Q_PROPERTY
(
QString
smartRTLFlightMode
READ
smartRTLFlightMode
CONSTANT
)
Q_PROPERTY
(
bool
supportsSmartRTL
READ
supportsSmartRTL
CONSTANT
)
Q_PROPERTY
(
QString
landFlightMode
READ
landFlightMode
CONSTANT
)
Q_PROPERTY
(
QString
takeControlFlightMode
READ
takeControlFlightMode
CONSTANT
)
Q_PROPERTY
(
QString
firmwareTypeString
READ
firmwareTypeString
NOTIFY
firmwareTypeChanged
)
...
...
@@ -698,7 +700,7 @@ public:
Q_INVOKABLE
void
disconnectInactiveVehicle
(
void
);
/// Command vehicle to return to launch
Q_INVOKABLE
void
guidedModeRTL
(
void
);
Q_INVOKABLE
void
guidedModeRTL
(
bool
smartRTL
);
/// Command vehicle to land at current location
Q_INVOKABLE
void
guidedModeLand
(
void
);
...
...
@@ -919,6 +921,8 @@ public:
QString
missionFlightMode
()
const
;
QString
pauseFlightMode
()
const
;
QString
rtlFlightMode
()
const
;
QString
smartRTLFlightMode
()
const
;
bool
supportsSmartRTL
()
const
;
QString
landFlightMode
()
const
;
QString
takeControlFlightMode
()
const
;
double
defaultCruiseSpeed
()
const
{
return
_defaultCruiseSpeed
;
}
...
...
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