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
921f015a
Commit
921f015a
authored
Feb 22, 2017
by
Don Gagne
Committed by
GitHub
Feb 22, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4599 from DonLakeFlyer/FWLandingPattern
Complex Item: Fixed Wing Landing Pattern
parents
08d7827f
248ec047
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
250 additions
and
53 deletions
+250
-53
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-0
FWLandingPatternEditor.qml
src/MissionEditor/FWLandingPatternEditor.qml
+17
-3
FWLandingPatternMapVisual.qml
src/MissionEditor/FWLandingPatternMapVisual.qml
+64
-0
FWLandingPattern.FactMetaData.json
src/MissionManager/FWLandingPattern.FactMetaData.json
+39
-0
FixedWingLandingComplexItem.cc
src/MissionManager/FixedWingLandingComplexItem.cc
+101
-46
FixedWingLandingComplexItem.h
src/MissionManager/FixedWingLandingComplexItem.h
+26
-2
MissionController.cc
src/MissionManager/MissionController.cc
+2
-2
No files found.
qgroundcontrol.qrc
View file @
921f015a
...
...
@@ -56,6 +56,7 @@
<file alias="QGroundControl/Controls/FactSliderPanel.qml">src/QmlControls/FactSliderPanel.qml</file>
<file alias="QGroundControl/Controls/FlightModeDropdown.qml">src/QmlControls/FlightModeDropdown.qml</file>
<file alias="QGroundControl/Controls/FlightModeMenu.qml">src/QmlControls/FlightModeMenu.qml</file>
<file alias="QGroundControl/Controls/FWLandingPatternMapVisual.qml">src/MissionEditor/FWLandingPatternMapVisual.qml</file>
<file alias="QGroundControl/Controls/GuidedBar.qml">src/QmlControls/GuidedBar.qml</file>
<file alias="QGroundControl/Controls/IndicatorButton.qml">src/QmlControls/IndicatorButton.qml</file>
<file alias="QGroundControl/Controls/JoystickThumbPad.qml">src/QmlControls/JoystickThumbPad.qml</file>
...
...
src/MissionEditor/FWLandingPatternEditor.qml
View file @
921f015a
...
...
@@ -31,11 +31,25 @@ Rectangle {
//property real availableWidth ///< Width for control
//property var missionItem ///< Mission Item for editor
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
*
0.25
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
*
0.25
Column
{
id
:
editorColumn
id
:
editorColumn
anchors.margins
:
_margin
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
QGCLabel
{
text
:
"
WIP
"
}
QGCLabel
{
text
:
"
WIP (NOT FOR REAL FLIGHT!)
"
}
FactTextFieldGrid
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
factList
:
missionItem
.
textFieldFacts
}
FactCheckBox
{
text
:
missionItem
.
loiterClockwise
.
name
fact
:
missionItem
.
loiterClockwise
}
}
}
src/MissionEditor/FWLandingPatternMapVisual.qml
0 → 100644
View file @
921f015a
/****************************************************************************
*
* (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.
*
****************************************************************************/
import
QtQuick
2.2
import
QtQuick
.
Controls
1.2
import
QtLocation
5.3
import
QtPositioning
5.2
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Controls
1.0
/// Fixed Wing Landing Pattern map visuals
Item
{
property
var
map
///< Map control to place item in
property
var
_loiterPoint
property
var
_flightPath
Component.onCompleted
:
{
_flightPath
=
flightPathComponent
.
createObject
(
map
)
_loiterPoint
=
loiterComponent
.
createObject
(
map
)
map
.
addMapItem
(
_flightPath
)
map
.
addMapItem
(
_loiterPoint
)
}
Component.onDestruction
:
{
_loiterPoint
.
destroy
()
_flightPath
.
destroy
()
}
// Flight path
Component
{
id
:
flightPathComponent
MapPolyline
{
line.color
:
"
white
"
line.width
:
2
path
:
[
object
.
loiterCoordinate
,
object
.
exitCoordinate
]
}
}
// Loiter point
Component
{
id
:
loiterComponent
MapQuickItem
{
anchorPoint.x
:
sourceItem
.
width
/
2
anchorPoint.y
:
sourceItem
.
height
/
2
coordinate
:
object
.
loiterCoordinate
sourceItem
:
MissionItemIndexLabel
{
label
:
"
L
"
}
}
}
}
src/MissionManager/FWLandingPattern.FactMetaData.json
View file @
921f015a
[
{
"name"
:
"Landing distance"
,
"shortDescription"
:
"Distance between landing and loiter points."
,
"type"
:
"double"
,
"units"
:
"m"
,
"decimalPlaces"
:
1
,
"defaultValue"
:
100.0
},
{
"name"
:
"Landing heading"
,
"shortDescription"
:
"Heading from land point to loiter point."
,
"type"
:
"double"
,
"units"
:
"deg"
,
"decimalPlaces"
:
0
,
"defaultValue"
:
0.0
},
{
"name"
:
"Loiter altitude"
,
"shortDescription"
:
"Altitude to loiter prior to landing."
,
"type"
:
"double"
,
"units"
:
"m"
,
"decimalPlaces"
:
1
,
"defaultValue"
:
40.0
},
{
"name"
:
"Loiter radius"
,
"shortDescription"
:
"Loiter radius."
,
"type"
:
"double"
,
"decimalPlaces"
:
1
,
"min"
:
0.1
,
"units"
:
"m"
,
"defaultValue"
:
75.0
},
{
"name"
:
"Clockwise loiter"
,
"shortDescription"
:
"If true, loiter will be clockwise. False, loiter will be counter-clockwise."
,
"type"
:
"bool"
,
"defaultValue"
:
true
}
]
src/MissionManager/FixedWingLandingComplexItem.cc
View file @
921f015a
This diff is collapsed.
Click to expand it.
src/MissionManager/FixedWingLandingComplexItem.h
View file @
921f015a
...
...
@@ -22,7 +22,13 @@ class FixedWingLandingComplexItem : public ComplexMissionItem
Q_OBJECT
public:
FixedWingLandingComplexItem
(
Vehicle
*
vehicle
,
QObject
*
parent
=
NULL
);
FixedWingLandingComplexItem
(
Vehicle
*
vehicle
,
QGeoCoordinate
mapClickCoordinate
,
QObject
*
parent
=
NULL
);
Q_PROPERTY
(
QVariantList
textFieldFacts
MEMBER
_textFieldFacts
CONSTANT
)
Q_PROPERTY
(
Fact
*
loiterClockwise
READ
loiterClockwise
CONSTANT
)
Q_PROPERTY
(
QGeoCoordinate
loiterCoordinate
MEMBER
_loiterCoordinate
NOTIFY
loiterCoordinateChanged
)
Fact
*
loiterClockwise
(
void
)
{
return
&
_loiterClockwiseFact
;
}
// Overrides from ComplexMissionItem
...
...
@@ -32,7 +38,7 @@ public:
bool
load
(
const
QJsonObject
&
complexObject
,
int
sequenceNumber
,
QString
&
errorString
)
final
;
double
greatestDistanceTo
(
const
QGeoCoordinate
&
other
)
const
final
;
void
setCruiseSpeed
(
double
cruiseSpeed
)
final
;
QString
mapVisualQML
(
void
)
const
final
{
return
QString
(
);
}
QString
mapVisualQML
(
void
)
const
final
{
return
QString
Literal
(
"FWLandingPatternMapVisual.qml"
);
}
// Overrides from VisualMissionItem
...
...
@@ -60,18 +66,36 @@ public:
static
const
char
*
jsonComplexItemTypeValue
;
signals:
void
loiterCoordinateChanged
(
QGeoCoordinate
coordinate
);
private
slots
:
void
_recalcLoiterPosition
(
void
);
private:
void
_setExitCoordinate
(
const
QGeoCoordinate
&
coordinate
);
QPointF
_rotatePoint
(
const
QPointF
&
point
,
const
QPointF
&
origin
,
double
angle
);
int
_sequenceNumber
;
bool
_dirty
;
QGeoCoordinate
_coordinate
;
QGeoCoordinate
_exitCoordinate
;
QGeoCoordinate
_loiterCoordinate
;
Fact
_loiterToLandDistanceFact
;
Fact
_loiterAltitudeFact
;
Fact
_loiterRadiusFact
;
Fact
_loiterClockwiseFact
;
Fact
_landingHeadingFact
;
static
QMap
<
QString
,
FactMetaData
*>
_metaDataMap
;
QVariantList
_textFieldFacts
;
static
const
char
*
_loiterToLandDistanceName
;
static
const
char
*
_loiterAltitudeName
;
static
const
char
*
_loiterRadiusName
;
static
const
char
*
_loiterClockwiseName
;
static
const
char
*
_landingHeadingName
;
};
#endif
src/MissionManager/MissionController.cc
View file @
921f015a
...
...
@@ -226,14 +226,14 @@ int MissionController::insertComplexMissionItem(QString itemName, QGeoCoordinate
int
sequenceNumber
=
_nextSequenceNumber
();
if
(
itemName
==
_surveyMissionItemName
)
{
newItem
=
new
SurveyMissionItem
(
_activeVehicle
,
_visualItems
);
newItem
->
setCoordinate
(
mapCenterCoordinate
);
}
else
if
(
itemName
==
_fwLandingMissionItemName
)
{
newItem
=
new
FixedWingLandingComplexItem
(
_activeVehicle
,
_visualItems
);
newItem
=
new
FixedWingLandingComplexItem
(
_activeVehicle
,
mapCenterCoordinate
,
_visualItems
);
}
else
{
qWarning
()
<<
"Internal error: Unknown complex item:"
<<
itemName
;
return
sequenceNumber
;
}
newItem
->
setSequenceNumber
(
sequenceNumber
);
newItem
->
setCoordinate
(
mapCenterCoordinate
);
_initVisualItem
(
newItem
);
_visualItems
->
insert
(
i
,
newItem
);
...
...
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