Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/MissionManager/CorridorScanComplexItem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,11 @@ double CorridorScanComplexItem::timeBetweenShots(void)
double CorridorScanComplexItem::_calcTransectSpacing(void) const
{
double transectSpacing = _cameraCalc.adjustedFootprintSide()->rawValue().toDouble();
if (transectSpacing < 0.5) {
if (transectSpacing < _minimumTransectSpacingMeters) {
// We can't let spacing get too small otherwise we will end up with too many transects.
// So we limit to 0.5 meter spacing as min and set to huge value which will cause a single
// transect to be added.
transectSpacing = 100000;
// So we limit the spacing to be above a small increment and below that value we set to huge spacing
// which will cause a single transect to be added instead of having things blow up.
transectSpacing = _forceLargeTransectSpacingMeters;
}

return transectSpacing;
Expand Down
10 changes: 5 additions & 5 deletions src/MissionManager/SurveyComplexItem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -674,11 +674,11 @@ void SurveyComplexItem::_rebuildTransectsPhase1WorkerSinglePolygon(bool refly)

double gridAngle = _gridAngleFact.rawValue().toDouble();
double gridSpacing = _cameraCalc.adjustedFootprintSide()->rawValue().toDouble();
if (gridSpacing < 0.5) {
// We can't let gridSpacing get too small otherwise we will end up with too many transects.
// So we limit to 0.5 meter spacing as min and set to huge value which will cause a single
// transect to be added.
gridSpacing = 100000;
if (gridSpacing < _minimumTransectSpacingMeters) {
// We can't let spacing get too small otherwise we will end up with too many transects.
// So we limit the spacing to be above a small increment and below that value we set to huge spacing
// which will cause a single transect to be added instead of having things blow up.
gridSpacing = _forceLargeTransectSpacingMeters;
}

gridAngle = _clampGridAngle90(gridAngle);
Expand Down
4 changes: 3 additions & 1 deletion src/MissionManager/TransectStyleComplexItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ protected slots:

static constexpr int _terrainQueryTimeoutMsecs= 1000;
static constexpr int _hoverAndCaptureDelaySeconds = 4;
static constexpr double _minimumTransectSpacingMeters = 0.3;
static constexpr double _forceLargeTransectSpacingMeters = 100000;

private slots:
void _reallyQueryTransectsPathHeightInfo (void);
Expand Down Expand Up @@ -245,5 +247,5 @@ private slots:
QTimer _terrainPolyPathQueryTimer;

// Deprecated json keys
static constexpr const char* _jsonTerrainFollowKeyDeprecated = "FollowTerrain";
static constexpr const char* _jsonTerrainFollowKeyDeprecated = "FollowTerrain";
};
Loading