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
5ad6fdf2
Unverified
Commit
5ad6fdf2
authored
May 21, 2018
by
Don Gagne
Committed by
GitHub
May 21, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6479 from DonLakeFlyer/FWLandingWork
Fixed Wing Landing Pattern: Visualize landing area
parents
11646eb7
c7ea53d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
3 deletions
+41
-3
FWLandingPatternMapVisual.qml
src/PlanView/FWLandingPatternMapVisual.qml
+41
-3
No files found.
src/PlanView/FWLandingPatternMapVisual.qml
View file @
5ad6fdf2
...
...
@@ -36,7 +36,8 @@ Item {
readonly
property
int
_flightPathIndex
:
0
readonly
property
int
_loiterPointIndex
:
1
readonly
property
int
_loiterRadiusIndex
:
2
readonly
property
int
_landPointIndex
:
3
readonly
property
int
_landingAreaIndex
:
3
readonly
property
int
_landPointIndex
:
4
function
hideItemVisuals
()
{
for
(
var
i
=
0
;
i
<
_itemVisuals
.
length
;
i
++
)
{
...
...
@@ -56,6 +57,9 @@ Item {
itemVisual
=
loiterRadiusComponent
.
createObject
(
map
)
map
.
addMapItem
(
itemVisual
)
_itemVisuals
[
_loiterRadiusIndex
]
=
itemVisual
itemVisual
=
landingAreaComponent
.
createObject
(
map
)
map
.
addMapItem
(
itemVisual
)
_itemVisuals
[
_landingAreaIndex
]
=
itemVisual
itemVisual
=
landPointComponent
.
createObject
(
map
)
map
.
addMapItem
(
itemVisual
)
_itemVisuals
[
_landPointIndex
]
=
itemVisual
...
...
@@ -224,7 +228,6 @@ Item {
}
}
// Loiter radius visual
Component
{
id
:
loiterRadiusComponent
...
...
@@ -238,7 +241,6 @@ Item {
}
}
// Land point
Component
{
id
:
landPointComponent
...
...
@@ -258,4 +260,40 @@ Item {
}
}
}
Component
{
id
:
landingAreaComponent
MapPolygon
{
z
:
QGroundControl
.
zOrderMapItems
border.width
:
1
border.color
:
"
black
"
color
:
"
green
"
opacity
:
0.5
readonly
property
real
landingWidth
:
15
readonly
property
real
landingLength
:
100
readonly
property
real
angleRadians
:
Math
.
atan
((
landingWidth
/
2
)
/
(
landingLength
/
2
))
readonly
property
real
angleDegrees
:
(
angleRadians
*
(
180
/
Math
.
PI
))
readonly
property
real
hypotenuse
:
(
landingWidth
/
2
)
/
Math
.
sin
(
angleRadians
)
property
real
landingAreaAngle
:
_missionItem
.
landingCoordinate
.
azimuthTo
(
_missionItem
.
loiterTangentCoordinate
)
function
calcPoly
()
{
path
=
[
]
addCoordinate
(
_missionItem
.
landingCoordinate
.
atDistanceAndAzimuth
(
hypotenuse
,
landingAreaAngle
-
angleDegrees
))
addCoordinate
(
_missionItem
.
landingCoordinate
.
atDistanceAndAzimuth
(
hypotenuse
,
landingAreaAngle
+
angleDegrees
))
addCoordinate
(
_missionItem
.
landingCoordinate
.
atDistanceAndAzimuth
(
hypotenuse
,
landingAreaAngle
+
(
180
-
angleDegrees
)))
addCoordinate
(
_missionItem
.
landingCoordinate
.
atDistanceAndAzimuth
(
hypotenuse
,
landingAreaAngle
-
(
180
-
angleDegrees
)))
}
Component.onCompleted
:
calcPoly
()
Connections
{
target
:
_missionItem
onLandingCoordinateChanged
:
calcPoly
()
onLoiterTangentCoordinateChanged
:
calcPoly
()
}
}
}
}
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