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
43d3d89a
Unverified
Commit
43d3d89a
authored
Feb 06, 2018
by
Don Gagne
Committed by
GitHub
Feb 06, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6116 from DonLakeFlyer/CorridorScan
Corridor Scan: Support for images in turnaround
parents
0619847e
e7e4f594
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
41 deletions
+65
-41
CorridorScanComplexItem.cc
src/MissionManager/CorridorScanComplexItem.cc
+60
-17
TransectStyleComplexItem.cc
src/MissionManager/TransectStyleComplexItem.cc
+1
-17
TransectStyleComplexItem.h
src/MissionManager/TransectStyleComplexItem.h
+2
-3
TransectStyleComplexItemTest.cc
src/MissionManager/TransectStyleComplexItemTest.cc
+2
-4
No files found.
src/MissionManager/CorridorScanComplexItem.cc
View file @
43d3d89a
...
...
@@ -59,7 +59,17 @@ void CorridorScanComplexItem::_polylineCountChanged(int count)
int
CorridorScanComplexItem
::
lastSequenceNumber
(
void
)
const
{
return
_sequenceNumber
+
((
_corridorPolyline
.
count
()
+
2
/* trigger start/stop */
+
(
_hasTurnaround
()
?
2
:
0
))
*
_transectCount
());
int
itemCount
=
_transectPoints
.
count
();
// Each transpect point represents a waypoint item
if
(
_cameraTriggerInTurnAroundFact
.
rawValue
().
toDouble
())
{
// Only one camera start and on camera stop
itemCount
+=
2
;
}
else
{
// Each transect will have a camera start and stop in it
itemCount
+=
_transectCount
()
*
2
;
}
return
_sequenceNumber
+
itemCount
;
}
void
CorridorScanComplexItem
::
save
(
QJsonArray
&
missionItems
)
...
...
@@ -144,11 +154,12 @@ int CorridorScanComplexItem::_transectCount(void) const
void
CorridorScanComplexItem
::
appendMissionItems
(
QList
<
MissionItem
*>&
items
,
QObject
*
missionItemParent
)
{
int
seqNum
=
_sequenceNumber
;
int
pointIndex
=
0
;
int
seqNum
=
_sequenceNumber
;
int
pointIndex
=
0
;
bool
imagesEverywhere
=
_cameraTriggerInTurnAroundFact
.
rawValue
().
toDouble
();
while
(
pointIndex
<
_transectPoints
.
count
())
{
if
(
_hasTurnaround
())
{
if
(
pointIndex
!=
0
&&
_hasTurnaround
())
{
QGeoCoordinate
vertexCoord
=
_transectPoints
[
pointIndex
++
].
value
<
QGeoCoordinate
>
();
MissionItem
*
item
=
new
MissionItem
(
seqNum
++
,
MAV_CMD_NAV_WAYPOINT
,
...
...
@@ -166,7 +177,7 @@ void CorridorScanComplexItem::appendMissionItems(QList<MissionItem*>& items, QOb
items
.
append
(
item
);
}
bool
addTrigger
=
true
;
bool
addTrigger
=
imagesEverywhere
?
pointIndex
==
0
:
true
;
for
(
int
i
=
0
;
i
<
_corridorPolyline
.
count
();
i
++
)
{
QGeoCoordinate
vertexCoord
=
_transectPoints
[
pointIndex
++
].
value
<
QGeoCoordinate
>
();
MissionItem
*
item
=
new
MissionItem
(
seqNum
++
,
...
...
@@ -200,19 +211,21 @@ void CorridorScanComplexItem::appendMissionItems(QList<MissionItem*>& items, QOb
}
}
MissionItem
*
item
=
new
MissionItem
(
seqNum
++
,
MAV_CMD_DO_SET_CAM_TRIGG_DIST
,
MAV_FRAME_MISSION
,
0
,
// stop triggering
0
,
// shutter integration (ignore)
0
,
// trigger immediately when starting
0
,
0
,
0
,
0
,
// param 4-7 unused
true
,
// autoContinue
false
,
// isCurrentItem
missionItemParent
);
items
.
append
(
item
);
if
(
!
imagesEverywhere
)
{
MissionItem
*
item
=
new
MissionItem
(
seqNum
++
,
MAV_CMD_DO_SET_CAM_TRIGG_DIST
,
MAV_FRAME_MISSION
,
0
,
// stop triggering
0
,
// shutter integration (ignore)
0
,
// trigger immediately when starting
0
,
0
,
0
,
0
,
// param 4-7 unused
true
,
// autoContinue
false
,
// isCurrentItem
missionItemParent
);
items
.
append
(
item
);
}
if
(
_hasTurnaround
())
{
if
(
_hasTurnaround
()
&&
pointIndex
<
_transectPoints
.
count
()
)
{
QGeoCoordinate
vertexCoord
=
_transectPoints
[
pointIndex
++
].
value
<
QGeoCoordinate
>
();
MissionItem
*
item
=
new
MissionItem
(
seqNum
++
,
MAV_CMD_NAV_WAYPOINT
,
...
...
@@ -230,6 +243,20 @@ void CorridorScanComplexItem::appendMissionItems(QList<MissionItem*>& items, QOb
items
.
append
(
item
);
}
}
if
(
imagesEverywhere
)
{
MissionItem
*
item
=
new
MissionItem
(
seqNum
++
,
MAV_CMD_DO_SET_CAM_TRIGG_DIST
,
MAV_FRAME_MISSION
,
0
,
// stop triggering
0
,
// shutter integration (ignore)
0
,
// trigger immediately when starting
0
,
0
,
0
,
0
,
// param 4-7 unused
true
,
// autoContinue
false
,
// isCurrentItem
missionItemParent
);
items
.
append
(
item
);
}
}
void
CorridorScanComplexItem
::
applyNewAltitude
(
double
newAltitude
)
...
...
@@ -388,6 +415,21 @@ void CorridorScanComplexItem::_rebuildTransects(void)
normalizedTransectPosition
+=
transectSpacing
;
}
// At this point _transectPoints has an extra turnaround segment at the beginning and end.
// These must be remove for the correcvt flight pattern.
_transectPoints
.
takeFirst
();
_transectPoints
.
takeLast
();
}
// Calculate distance flown for complex item
_complexDistance
=
0
;
for
(
int
i
=
0
;
i
<
_transectPoints
.
count
()
-
2
;
i
++
)
{
_complexDistance
+=
_transectPoints
[
i
].
value
<
QGeoCoordinate
>
().
distanceTo
(
_transectPoints
[
i
+
1
].
value
<
QGeoCoordinate
>
());
}
if
(
_cameraTriggerInTurnAroundFact
.
rawValue
().
toDouble
())
{
_cameraShots
=
qCeil
(
_complexDistance
/
_cameraCalc
.
adjustedFootprintFrontal
()
->
rawValue
().
toDouble
());
}
_coordinate
=
_transectPoints
.
count
()
?
_transectPoints
.
first
().
value
<
QGeoCoordinate
>
()
:
QGeoCoordinate
();
...
...
@@ -395,6 +437,7 @@ void CorridorScanComplexItem::_rebuildTransects(void)
emit
transectPointsChanged
();
emit
cameraShotsChanged
();
emit
complexDistanceChanged
();
emit
coordinateChanged
(
_coordinate
);
emit
exitCoordinateChanged
(
_exitCoordinate
);
}
...
...
src/MissionManager/TransectStyleComplexItem.cc
View file @
43d3d89a
...
...
@@ -35,7 +35,7 @@ TransectStyleComplexItem::TransectStyleComplexItem(Vehicle* vehicle, QString set
,
_sequenceNumber
(
0
)
,
_dirty
(
false
)
,
_ignoreRecalc
(
false
)
,
_
scanDistance
(
0.
0
)
,
_
complexDistance
(
0
)
,
_cameraShots
(
0
)
,
_cameraMinTriggerInterval
(
0
)
,
_cameraCalc
(
vehicle
)
...
...
@@ -61,14 +61,6 @@ TransectStyleComplexItem::TransectStyleComplexItem(Vehicle* vehicle, QString set
connect
(
_cameraCalc
.
adjustedFootprintSide
(),
&
Fact
::
valueChanged
,
this
,
&
TransectStyleComplexItem
::
_signalLastSequenceNumberChanged
);
connect
(
_cameraCalc
.
adjustedFootprintFrontal
(),
&
Fact
::
valueChanged
,
this
,
&
TransectStyleComplexItem
::
_signalLastSequenceNumberChanged
);
connect
(
&
_turnAroundDistanceFact
,
&
Fact
::
valueChanged
,
this
,
&
TransectStyleComplexItem
::
cameraShotsChanged
);
connect
(
&
_hoverAndCaptureFact
,
&
Fact
::
valueChanged
,
this
,
&
TransectStyleComplexItem
::
cameraShotsChanged
);
connect
(
&
_refly90DegreesFact
,
&
Fact
::
valueChanged
,
this
,
&
TransectStyleComplexItem
::
cameraShotsChanged
);
connect
(
&
_surveyAreaPolygon
,
&
QGCMapPolygon
::
pathChanged
,
this
,
&
TransectStyleComplexItem
::
cameraShotsChanged
);
connect
(
&
_cameraTriggerInTurnAroundFact
,
&
Fact
::
valueChanged
,
this
,
&
TransectStyleComplexItem
::
cameraShotsChanged
);
connect
(
_cameraCalc
.
adjustedFootprintSide
(),
&
Fact
::
valueChanged
,
this
,
&
TransectStyleComplexItem
::
cameraShotsChanged
);
connect
(
_cameraCalc
.
adjustedFootprintFrontal
(),
&
Fact
::
valueChanged
,
this
,
&
TransectStyleComplexItem
::
cameraShotsChanged
);
connect
(
&
_turnAroundDistanceFact
,
&
Fact
::
valueChanged
,
this
,
&
TransectStyleComplexItem
::
complexDistanceChanged
);
connect
(
&
_hoverAndCaptureFact
,
&
Fact
::
valueChanged
,
this
,
&
TransectStyleComplexItem
::
complexDistanceChanged
);
connect
(
&
_refly90DegreesFact
,
&
Fact
::
valueChanged
,
this
,
&
TransectStyleComplexItem
::
complexDistanceChanged
);
...
...
@@ -94,14 +86,6 @@ TransectStyleComplexItem::TransectStyleComplexItem(Vehicle* vehicle, QString set
connect
(
this
,
&
TransectStyleComplexItem
::
transectPointsChanged
,
this
,
&
TransectStyleComplexItem
::
greatestDistanceToChanged
);
}
void
TransectStyleComplexItem
::
_setScanDistance
(
double
scanDistance
)
{
if
(
!
qFuzzyCompare
(
_scanDistance
,
scanDistance
))
{
_scanDistance
=
scanDistance
;
emit
complexDistanceChanged
();
}
}
void
TransectStyleComplexItem
::
_setCameraShots
(
int
cameraShots
)
{
if
(
_cameraShots
!=
cameraShots
)
{
...
...
src/MissionManager/TransectStyleComplexItem.h
View file @
43d3d89a
...
...
@@ -61,7 +61,7 @@ public:
QString
mapVisualQML
(
void
)
const
override
=
0
;
bool
load
(
const
QJsonObject
&
complexObject
,
int
sequenceNumber
,
QString
&
errorString
)
override
=
0
;
double
complexDistance
(
void
)
const
final
{
return
_
scan
Distance
;
}
double
complexDistance
(
void
)
const
final
{
return
_
complex
Distance
;
}
double
greatestDistanceTo
(
const
QGeoCoordinate
&
other
)
const
final
;
// Overrides from VisualMissionItem
...
...
@@ -119,7 +119,6 @@ protected:
void
_save
(
QJsonObject
&
saveObject
);
bool
_load
(
const
QJsonObject
&
complexObject
,
QString
&
errorString
);
void
_setExitCoordinate
(
const
QGeoCoordinate
&
coordinate
);
void
_setScanDistance
(
double
scanDistance
);
void
_setCameraShots
(
int
cameraShots
);
double
_triggerDistance
(
void
)
const
;
int
_transectCount
(
void
)
const
;
...
...
@@ -135,7 +134,7 @@ protected:
QGCMapPolygon
_surveyAreaPolygon
;
bool
_ignoreRecalc
;
double
_
scan
Distance
;
double
_
complex
Distance
;
int
_cameraShots
;
double
_timeBetweenShots
;
double
_cameraMinTriggerInterval
;
...
...
src/MissionManager/TransectStyleComplexItemTest.cc
View file @
43d3d89a
...
...
@@ -110,10 +110,9 @@ void TransectStyleComplexItemTest::_testRebuildTransects(void)
// _rebuildTransects call
// coveredAreaChanged signal
// lastSequenceNumberChanged signal
// cameraShotsChanged signal
_adjustSurveAreaPolygon
();
QVERIFY
(
_transectStyleItem
->
rebuildTransectsCalled
);
QVERIFY
(
_multiSpy
->
checkSignalsByMask
(
coveredAreaChangedMask
|
lastSequenceNumberChangedMask
|
cameraShotsChangedMask
));
QVERIFY
(
_multiSpy
->
checkSignalsByMask
(
coveredAreaChangedMask
|
lastSequenceNumberChangedMask
));
_transectStyleItem
->
rebuildTransectsCalled
=
false
;
_transectStyleItem
->
setDirty
(
false
);
_multiSpy
->
clearAllSignals
();
...
...
@@ -121,7 +120,6 @@ void TransectStyleComplexItemTest::_testRebuildTransects(void)
// Changes to these facts should trigger:
// _rebuildTransects call
// lastSequenceNumberChanged signal
// cameraShotsChanged signal
QList
<
Fact
*>
rgFacts
;
rgFacts
<<
_transectStyleItem
->
turnAroundDistance
()
<<
_transectStyleItem
->
cameraTriggerInTurnAround
()
...
...
@@ -133,7 +131,7 @@ void TransectStyleComplexItemTest::_testRebuildTransects(void)
qDebug
()
<<
fact
->
name
();
changeFactValue
(
fact
);
QVERIFY
(
_transectStyleItem
->
rebuildTransectsCalled
);
QVERIFY
(
_multiSpy
->
checkSignalsByMask
(
lastSequenceNumberChangedMask
|
cameraShotsChangedMask
));
QVERIFY
(
_multiSpy
->
checkSignalsByMask
(
lastSequenceNumberChangedMask
));
_transectStyleItem
->
setDirty
(
false
);
_multiSpy
->
clearAllSignals
();
_transectStyleItem
->
rebuildTransectsCalled
=
false
;
...
...
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