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
c7ea53d4
Commit
c7ea53d4
authored
May 21, 2018
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rotate landing area
parent
042f02b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
10 deletions
+26
-10
FWLandingPatternMapVisual.qml
src/PlanView/FWLandingPatternMapVisual.qml
+26
-10
No files found.
src/PlanView/FWLandingPatternMapVisual.qml
View file @
c7ea53d4
...
...
@@ -36,8 +36,8 @@ Item {
readonly
property
int
_flightPathIndex
:
0
readonly
property
int
_loiterPointIndex
:
1
readonly
property
int
_loiterRadiusIndex
:
2
readonly
property
int
_land
PointIndex
:
3
readonly
property
int
_land
ingAreaIndex
:
4
readonly
property
int
_land
ingAreaIndex
:
3
readonly
property
int
_land
PointIndex
:
4
function
hideItemVisuals
()
{
for
(
var
i
=
0
;
i
<
_itemVisuals
.
length
;
i
++
)
{
...
...
@@ -57,12 +57,12 @@ Item {
itemVisual
=
loiterRadiusComponent
.
createObject
(
map
)
map
.
addMapItem
(
itemVisual
)
_itemVisuals
[
_loiterRadiusIndex
]
=
itemVisual
itemVisual
=
landPointComponent
.
createObject
(
map
)
map
.
addMapItem
(
itemVisual
)
_itemVisuals
[
_landPointIndex
]
=
itemVisual
itemVisual
=
landingAreaComponent
.
createObject
(
map
)
map
.
addMapItem
(
itemVisual
)
_itemVisuals
[
_landingAreaIndex
]
=
itemVisual
itemVisual
=
landPointComponent
.
createObject
(
map
)
map
.
addMapItem
(
itemVisual
)
_itemVisuals
[
_landPointIndex
]
=
itemVisual
}
}
...
...
@@ -258,20 +258,36 @@ Item {
Component
{
id
:
landingAreaComponent
Map
Rectangle
{
Map
Polygon
{
z
:
QGroundControl
.
zOrderMapItems
border.width
:
1
border.color
:
"
black
"
color
:
"
green
"
opacity
:
0.5
topLeft
:
_missionItem
.
landingCoordinate
.
atDistanceAndAzimuth
(
hypotenuse
,
-
angleDegrees
)
bottomRight
:
_missionItem
.
landingCoordinate
.
atDistanceAndAzimuth
(
hypotenuse
,
180
-
angleDegrees
)
readonly
property
real
landingWidth
:
1
0
readonly
property
real
landingWidth
:
1
5
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
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