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
7a669919
Commit
7a669919
authored
Oct 17, 2017
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support scan distance from structure
Fix crash when adding second structure scan
parent
cc9f9d52
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
99 deletions
+85
-99
StructureScan.SettingsGroup.json
src/MissionManager/StructureScan.SettingsGroup.json
+9
-0
StructureScanComplexItem.cc
src/MissionManager/StructureScanComplexItem.cc
+35
-45
StructureScanComplexItem.h
src/MissionManager/StructureScanComplexItem.h
+12
-32
StructureScanEditor.qml
src/PlanView/StructureScanEditor.qml
+15
-1
StructureScanMapVisual.qml
src/PlanView/StructureScanMapVisual.qml
+14
-21
No files found.
src/MissionManager/StructureScan.SettingsGroup.json
View file @
7a669919
...
...
@@ -23,6 +23,15 @@
"units"
:
"m"
,
"defaultValue"
:
25
},
{
"name"
:
"Scan distance"
,
"shortDescription"
:
"Scan distance away from structure."
,
"type"
:
"double"
,
"decimalPlaces"
:
2
,
"min"
:
0
,
"units"
:
"m"
,
"defaultValue"
:
25
},
{
"name"
:
"Trigger distance"
,
"shortDescription"
:
"Distance between each triggering of the camera. 0 specifies not camera trigger."
,
...
...
src/MissionManager/StructureScanComplexItem.cc
View file @
7a669919
This diff is collapsed.
Click to expand it.
src/MissionManager/StructureScanComplexItem.h
View file @
7a669919
...
...
@@ -30,20 +30,24 @@ public:
Q_PROPERTY
(
Fact
*
layers
READ
layers
CONSTANT
)
Q_PROPERTY
(
Fact
*
layerDistance
READ
layerDistance
CONSTANT
)
Q_PROPERTY
(
Fact
*
cameraTriggerDistance
READ
cameraTriggerDistance
CONSTANT
)
Q_PROPERTY
(
Fact
*
scanDistance
READ
scanDistance
CONSTANT
)
Q_PROPERTY
(
bool
altitudeRelative
MEMBER
_altitudeRelative
NOTIFY
altitudeRelativeChanged
)
Q_PROPERTY
(
int
cameraShots
READ
cameraShots
NOTIFY
cameraShotsChanged
)
Q_PROPERTY
(
double
timeBetweenShots
READ
timeBetweenShots
NOTIFY
timeBetweenShotsChanged
)
Q_PROPERTY
(
double
cameraMinTriggerInterval
MEMBER
_cameraMinTriggerInterval
NOTIFY
cameraMinTriggerIntervalChanged
)
Q_PROPERTY
(
QGCMapPolygon
*
mapPolygon
READ
mapPolygon
CONSTANT
)
Q_PROPERTY
(
QGCMapPolygon
*
structurePolygon
READ
structurePolygon
CONSTANT
)
Q_PROPERTY
(
QGCMapPolygon
*
flightPolygon
READ
flightPolygon
CONSTANT
)
Fact
*
altitude
(
void
)
{
return
&
_altitudeFact
;
}
Fact
*
layers
(
void
)
{
return
&
_layersFact
;
}
Fact
*
layerDistance
(
void
)
{
return
&
_layerDistanceFact
;
}
Fact
*
cameraTriggerDistance
(
void
)
{
return
&
_cameraTriggerDistanceFact
;
}
Fact
*
scanDistance
(
void
)
{
return
&
_scanDistanceFact
;
}
int
cameraShots
(
void
)
const
;
double
timeBetweenShots
(
void
)
const
;
QGCMapPolygon
*
mapPolygon
(
void
)
{
return
&
_mapPolygon
;
}
QGCMapPolygon
*
structurePolygon
(
void
)
{
return
&
_structurePolygon
;
}
QGCMapPolygon
*
flightPolygon
(
void
)
{
return
&
_flightPolygon
;
}
Q_INVOKABLE
void
rotateEntryPoint
(
void
);
...
...
@@ -95,9 +99,10 @@ private slots:
void
_setDirty
(
void
);
void
_polygonDirtyChanged
(
bool
dirty
);
void
_polygonCountChanged
(
int
count
);
void
_
polygon
PathChanged
(
void
);
void
_
flight
PathChanged
(
void
);
void
_clearInternal
(
void
);
void
_updateCoordinateAltitudes
(
void
);
void
_rebuildFlightPolygon
(
void
);
private:
void
_setExitCoordinate
(
const
QGeoCoordinate
&
coordinate
);
...
...
@@ -107,7 +112,8 @@ private:
int
_sequenceNumber
;
bool
_dirty
;
QGCMapPolygon
_mapPolygon
;
QGCMapPolygon
_structurePolygon
;
QGCMapPolygon
_flightPolygon
;
bool
_altitudeRelative
;
int
_entryVertex
;
// Polygon vertext which is used as the mission entry point
...
...
@@ -124,39 +130,13 @@ private:
Fact
_layersFact
;
Fact
_layerDistanceFact
;
Fact
_cameraTriggerDistanceFact
;
Fact
_scanDistanceFact
;
static
const
char
*
_altitudeFactName
;
static
const
char
*
_layersFactName
;
static
const
char
*
_layerDistanceFactName
;
static
const
char
*
_cameraTriggerDistanceFactName
;
static
const
char
*
_jsonGridObjectKey
;
static
const
char
*
_jsonGridAltitudeKey
;
static
const
char
*
_jsonGridAltitudeRelativeKey
;
static
const
char
*
_jsonGridAngleKey
;
static
const
char
*
_jsonGridSpacingKey
;
static
const
char
*
_jsonGridEntryLocationKey
;
static
const
char
*
_jsonTurnaroundDistKey
;
static
const
char
*
_jsonCameraTriggerDistanceKey
;
static
const
char
*
_jsonCameraTriggerInTurnaroundKey
;
static
const
char
*
_jsonHoverAndCaptureKey
;
static
const
char
*
_jsonGroundResolutionKey
;
static
const
char
*
_jsonFrontalOverlapKey
;
static
const
char
*
_jsonSideOverlapKey
;
static
const
char
*
_jsonCameraSensorWidthKey
;
static
const
char
*
_jsonCameraSensorHeightKey
;
static
const
char
*
_jsonCameraResolutionWidthKey
;
static
const
char
*
_jsonCameraResolutionHeightKey
;
static
const
char
*
_jsonCameraFocalLengthKey
;
static
const
char
*
_jsonCameraMinTriggerIntervalKey
;
static
const
char
*
_jsonManualGridKey
;
static
const
char
*
_jsonCameraObjectKey
;
static
const
char
*
_jsonCameraNameKey
;
static
const
char
*
_jsonCameraOrientationLandscapeKey
;
static
const
char
*
_jsonFixedValueIsAltitudeKey
;
static
const
char
*
_jsonRefly90DegreesKey
;
static
const
int
_hoverAndCaptureDelaySeconds
=
1
;
static
const
char
*
_scanDistanceFactName
;
};
#endif
src/PlanView/StructureScanEditor.qml
View file @
7a669919
...
...
@@ -60,11 +60,19 @@ Rectangle {
QGCLabel
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
text
:
qsTr
(
"
WARNING: WORK IN PROGRESS. USE AT YOUR OWN RISK.
"
)
text
:
qsTr
(
"
WARNING: WORK IN PROGRESS. USE AT YOUR OWN RISK.
MEANT FOR DISCUSSION ONLY. DO NOT REPORT BUGS.
"
)
wrapMode
:
Text
.
WordWrap
color
:
qgcPal
.
warningText
}
QGCLabel
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
text
:
qsTr
(
"
Note: Polygon respresents structure surface not vehicle flight path.
"
)
wrapMode
:
Text
.
WordWrap
font.pointSize
:
ScreenTools
.
smallFontPointSize
}
QGCLabel
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
...
...
@@ -99,6 +107,12 @@ Rectangle {
Layout.fillWidth
:
true
}
QGCLabel
{
text
:
qsTr
(
"
Scan distance
"
)
}
FactTextField
{
fact
:
missionItem
.
scanDistance
Layout.fillWidth
:
true
}
QGCLabel
{
text
:
qsTr
(
"
Trigger Distance
"
)
}
FactTextField
{
fact
:
missionItem
.
cameraTriggerDistance
...
...
src/PlanView/StructureScanMapVisual.qml
View file @
7a669919
...
...
@@ -25,31 +25,28 @@ Item {
property
var
map
///< Map control to place item in
property
var
_missionItem
:
object
property
var
_
mapPolygon
:
object
.
map
Polygon
property
var
_
gridComponent
property
var
_
structurePolygon
:
object
.
structure
Polygon
property
var
_
flightPolygon
:
object
.
flightPolygon
property
var
_entryCoordinate
property
var
_exitCoordinate
signal
clicked
(
int
sequenceNumber
)
function
_addVisualElements
()
{
_gridComponent
=
gridComponent
.
createObject
(
map
)
_entryCoordinate
=
entryPointComponent
.
createObject
(
map
)
_exitCoordinate
=
exitPointComponent
.
createObject
(
map
)
map
.
addMapItem
(
_gridComponent
)
map
.
addMapItem
(
_entryCoordinate
)
map
.
addMapItem
(
_exitCoordinate
)
}
function
_destroyVisualElements
()
{
_gridComponent
.
destroy
()
_entryCoordinate
.
destroy
()
_exitCoordinate
.
destroy
()
}
/// Add an initial 4 sided polygon if there is none
function
_addInitialPolygon
()
{
if
(
_
map
Polygon
.
count
<
3
)
{
if
(
_
structure
Polygon
.
count
<
3
)
{
// Initial polygon is inset to take 2/3rds space
var
rect
=
Qt
.
rect
(
map
.
centerViewport
.
x
,
map
.
centerViewport
.
y
,
map
.
centerViewport
.
width
,
map
.
centerViewport
.
height
)
rect
.
x
+=
(
rect
.
width
*
0.25
)
/
2
...
...
@@ -71,10 +68,10 @@ Item {
bottomLeftCoord
=
centerCoord
.
atDistanceAndAzimuth
(
halfWidthMeters
,
-
90
).
atDistanceAndAzimuth
(
halfHeightMeters
,
180
)
bottomRightCoord
=
centerCoord
.
atDistanceAndAzimuth
(
halfWidthMeters
,
90
).
atDistanceAndAzimuth
(
halfHeightMeters
,
180
)
_
map
Polygon
.
appendVertex
(
topLeftCoord
)
_
map
Polygon
.
appendVertex
(
topRightCoord
)
_
map
Polygon
.
appendVertex
(
bottomRightCoord
)
_
map
Polygon
.
appendVertex
(
bottomLeftCoord
)
_
structure
Polygon
.
appendVertex
(
topLeftCoord
)
_
structure
Polygon
.
appendVertex
(
topRightCoord
)
_
structure
Polygon
.
appendVertex
(
bottomRightCoord
)
_
structure
Polygon
.
appendVertex
(
bottomLeftCoord
)
}
}
...
...
@@ -88,9 +85,8 @@ Item {
}
QGCMapPolygonVisuals
{
id
:
mapPolygonVisuals
mapControl
:
map
mapPolygon
:
_
map
Polygon
mapPolygon
:
_
structure
Polygon
interactive
:
_missionItem
.
isCurrentItem
borderWidth
:
1
borderColor
:
"
black
"
...
...
@@ -98,15 +94,12 @@ Item {
interiorOpacity
:
0.5
}
// Survey grid lines
Component
{
id
:
gridComponent
MapPolyline
{
line.color
:
"
white
"
line.width
:
2
path
:
_missionItem
.
gridPoints
}
QGCMapPolygonVisuals
{
mapControl
:
map
mapPolygon
:
_flightPolygon
interactive
:
false
borderWidth
:
2
borderColor
:
"
white
"
}
// Entry point
...
...
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