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
5217ee44
Commit
5217ee44
authored
May 01, 2018
by
DonLakeFlyer
Browse files
Fix bug in terrain transect adjustment
First and last points in transects did not have altitudes set correctly
parent
07fba793
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/MissionManager/TransectStyleComplexItem.cc
View file @
5217ee44
...
...
@@ -611,7 +611,7 @@ void TransectStyleComplexItem::_addInterstitialTerrainPoints(QList<CoordInfo_t>&
{
QList
<
CoordInfo_t
>
adjustedTransect
;
adjustedTransect
.
append
(
transect
.
first
()
);
double
requestedAltitude
=
_cameraCalc
.
distanceToSurface
()
->
rawValue
().
toDouble
(
);
for
(
int
i
=
0
;
i
<
transect
.
count
()
-
1
;
i
++
)
{
CoordInfo_t
fromCoordInfo
=
transect
[
i
];
...
...
@@ -621,11 +621,14 @@ void TransectStyleComplexItem::_addInterstitialTerrainPoints(QList<CoordInfo_t>&
double
distance
=
fromCoordInfo
.
coord
.
distanceTo
(
toCoordInfo
.
coord
);
const
TerrainPathQuery
::
PathHeightInfo_t
&
pathHeightInfo
=
transectPathHeightInfo
[
i
];
double
requestedAltitude
=
_cameraCalc
.
distanceToSurface
()
->
rawValue
().
toDouble
();
fromCoordInfo
.
coord
.
setAltitude
(
pathHeightInfo
.
heights
.
first
()
+
requestedAltitude
);
toCoordInfo
.
coord
.
setAltitude
(
pathHeightInfo
.
heights
.
last
()
+
requestedAltitude
);
if
(
i
==
0
)
{
adjustedTransect
.
append
(
fromCoordInfo
);
}
int
cHeights
=
pathHeightInfo
.
heights
.
count
();
for
(
int
pathHeightIndex
=
1
;
pathHeightIndex
<
cHeights
-
1
;
pathHeightIndex
++
)
{
double
interstitialTerrainHeight
=
pathHeightInfo
.
heights
[
pathHeightIndex
];
...
...
@@ -642,6 +645,11 @@ void TransectStyleComplexItem::_addInterstitialTerrainPoints(QList<CoordInfo_t>&
adjustedTransect
.
append
(
toCoordInfo
);
}
CoordInfo_t
lastCoordInfo
=
transect
.
last
();
const
TerrainPathQuery
::
PathHeightInfo_t
&
pathHeightInfo
=
transectPathHeightInfo
.
last
();
lastCoordInfo
.
coord
.
setAltitude
(
pathHeightInfo
.
heights
.
last
()
+
requestedAltitude
);
adjustedTransect
.
append
(
lastCoordInfo
);
#if 0
qDebug() << "_addInterstitialTerrainPoints";
foreach (const TransectStyleComplexItem::CoordInfo_t& coordInfo, adjustedTransect) {
...
...
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