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
215d3049
Unverified
Commit
215d3049
authored
May 01, 2018
by
Don Gagne
Committed by
GitHub
May 01, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6402 from DonLakeFlyer/TerrainFix
Fix bug in terrain transect adjustment
parents
f3444099
5217ee44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
TransectStyleComplexItem.cc
src/MissionManager/TransectStyleComplexItem.cc
+10
-2
No files found.
src/MissionManager/TransectStyleComplexItem.cc
View file @
215d3049
...
...
@@ -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
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