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
7a8d75a8
Unverified
Commit
7a8d75a8
authored
Oct 25, 2018
by
Don Gagne
Committed by
GitHub
Oct 25, 2018
Browse files
Merge pull request #6953 from DonLakeFlyer/CameraShots
Fixed camera shot count when trigger distance == 0
parents
4e215c91
eecef884
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/MissionManager/CorridorScanComplexItem.cc
View file @
7a8d75a8
...
...
@@ -466,11 +466,16 @@ void CorridorScanComplexItem::_rebuildTransectsPhase2(void)
_complexDistance
+=
_visualTransectPoints
[
i
].
value
<
QGeoCoordinate
>
().
distanceTo
(
_visualTransectPoints
[
i
+
1
].
value
<
QGeoCoordinate
>
());
}
if
(
_cameraTriggerInTurnAroundFact
.
rawValue
().
toBool
())
{
_cameraShots
=
qCeil
(
_complexDistance
/
_cameraCalc
.
adjustedFootprintFrontal
()
->
rawValue
().
toDouble
());
double
triggerDistance
=
_cameraCalc
.
adjustedFootprintFrontal
()
->
rawValue
().
toDouble
();
if
(
triggerDistance
==
0
)
{
_cameraShots
=
0
;
}
else
{
int
singleTransectImageCount
=
qCeil
(
_corridorPolyline
.
length
()
/
_cameraCalc
.
adjustedFootprintFrontal
()
->
rawValue
().
toDouble
());
_cameraShots
=
singleTransectImageCount
*
_transectCount
();
if
(
_cameraTriggerInTurnAroundFact
.
rawValue
().
toBool
())
{
_cameraShots
=
qCeil
(
_complexDistance
/
triggerDistance
);
}
else
{
int
singleTransectImageCount
=
qCeil
(
_corridorPolyline
.
length
()
/
triggerDistance
);
_cameraShots
=
singleTransectImageCount
*
_transectCount
();
}
}
_coordinate
=
_visualTransectPoints
.
count
()
?
_visualTransectPoints
.
first
().
value
<
QGeoCoordinate
>
()
:
QGeoCoordinate
();
...
...
src/MissionManager/StructureScanComplexItem.cc
View file @
7a8d75a8
...
...
@@ -433,6 +433,12 @@ void StructureScanComplexItem::_rebuildFlightPolygon(void)
void
StructureScanComplexItem
::
_recalcCameraShots
(
void
)
{
double
triggerDistance
=
_cameraCalc
.
adjustedFootprintSide
()
->
rawValue
().
toDouble
();
if
(
triggerDistance
==
0
)
{
_setCameraShots
(
0
);
return
;
}
if
(
_flightPolygon
.
count
()
<
3
)
{
_setCameraShots
(
0
);
return
;
...
...
@@ -450,7 +456,7 @@ void StructureScanComplexItem::_recalcCameraShots(void)
return
;
}
int
cameraShots
=
distance
/
_cameraCalc
.
adjustedFootprintSide
()
->
rawValue
().
toDouble
()
;
int
cameraShots
=
distance
/
triggerDistance
;
_setCameraShots
(
cameraShots
*
_layersFact
.
rawValue
().
toInt
());
}
...
...
src/MissionManager/SurveyComplexItem.cc
View file @
7a8d75a8
...
...
@@ -1289,20 +1289,24 @@ void SurveyComplexItem::_rebuildTransectsPhase2(void)
_complexDistance
+=
_visualTransectPoints
[
i
].
value
<
QGeoCoordinate
>
().
distanceTo
(
_visualTransectPoints
[
i
+
1
].
value
<
QGeoCoordinate
>
());
}
if
(
_cameraTriggerInTurnAroundFact
.
rawValue
().
toBool
())
{
_cameraShots
=
qCeil
(
_complexDistance
/
triggerDistance
());
}
else
{
if
(
triggerDistance
()
==
0
)
{
_cameraShots
=
0
;
for
(
const
QList
<
TransectStyleComplexItem
::
CoordInfo_t
>&
transect
:
_transects
)
{
QGeoCoordinate
firstCameraCoord
,
lastCameraCoord
;
if
(
_hasTurnaround
())
{
firstCameraCoord
=
transect
[
1
].
coord
;
lastCameraCoord
=
transect
[
transect
.
count
()
-
2
].
coord
;
}
else
{
firstCameraCoord
=
transect
.
first
().
coord
;
lastCameraCoord
=
transect
.
last
().
coord
;
}
else
{
if
(
_cameraTriggerInTurnAroundFact
.
rawValue
().
toBool
())
{
_cameraShots
=
qCeil
(
_complexDistance
/
triggerDistance
());
}
else
{
_cameraShots
=
0
;
for
(
const
QList
<
TransectStyleComplexItem
::
CoordInfo_t
>&
transect
:
_transects
)
{
QGeoCoordinate
firstCameraCoord
,
lastCameraCoord
;
if
(
_hasTurnaround
())
{
firstCameraCoord
=
transect
[
1
].
coord
;
lastCameraCoord
=
transect
[
transect
.
count
()
-
2
].
coord
;
}
else
{
firstCameraCoord
=
transect
.
first
().
coord
;
lastCameraCoord
=
transect
.
last
().
coord
;
}
_cameraShots
+=
qCeil
(
firstCameraCoord
.
distanceTo
(
lastCameraCoord
)
/
triggerDistance
());
}
_cameraShots
+=
qCeil
(
firstCameraCoord
.
distanceTo
(
lastCameraCoord
)
/
triggerDistance
());
}
}
...
...
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