Skip to content

Commit

Permalink
Fix camera shot calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
DonLakeFlyer committed Aug 17, 2017
1 parent 16657ae commit fc25bd3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/MissionManager/SurveyMissionItem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,9 @@ void SurveyMissionItem::_generateGrid(void)
_setSurveyDistance(surveyDistance);

if (cameraShots == 0 && _triggerCamera()) {
cameraShots = (int)ceil(surveyDistance / _triggerDistance());
cameraShots = (int)floor(surveyDistance / _triggerDistance());
// Take into account immediate camera trigger at waypoint entry
cameraShots++;
}
_setCameraShots(cameraShots);

Expand Down Expand Up @@ -1065,7 +1067,9 @@ int SurveyMissionItem::_gridGenerator(const QList<QPointF>& polygonPoints, QLis
// Calc camera shots here if there are no images in turnaround
if (_triggerCamera() && !_imagesEverywhere()) {
for (int i=0; i<resultLines.count(); i++) {
cameraShots += (int)ceil(resultLines[i].length() / _triggerDistance());
cameraShots += (int)floor(resultLines[i].length() / _triggerDistance());
// Take into account immediate camera trigger at waypoint entry
cameraShots++;
}
}

Expand Down

0 comments on commit fc25bd3

Please sign in to comment.