Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
e98e7dde
Commit
e98e7dde
authored
May 05, 2017
by
Don Gagne
Committed by
GitHub
May 05, 2017
Browse files
Merge pull request #5094 from DonLakeFlyer/FWLanding
Fixed Wing Landing pattern
parents
2e3a5199
4f0a1d34
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/MissionManager/FixedWingLandingComplexItem.cc
View file @
e98e7dde
...
...
@@ -90,6 +90,9 @@ FixedWingLandingComplexItem::FixedWingLandingComplexItem(Vehicle* vehicle, QObje
connect
(
this
,
&
FixedWingLandingComplexItem
::
loiterClockwiseChanged
,
this
,
&
FixedWingLandingComplexItem
::
_setDirty
);
connect
(
this
,
&
FixedWingLandingComplexItem
::
loiterAltitudeRelativeChanged
,
this
,
&
FixedWingLandingComplexItem
::
_setDirty
);
connect
(
this
,
&
FixedWingLandingComplexItem
::
landingAltitudeRelativeChanged
,
this
,
&
FixedWingLandingComplexItem
::
_setDirty
);
connect
(
this
,
&
FixedWingLandingComplexItem
::
loiterAltitudeRelativeChanged
,
this
,
&
FixedWingLandingComplexItem
::
coordinateHasRelativeAltitudeChanged
);
connect
(
this
,
&
FixedWingLandingComplexItem
::
landingAltitudeRelativeChanged
,
this
,
&
FixedWingLandingComplexItem
::
exitCoordinateHasRelativeAltitudeChanged
);
}
int
FixedWingLandingComplexItem
::
lastSequenceNumber
(
void
)
const
...
...
@@ -409,6 +412,7 @@ void FixedWingLandingComplexItem::_recalcFromRadiusChange(void)
double
angleLoiterToTangent
=
qRadiansToDegrees
(
qAsin
(
radius
/
landToLoiterDistance
))
*
(
_loiterClockwise
?
-
1
:
1
);
_loiterCoordinate
=
_landingCoordinate
.
atDistanceAndAzimuth
(
landToLoiterDistance
,
heading
+
180
+
angleLoiterToTangent
);
_loiterCoordinate
.
setAltitude
(
_loiterAltitudeFact
.
rawValue
().
toDouble
());
_ignoreRecalcSignals
=
true
;
emit
loiterCoordinateChanged
(
_loiterCoordinate
);
...
...
@@ -446,6 +450,7 @@ void FixedWingLandingComplexItem::_recalcFromHeadingAndDistanceChange(void)
// Use those values to get the new loiter point which takes heading into acount
_loiterCoordinate
=
_landingCoordinate
.
atDistanceAndAzimuth
(
loiterDistance
,
heading
+
180
+
loiterAzimuth
);
_loiterCoordinate
.
setAltitude
(
_loiterAltitudeFact
.
rawValue
().
toDouble
());
_ignoreRecalcSignals
=
true
;
emit
loiterTangentCoordinateChanged
(
_loiterTangentCoordinate
);
...
...
@@ -509,11 +514,14 @@ void FixedWingLandingComplexItem::_recalcFromCoordinateChange(void)
void
FixedWingLandingComplexItem
::
_updateLoiterCoodinateAltitudeFromFact
(
void
)
{
_loiterCoordinate
.
setAltitude
(
_loiterAltitudeFact
.
rawValue
().
toDouble
());
emit
loiterCoordinateChanged
(
_loiterCoordinate
);
emit
coordinateChanged
(
_loiterCoordinate
);
}
void
FixedWingLandingComplexItem
::
_updateLandingCoodinateAltitudeFromFact
(
void
)
{
_landingCoordinate
.
setAltitude
(
_landingAltitudeFact
.
rawValue
().
toDouble
());
emit
landingCoordinateChanged
(
_landingCoordinate
);
}
void
FixedWingLandingComplexItem
::
_setDirty
(
void
)
...
...
src/MissionManager/FixedWingLandingComplexItem.h
View file @
e98e7dde
...
...
@@ -78,9 +78,9 @@ public:
void
appendMissionItems
(
QList
<
MissionItem
*>&
items
,
QObject
*
missionItemParent
)
final
;
void
applyNewAltitude
(
double
newAltitude
)
final
;
bool
coordinateHasRelativeAltitude
(
void
)
const
final
{
return
tru
e
;
}
bool
exitCoordinateHasRelativeAltitude
(
void
)
const
final
{
return
tru
e
;
}
bool
exitCoordinateSameAsEntry
(
void
)
const
final
{
return
tru
e
;
}
bool
coordinateHasRelativeAltitude
(
void
)
const
final
{
return
_loiterAltitudeRelativ
e
;
}
bool
exitCoordinateHasRelativeAltitude
(
void
)
const
final
{
return
_landingAltitudeRelativ
e
;
}
bool
exitCoordinateSameAsEntry
(
void
)
const
final
{
return
fals
e
;
}
void
setDirty
(
bool
dirty
)
final
;
void
setCoordinate
(
const
QGeoCoordinate
&
coordinate
)
final
{
setLoiterCoordinate
(
coordinate
);
}
...
...
src/PlanView/FWLandingPatternEditor.qml
View file @
e98e7dde
...
...
@@ -41,14 +41,6 @@ Rectangle {
anchors.right
:
parent
.
right
visible
:
missionItem
.
landingCoordSet
QGCLabel
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
wrapMode
:
Text
.
WordWrap
font.pointSize
:
ScreenTools
.
smallFontPointSize
text
:
qsTr
(
"
WIP (NOT FOR REAL FLIGHT!)
"
)
}
SectionHeader
{
text
:
qsTr
(
"
Loiter point
"
)
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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