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
a5b8891b
Unverified
Commit
a5b8891b
authored
Jul 06, 2018
by
Don Gagne
Committed by
GitHub
Jul 06, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6689 from DonLakeFlyer/HoverAndCapture
Survey: Hover and Capture support
parents
5c73f594
4dca19f8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
38 deletions
+74
-38
SurveyComplexItem.cc
src/MissionManager/SurveyComplexItem.cc
+52
-26
TransectStyleComplexItem.cc
src/MissionManager/TransectStyleComplexItem.cc
+10
-7
TransectStyleComplexItem.h
src/MissionManager/TransectStyleComplexItem.h
+11
-4
SurveyItemEditor.qml
src/PlanView/SurveyItemEditor.qml
+1
-1
No files found.
src/MissionManager/SurveyComplexItem.cc
View file @
a5b8891b
...
@@ -814,7 +814,7 @@ void SurveyComplexItem::_buildAndAppendMissionItems(QList<MissionItem*>& items,
...
@@ -814,7 +814,7 @@ void SurveyComplexItem::_buildAndAppendMissionItems(QList<MissionItem*>& items,
MissionItem
*
item
;
MissionItem
*
item
;
int
seqNum
=
_sequenceNumber
;
int
seqNum
=
_sequenceNumber
;
bool
imagesEverywhere
=
_cameraTriggerInTurnAroundFact
.
rawValue
().
toBool
();
bool
imagesEverywhere
=
_cameraTriggerInTurnAroundFact
.
rawValue
().
toBool
();
bool
addTriggerAtBeginning
=
imagesEverywhere
;
bool
addTriggerAtBeginning
=
!
hoverAndCaptureEnabled
()
&&
imagesEverywhere
;
bool
firstOverallPoint
=
true
;
bool
firstOverallPoint
=
true
;
MAV_FRAME
mavFrame
=
followTerrain
()
||
!
_cameraCalc
.
distanceToSurfaceRelative
()
?
MAV_FRAME_GLOBAL
:
MAV_FRAME_GLOBAL_RELATIVE_ALT
;
MAV_FRAME
mavFrame
=
followTerrain
()
||
!
_cameraCalc
.
distanceToSurfaceRelative
()
?
MAV_FRAME_GLOBAL
:
MAV_FRAME_GLOBAL_RELATIVE_ALT
;
...
@@ -826,17 +826,31 @@ void SurveyComplexItem::_buildAndAppendMissionItems(QList<MissionItem*>& items,
...
@@ -826,17 +826,31 @@ void SurveyComplexItem::_buildAndAppendMissionItems(QList<MissionItem*>& items,
item
=
new
MissionItem
(
seqNum
++
,
item
=
new
MissionItem
(
seqNum
++
,
MAV_CMD_NAV_WAYPOINT
,
MAV_CMD_NAV_WAYPOINT
,
mavFrame
,
mavFrame
,
0
,
// No hold time
hoverAndCaptureEnabled
()
?
0.0
,
// No acceptance radius specified
_hoverAndCaptureDelaySeconds
:
0
,
// Hold time (delay for hover and capture to settle vehicle before image is taken)
0.0
,
// Pass through waypoint
0.0
,
// No acceptance radius specified
std
::
numeric_limits
<
double
>::
quiet_NaN
(),
// Yaw unchanged
0.0
,
// Pass through waypoint
std
::
numeric_limits
<
double
>::
quiet_NaN
(),
// Yaw unchanged
transectCoordInfo
.
coord
.
latitude
(),
transectCoordInfo
.
coord
.
latitude
(),
transectCoordInfo
.
coord
.
longitude
(),
transectCoordInfo
.
coord
.
longitude
(),
transectCoordInfo
.
coord
.
altitude
(),
transectCoordInfo
.
coord
.
altitude
(),
true
,
// autoContinue
true
,
// autoContinue
false
,
// isCurrentItem
false
,
// isCurrentItem
missionItemParent
);
missionItemParent
);
items
.
append
(
item
);
items
.
append
(
item
);
if
(
hoverAndCaptureEnabled
())
{
item
=
new
MissionItem
(
seqNum
++
,
MAV_CMD_IMAGE_START_CAPTURE
,
MAV_FRAME_MISSION
,
0
,
// Reserved (Set to 0)
0
,
// Interval (none)
1
,
// Take 1 photo
NAN
,
NAN
,
NAN
,
NAN
,
// param 4-7 reserved
true
,
// autoContinue
false
,
// isCurrentItem
missionItemParent
);
items
.
append
(
item
);
}
if
(
firstOverallPoint
&&
addTriggerAtBeginning
)
{
if
(
firstOverallPoint
&&
addTriggerAtBeginning
)
{
// Start triggering
// Start triggering
...
@@ -844,29 +858,29 @@ void SurveyComplexItem::_buildAndAppendMissionItems(QList<MissionItem*>& items,
...
@@ -844,29 +858,29 @@ void SurveyComplexItem::_buildAndAppendMissionItems(QList<MissionItem*>& items,
item
=
new
MissionItem
(
seqNum
++
,
item
=
new
MissionItem
(
seqNum
++
,
MAV_CMD_DO_SET_CAM_TRIGG_DIST
,
MAV_CMD_DO_SET_CAM_TRIGG_DIST
,
MAV_FRAME_MISSION
,
MAV_FRAME_MISSION
,
_cameraCalc
.
adjustedFootprintFrontal
()
->
rawValue
().
toDoubl
e
(),
// trigger distance
triggerDistanc
e
(),
// trigger distance
0
,
// shutter integration (ignore)
0
,
// shutter integration (ignore)
1
,
// trigger immediately when starting
1
,
// trigger immediately when starting
0
,
0
,
0
,
0
,
// param 4-7 unused
0
,
0
,
0
,
0
,
// param 4-7 unused
true
,
// autoContinue
true
,
// autoContinue
false
,
// isCurrentItem
false
,
// isCurrentItem
missionItemParent
);
missionItemParent
);
items
.
append
(
item
);
items
.
append
(
item
);
}
}
firstOverallPoint
=
false
;
firstOverallPoint
=
false
;
if
(
transectCoordInfo
.
coordType
==
TransectStyleComplexItem
::
CoordTypeSurveyEdge
&&
!
imagesEverywhere
)
{
if
(
transectCoordInfo
.
coordType
==
TransectStyleComplexItem
::
CoordTypeSurveyEdge
&&
triggerCamera
()
&&
!
hoverAndCaptureEnabled
()
&&
!
imagesEverywhere
)
{
if
(
entryPoint
)
{
if
(
entryPoint
)
{
// Start of transect, start triggering
// Start of transect, start triggering
item
=
new
MissionItem
(
seqNum
++
,
item
=
new
MissionItem
(
seqNum
++
,
MAV_CMD_DO_SET_CAM_TRIGG_DIST
,
MAV_CMD_DO_SET_CAM_TRIGG_DIST
,
MAV_FRAME_MISSION
,
MAV_FRAME_MISSION
,
_cameraCalc
.
adjustedFootprintFrontal
()
->
rawValue
().
toDoubl
e
(),
// trigger distance
triggerDistanc
e
(),
// trigger distance
0
,
// shutter integration (ignore)
0
,
// shutter integration (ignore)
1
,
// trigger immediately when starting
1
,
// trigger immediately when starting
0
,
0
,
0
,
0
,
// param 4-7 unused
0
,
0
,
0
,
0
,
// param 4-7 unused
true
,
// autoContinue
true
,
// autoContinue
false
,
// isCurrentItem
false
,
// isCurrentItem
missionItemParent
);
missionItemParent
);
items
.
append
(
item
);
items
.
append
(
item
);
}
else
{
}
else
{
...
@@ -888,7 +902,7 @@ void SurveyComplexItem::_buildAndAppendMissionItems(QList<MissionItem*>& items,
...
@@ -888,7 +902,7 @@ void SurveyComplexItem::_buildAndAppendMissionItems(QList<MissionItem*>& items,
}
}
}
}
if
(
imagesEverywhere
)
{
if
(
triggerCamera
()
&&
!
hoverAndCaptureEnabled
()
&&
imagesEverywhere
)
{
// Stop triggering
// Stop triggering
MissionItem
*
item
=
new
MissionItem
(
seqNum
++
,
MissionItem
*
item
=
new
MissionItem
(
seqNum
++
,
MAV_CMD_DO_SET_CAM_TRIGG_DIST
,
MAV_CMD_DO_SET_CAM_TRIGG_DIST
,
...
@@ -1230,6 +1244,20 @@ void SurveyComplexItem::_rebuildTransectsPhase1Worker(bool refly)
...
@@ -1230,6 +1244,20 @@ void SurveyComplexItem::_rebuildTransectsPhase1Worker(bool refly)
coordInfo
=
{
transect
[
1
],
CoordTypeSurveyEdge
};
coordInfo
=
{
transect
[
1
],
CoordTypeSurveyEdge
};
coordInfoTransect
.
append
(
coordInfo
);
coordInfoTransect
.
append
(
coordInfo
);
// For hover and capture we need points for each camera location within the transect
if
(
triggerCamera
()
&&
hoverAndCaptureEnabled
())
{
double
transectLength
=
transect
[
0
].
distanceTo
(
transect
[
1
]);
double
transectAzimuth
=
transect
[
0
].
azimuthTo
(
transect
[
1
]);
if
(
triggerDistance
()
<
transectLength
)
{
int
cInnerHoverPoints
=
floor
(
transectLength
/
triggerDistance
());
qCDebug
(
SurveyComplexItemLog
)
<<
"cInnerHoverPoints"
<<
cInnerHoverPoints
;
for
(
int
i
=
0
;
i
<
cInnerHoverPoints
;
i
++
)
{
QGeoCoordinate
hoverCoord
=
transect
[
0
].
atDistanceAndAzimuth
(
triggerDistance
()
*
(
i
+
1
),
transectAzimuth
);
TransectStyleComplexItem
::
CoordInfo_t
coordInfo
=
{
hoverCoord
,
CoordTypeInteriorHoverTrigger
};
coordInfoTransect
.
insert
(
1
+
i
,
coordInfo
);
}
}
}
// Extend the transect ends for turnaround
// Extend the transect ends for turnaround
if
(
_hasTurnaround
())
{
if
(
_hasTurnaround
())
{
...
@@ -1261,9 +1289,8 @@ void SurveyComplexItem::_rebuildTransectsPhase2(void)
...
@@ -1261,9 +1289,8 @@ void SurveyComplexItem::_rebuildTransectsPhase2(void)
_complexDistance
+=
_visualTransectPoints
[
i
].
value
<
QGeoCoordinate
>
().
distanceTo
(
_visualTransectPoints
[
i
+
1
].
value
<
QGeoCoordinate
>
());
_complexDistance
+=
_visualTransectPoints
[
i
].
value
<
QGeoCoordinate
>
().
distanceTo
(
_visualTransectPoints
[
i
+
1
].
value
<
QGeoCoordinate
>
());
}
}
double
triggerDistance
=
_cameraCalc
.
adjustedFootprintFrontal
()
->
rawValue
().
toDouble
();
if
(
_cameraTriggerInTurnAroundFact
.
rawValue
().
toBool
())
{
if
(
_cameraTriggerInTurnAroundFact
.
rawValue
().
toBool
())
{
_cameraShots
=
qCeil
(
_complexDistance
/
triggerDistance
);
_cameraShots
=
qCeil
(
_complexDistance
/
triggerDistance
()
);
}
else
{
}
else
{
_cameraShots
=
0
;
_cameraShots
=
0
;
foreach
(
const
QList
<
TransectStyleComplexItem
::
CoordInfo_t
>&
transect
,
_transects
)
{
foreach
(
const
QList
<
TransectStyleComplexItem
::
CoordInfo_t
>&
transect
,
_transects
)
{
...
@@ -1275,7 +1302,7 @@ void SurveyComplexItem::_rebuildTransectsPhase2(void)
...
@@ -1275,7 +1302,7 @@ void SurveyComplexItem::_rebuildTransectsPhase2(void)
firstCameraCoord
=
transect
.
first
().
coord
;
firstCameraCoord
=
transect
.
first
().
coord
;
lastCameraCoord
=
transect
.
last
().
coord
;
lastCameraCoord
=
transect
.
last
().
coord
;
}
}
_cameraShots
+=
qCeil
(
firstCameraCoord
.
distanceTo
(
lastCameraCoord
)
/
triggerDistance
);
_cameraShots
+=
qCeil
(
firstCameraCoord
.
distanceTo
(
lastCameraCoord
)
/
triggerDistance
()
);
}
}
}
}
...
@@ -1340,6 +1367,5 @@ void SurveyComplexItem::rotateEntryPoint(void)
...
@@ -1340,6 +1367,5 @@ void SurveyComplexItem::rotateEntryPoint(void)
double
SurveyComplexItem
::
timeBetweenShots
(
void
)
double
SurveyComplexItem
::
timeBetweenShots
(
void
)
{
{
return
_cruiseSpeed
==
0
?
0
:
_cameraCalc
.
adjustedFootprintFrontal
()
->
rawValue
().
toDoubl
e
()
/
_cruiseSpeed
;
return
_cruiseSpeed
==
0
?
0
:
triggerDistanc
e
()
/
_cruiseSpeed
;
}
}
src/MissionManager/TransectStyleComplexItem.cc
View file @
a5b8891b
...
@@ -682,15 +682,18 @@ int TransectStyleComplexItem::lastSequenceNumber(void) const
...
@@ -682,15 +682,18 @@ int TransectStyleComplexItem::lastSequenceNumber(void) const
int
itemCount
=
0
;
int
itemCount
=
0
;
foreach
(
const
QList
<
CoordInfo_t
>&
rgCoordInfo
,
_transects
)
{
foreach
(
const
QList
<
CoordInfo_t
>&
rgCoordInfo
,
_transects
)
{
itemCount
+=
rgCoordInfo
.
count
();
itemCount
+=
rgCoordInfo
.
count
()
*
(
hoverAndCaptureEnabled
()
?
2
:
1
)
;
}
}
if
(
_cameraTriggerInTurnAroundFact
.
rawValue
().
toBool
())
{
// Only one camera start and on camera stop
if
(
!
hoverAndCaptureEnabled
())
{
itemCount
+=
2
;
if
(
_cameraTriggerInTurnAroundFact
.
rawValue
().
toBool
())
{
}
else
{
// Only one camera start and on camera stop
// Each transect will have a camera start and stop in it
itemCount
+=
2
;
itemCount
+=
_transects
.
count
()
*
2
;
}
else
{
// Each transect will have a camera start and stop in it
itemCount
+=
_transects
.
count
()
*
2
;
}
}
}
return
_sequenceNumber
+
itemCount
-
1
;
return
_sequenceNumber
+
itemCount
-
1
;
...
...
src/MissionManager/TransectStyleComplexItem.h
View file @
a5b8891b
...
@@ -57,6 +57,8 @@ public:
...
@@ -57,6 +57,8 @@ public:
Fact
*
terrainAdjustMaxDescentRate
(
void
)
{
return
&
_terrainAdjustMaxClimbRateFact
;
}
Fact
*
terrainAdjustMaxDescentRate
(
void
)
{
return
&
_terrainAdjustMaxClimbRateFact
;
}
Fact
*
terrainAdjustMaxClimbRate
(
void
)
{
return
&
_terrainAdjustMaxDescentRateFact
;
}
Fact
*
terrainAdjustMaxClimbRate
(
void
)
{
return
&
_terrainAdjustMaxDescentRateFact
;
}
const
Fact
*
hoverAndCapture
(
void
)
const
{
return
&
_hoverAndCaptureFact
;
}
int
cameraShots
(
void
)
const
{
return
_cameraShots
;
}
int
cameraShots
(
void
)
const
{
return
_cameraShots
;
}
double
coveredArea
(
void
)
const
;
double
coveredArea
(
void
)
const
;
bool
hoverAndCaptureAllowed
(
void
)
const
;
bool
hoverAndCaptureAllowed
(
void
)
const
;
...
@@ -66,6 +68,10 @@ public:
...
@@ -66,6 +68,10 @@ public:
void
setFollowTerrain
(
bool
followTerrain
);
void
setFollowTerrain
(
bool
followTerrain
);
double
triggerDistance
(
void
)
const
{
return
_cameraCalc
.
adjustedFootprintFrontal
()
->
rawValue
().
toDouble
();
}
bool
hoverAndCaptureEnabled
(
void
)
const
{
return
hoverAndCapture
()
->
rawValue
().
toBool
();
}
bool
triggerCamera
(
void
)
const
{
return
triggerDistance
()
!=
0
;
}
// Overrides from ComplexMissionItem
// Overrides from ComplexMissionItem
int
lastSequenceNumber
(
void
)
const
final
;
int
lastSequenceNumber
(
void
)
const
final
;
...
@@ -148,10 +154,11 @@ protected:
...
@@ -148,10 +154,11 @@ protected:
QGCMapPolygon
_surveyAreaPolygon
;
QGCMapPolygon
_surveyAreaPolygon
;
enum
CoordType
{
enum
CoordType
{
CoordTypeInterior
,
CoordTypeInterior
,
///< Interior waypoint for flight path only
CoordTypeInteriorTerrainAdded
,
CoordTypeInteriorHoverTrigger
,
///< Interior waypoint for hover and capture trigger
CoordTypeSurveyEdge
,
CoordTypeInteriorTerrainAdded
,
///< Interior waypoint added for terrain
CoordTypeTurnaround
CoordTypeSurveyEdge
,
///< Waypoint at edge of survey polygon
CoordTypeTurnaround
///< Waypoint outside of survey polygon for turnaround
};
};
typedef
struct
{
typedef
struct
{
...
...
src/PlanView/SurveyItemEditor.qml
View file @
a5b8891b
...
@@ -112,7 +112,7 @@ Rectangle {
...
@@ -112,7 +112,7 @@ Rectangle {
Layout.columnSpan
:
2
Layout.columnSpan
:
2
onClicked
:
{
onClicked
:
{
if
(
checked
)
{
if
(
checked
)
{
missionItem
.
cameraTriggerInTurn
a
round
.
rawValue
=
false
missionItem
.
cameraTriggerInTurn
A
round
.
rawValue
=
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