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
12785a32
Commit
12785a32
authored
Jun 05, 2017
by
Don Gagne
Committed by
GitHub
Jun 05, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5256 from DonLakeFlyer/EntryLocationChanges
Survey: Entry location changes
parents
6e980ad9
905b33f9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
20 deletions
+84
-20
FirmwarePlugin.cc
src/FirmwarePlugin/FirmwarePlugin.cc
+0
-11
Survey.SettingsGroup.json
src/MissionManager/Survey.SettingsGroup.json
+1
-1
SurveyMissionItem.h
src/MissionManager/SurveyMissionItem.h
+8
-8
SurveyMissionItemTest.cc
src/MissionManager/SurveyMissionItemTest.cc
+71
-0
SurveyMissionItemTest.h
src/MissionManager/SurveyMissionItemTest.h
+4
-0
No files found.
src/FirmwarePlugin/FirmwarePlugin.cc
View file @
12785a32
...
...
@@ -350,17 +350,6 @@ const QVariantList& FirmwarePlugin::cameraList(const Vehicle* vehicle)
if
(
_cameraList
.
size
()
==
0
)
{
CameraMetaData
*
metaData
;
metaData
=
new
CameraMetaData
(
tr
(
"Typhoon H CGO3+"
),
// Camera name
6.264
,
// sensorWidth
4.698
,
// sensorHeight
4000
,
// imageWidth
3000
,
// imageHeight
14
,
// focalLength
true
,
// landscape orientation
true
,
// camera orientation is fixed
this
);
// parent
_cameraList
.
append
(
QVariant
::
fromValue
(
metaData
));
metaData
=
new
CameraMetaData
(
tr
(
"Sony ILCE-QX1"
),
//http://www.sony.co.uk/electronics/interchangeable-lens-cameras/ilce-qx1-body-kit/specifications
23.2
,
//http://www.sony.com/electronics/camera-lenses/sel16f28/specifications
15.4
,
...
...
src/MissionManager/Survey.SettingsGroup.json
View file @
12785a32
...
...
@@ -160,7 +160,7 @@
"name"
:
"GridEntryLocation"
,
"shortDescription"
:
"Location for entry point into survey area"
,
"type"
:
"uint32"
,
"enumStrings"
:
"
Top Left, Top Right, Bottom Left, Bottom Right
"
,
"enumStrings"
:
"
Position 1, Position 2, Position 3, Position 4
"
,
"enumValues"
:
"0,1,2,3"
,
"defaultValue"
:
0
}
...
...
src/MissionManager/SurveyMissionItem.h
View file @
12785a32
...
...
@@ -129,6 +129,14 @@ public:
void
setTurnaroundDist
(
double
dist
)
{
_turnaroundDistFact
.
setRawValue
(
dist
);
}
void
save
(
QJsonArray
&
missionItems
)
final
;
// Must match json spec for GridEntryLocation
enum
EntryLocation
{
EntryLocationTopLeft
,
EntryLocationTopRight
,
EntryLocationBottomLeft
,
EntryLocationBottomRight
,
};
static
const
char
*
jsonComplexItemTypeValue
;
static
const
char
*
settingsGroup
;
...
...
@@ -178,14 +186,6 @@ private:
CameraTriggerHoverAndCapture
};
// Must match json spec for GridEntryLocation
enum
EntryLocation
{
EntryLocationTopLeft
,
EntryLocationTopRight
,
EntryLocationBottomLeft
,
EntryLocationBottomRight
,
};
void
_setExitCoordinate
(
const
QGeoCoordinate
&
coordinate
);
void
_generateGrid
(
void
);
void
_updateCoordinateAltitude
(
void
);
...
...
src/MissionManager/SurveyMissionItemTest.cc
View file @
12785a32
...
...
@@ -178,3 +178,74 @@ void SurveyMissionItemTest::_testCameraTrigger(void)
QCOMPARE(_multiSpy->pullIntFromSignalIndex(lastSequenceNumberChangedIndex), lastSeq);
#endif
}
// Clamp expected grid angle from 0<->180. We don't care about opposite angles like 90/270
double
SurveyMissionItemTest
::
_clampGridAngle180
(
double
gridAngle
)
{
if
(
gridAngle
>=
0.0
)
{
if
(
gridAngle
==
360.0
)
{
gridAngle
=
0.0
;
}
else
if
(
gridAngle
>=
180.0
)
{
gridAngle
-=
180.0
;
}
}
else
{
if
(
gridAngle
<
-
180.0
)
{
gridAngle
+=
360.0
;
}
else
{
gridAngle
+=
180.0
;
}
}
return
gridAngle
;
}
void
SurveyMissionItemTest
::
_testGridAngle
(
void
)
{
QGCMapPolygon
*
mapPolygon
=
_surveyItem
->
mapPolygon
();
for
(
int
i
=
0
;
i
<
_polyPoints
.
count
();
i
++
)
{
QGeoCoordinate
&
vertex
=
_polyPoints
[
i
];
mapPolygon
->
appendVertex
(
vertex
);
}
for
(
double
gridAngle
=-
360.0
;
gridAngle
<=
360.0
;
gridAngle
++
)
{
_surveyItem
->
gridAngle
()
->
setRawValue
(
gridAngle
);
QVariantList
gridPoints
=
_surveyItem
->
gridPoints
();
QGeoCoordinate
firstTransectEntry
=
gridPoints
[
0
].
value
<
QGeoCoordinate
>
();
QGeoCoordinate
firstTransectExit
=
gridPoints
[
1
].
value
<
QGeoCoordinate
>
();
double
azimuth
=
firstTransectEntry
.
azimuthTo
(
firstTransectExit
);
//qDebug() << gridAngle << azimuth << _clampGridAngle180(gridAngle) << _clampGridAngle180(azimuth);
QCOMPARE
((
int
)
_clampGridAngle180
(
gridAngle
),
(
int
)
_clampGridAngle180
(
azimuth
));
}
}
void
SurveyMissionItemTest
::
_testEntryLocation
(
void
)
{
QGCMapPolygon
*
mapPolygon
=
_surveyItem
->
mapPolygon
();
for
(
int
i
=
0
;
i
<
_polyPoints
.
count
();
i
++
)
{
QGeoCoordinate
&
vertex
=
_polyPoints
[
i
];
mapPolygon
->
appendVertex
(
vertex
);
}
for
(
double
gridAngle
=-
360.0
;
gridAngle
<=
360.0
;
gridAngle
++
)
{
_surveyItem
->
gridAngle
()
->
setRawValue
(
gridAngle
);
QList
<
QGeoCoordinate
>
rgSeenEntryCoords
;
QList
<
int
>
rgEntryLocation
;
rgEntryLocation
<<
SurveyMissionItem
::
EntryLocationTopLeft
<<
SurveyMissionItem
::
EntryLocationTopRight
<<
SurveyMissionItem
::
EntryLocationBottomLeft
<<
SurveyMissionItem
::
EntryLocationBottomRight
;
// Validate that each entry location is unique
for
(
int
i
=
0
;
i
<
rgEntryLocation
.
count
();
i
++
)
{
int
entryLocation
=
rgEntryLocation
[
i
];
_surveyItem
->
gridEntryLocation
()
->
setRawValue
(
entryLocation
);
QVERIFY
(
!
rgSeenEntryCoords
.
contains
(
_surveyItem
->
coordinate
()));
rgSeenEntryCoords
<<
_surveyItem
->
coordinate
();
}
rgSeenEntryCoords
.
clear
();
}
}
src/MissionManager/SurveyMissionItemTest.h
View file @
12785a32
...
...
@@ -34,8 +34,12 @@ private slots:
void
_testDirty
(
void
);
void
_testCameraValueChanged
(
void
);
void
_testCameraTrigger
(
void
);
void
_testGridAngle
(
void
);
void
_testEntryLocation
(
void
);
private:
double
_clampGridAngle180
(
double
gridAngle
);
enum
{
gridPointsChangedIndex
=
0
,
cameraShotsChangedIndex
,
...
...
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