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
604d4051
Commit
604d4051
authored
Jul 15, 2018
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ability to set Gimbal Pitch on manual scan
parent
07d998cf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
44 deletions
+43
-44
StructureScan.SettingsGroup.json
src/MissionManager/StructureScan.SettingsGroup.json
+0
-37
StructureScanComplexItem.cc
src/MissionManager/StructureScanComplexItem.cc
+28
-7
StructureScanComplexItem.h
src/MissionManager/StructureScanComplexItem.h
+5
-0
StructureScanEditor.qml
src/PlanView/StructureScanEditor.qml
+10
-0
No files found.
src/MissionManager/StructureScan.SettingsGroup.json
View file @
604d4051
...
...
@@ -9,16 +9,6 @@
"decimalPlaces"
:
0
,
"defaultValue"
:
0
},
{
"name"
:
"GimbalYaw"
,
"shortDescription"
:
"Gimbal yaw rotation."
,
"type"
:
"double"
,
"units"
:
"deg"
,
"min"
:
-180.0
,
"max"
:
180.0
,
"decimalPlaces"
:
0
,
"defaultValue"
:
90
},
{
"name"
:
"Altitude"
,
"shortDescription"
:
"Altitude for the bottom layer of the structure scan."
,
...
...
@@ -41,32 +31,5 @@
"units"
:
"m"
,
"min"
:
1
,
"defaultValue"
:
100
},
{
"name"
:
"Layer distance"
,
"shortDescription"
:
"Distance between each layer."
,
"type"
:
"double"
,
"decimalPlaces"
:
2
,
"min"
:
0
,
"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."
,
"type"
:
"double"
,
"decimalPlaces"
:
2
,
"min"
:
0
,
"units"
:
"m"
,
"defaultValue"
:
25
}
]
src/MissionManager/StructureScanComplexItem.cc
View file @
604d4051
...
...
@@ -25,6 +25,7 @@ const char* StructureScanComplexItem::settingsGroup = "StructureSc
const
char
*
StructureScanComplexItem
::
altitudeName
=
"Altitude"
;
const
char
*
StructureScanComplexItem
::
structureHeightName
=
"StructureHeight"
;
const
char
*
StructureScanComplexItem
::
layersName
=
"Layers"
;
const
char
*
StructureScanComplexItem
::
gimbalPitchName
=
"GimbalPitch"
;
const
char
*
StructureScanComplexItem
::
jsonComplexItemTypeValue
=
"StructureScan"
;
const
char
*
StructureScanComplexItem
::
_jsonCameraCalcKey
=
"CameraCalc"
;
...
...
@@ -44,6 +45,7 @@ StructureScanComplexItem::StructureScanComplexItem(Vehicle* vehicle, bool flyVie
,
_altitudeFact
(
settingsGroup
,
_metaDataMap
[
altitudeName
])
,
_structureHeightFact
(
settingsGroup
,
_metaDataMap
[
structureHeightName
])
,
_layersFact
(
settingsGroup
,
_metaDataMap
[
layersName
])
,
_gimbalPitchFact
(
settingsGroup
,
_metaDataMap
[
gimbalPitchName
])
{
_editorQml
=
"qrc:/qml/StructureScanEditor.qml"
;
...
...
@@ -51,6 +53,7 @@ StructureScanComplexItem::StructureScanComplexItem(Vehicle* vehicle, bool flyVie
connect
(
&
_altitudeFact
,
&
Fact
::
valueChanged
,
this
,
&
StructureScanComplexItem
::
_setDirty
);
connect
(
&
_layersFact
,
&
Fact
::
valueChanged
,
this
,
&
StructureScanComplexItem
::
_setDirty
);
connect
(
&
_gimbalPitchFact
,
&
Fact
::
valueChanged
,
this
,
&
StructureScanComplexItem
::
_setDirty
);
connect
(
&
_layersFact
,
&
Fact
::
valueChanged
,
this
,
&
StructureScanComplexItem
::
_recalcLayerInfo
);
connect
(
&
_structureHeightFact
,
&
Fact
::
valueChanged
,
this
,
&
StructureScanComplexItem
::
_recalcLayerInfo
);
...
...
@@ -76,6 +79,8 @@ StructureScanComplexItem::StructureScanComplexItem(Vehicle* vehicle, bool flyVie
connect
(
_cameraCalc
.
adjustedFootprintSide
(),
&
Fact
::
valueChanged
,
this
,
&
StructureScanComplexItem
::
_recalcCameraShots
);
connect
(
&
_layersFact
,
&
Fact
::
valueChanged
,
this
,
&
StructureScanComplexItem
::
_recalcCameraShots
);
connect
(
&
_cameraCalc
,
&
CameraCalc
::
isManualCameraChanged
,
this
,
&
StructureScanComplexItem
::
_updateGimbalPitch
);
_recalcLayerInfo
();
if
(
!
kmlFile
.
isEmpty
())
{
...
...
@@ -147,9 +152,10 @@ void StructureScanComplexItem::save(QJsonArray& missionItems)
saveObject
[
ComplexMissionItem
::
jsonComplexItemTypeKey
]
=
jsonComplexItemTypeValue
;
saveObject
[
altitudeName
]
=
_altitudeFact
.
rawValue
().
toDouble
();
saveObject
[
structureHeightName
]
=
_structureHeightFact
.
rawValue
().
toDouble
();
saveObject
[
_jsonAltitudeRelativeKey
]
=
_altitudeRelative
;
saveObject
[
structureHeightName
]
=
_structureHeightFact
.
rawValue
().
toDouble
();
saveObject
[
_jsonAltitudeRelativeKey
]
=
_altitudeRelative
;
saveObject
[
layersName
]
=
_layersFact
.
rawValue
().
toDouble
();
saveObject
[
gimbalPitchName
]
=
_gimbalPitchFact
.
rawValue
().
toDouble
();
QJsonObject
cameraCalcObject
;
_cameraCalc
.
save
(
cameraCalcObject
);
...
...
@@ -180,6 +186,7 @@ bool StructureScanComplexItem::load(const QJsonObject& complexObject, int sequen
{
structureHeightName
,
QJsonValue
::
Double
,
true
},
{
_jsonAltitudeRelativeKey
,
QJsonValue
::
Bool
,
true
},
{
layersName
,
QJsonValue
::
Double
,
true
},
{
gimbalPitchName
,
QJsonValue
::
Double
,
false
},
// This value was added after initial implementation so may be missing from older files
{
_jsonCameraCalcKey
,
QJsonValue
::
Object
,
true
},
};
if
(
!
JsonHelper
::
validateKeys
(
complexObject
,
keyInfoList
,
errorString
))
{
...
...
@@ -212,6 +219,12 @@ bool StructureScanComplexItem::load(const QJsonObject& complexObject, int sequen
_layersFact
.
setRawValue
(
complexObject
[
layersName
].
toDouble
());
_altitudeRelative
=
complexObject
[
_jsonAltitudeRelativeKey
].
toBool
(
true
);
double
gimbalPitchValue
=
0
;
if
(
complexObject
.
contains
(
gimbalPitchName
))
{
gimbalPitchValue
=
complexObject
[
gimbalPitchName
].
toDouble
();
}
_gimbalPitchFact
.
setRawValue
(
gimbalPitchValue
);
if
(
!
_structurePolygon
.
loadFromJson
(
complexObject
,
true
/* required */
,
errorString
))
{
_structurePolygon
.
clear
();
return
false
;
...
...
@@ -256,11 +269,12 @@ void StructureScanComplexItem::appendMissionItems(QList<MissionItem*>& items, QO
MissionItem
*
item
=
new
MissionItem
(
seqNum
++
,
MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET
,
MAV_FRAME_MISSION
,
0
,
0
,
0
,
0
,
// param 1-4 not used
0
,
0
,
// Pitch and Roll stay in standard orientation
90
,
// 90 degreee yaw offset to point to structure
true
,
// autoContinue
false
,
// isCurrentItem
0
,
0
,
0
,
0
,
// param 1-4 not used
_gimbalPitchFact
.
rawValue
().
toDouble
(),
0
,
// Roll stays in standard orientation
90
,
// 90 degreee yaw offset to point to structure
true
,
// autoContinue
false
,
// isCurrentItem
missionItemParent
);
items
.
append
(
item
);
...
...
@@ -464,3 +478,10 @@ void StructureScanComplexItem::_recalcLayerInfo(void)
_layersFact
.
setSendValueChangedSignals
(
true
);
}
}
void
StructureScanComplexItem
::
_updateGimbalPitch
(
void
)
{
if
(
!
_cameraCalc
.
isManualCamera
())
{
_gimbalPitchFact
.
setRawValue
(
0
);
}
}
src/MissionManager/StructureScanComplexItem.h
View file @
604d4051
...
...
@@ -34,6 +34,7 @@ public:
Q_PROPERTY
(
Fact
*
altitude
READ
altitude
CONSTANT
)
Q_PROPERTY
(
Fact
*
structureHeight
READ
structureHeight
CONSTANT
)
Q_PROPERTY
(
Fact
*
layers
READ
layers
CONSTANT
)
Q_PROPERTY
(
Fact
*
gimbalPitch
READ
gimbalPitch
CONSTANT
)
Q_PROPERTY
(
bool
altitudeRelative
READ
altitudeRelative
WRITE
setAltitudeRelative
NOTIFY
altitudeRelativeChanged
)
Q_PROPERTY
(
int
cameraShots
READ
cameraShots
NOTIFY
cameraShotsChanged
)
Q_PROPERTY
(
double
timeBetweenShots
READ
timeBetweenShots
NOTIFY
timeBetweenShotsChanged
)
...
...
@@ -44,6 +45,7 @@ public:
Fact
*
altitude
(
void
)
{
return
&
_altitudeFact
;
}
Fact
*
structureHeight
(
void
)
{
return
&
_structureHeightFact
;
}
Fact
*
layers
(
void
)
{
return
&
_layersFact
;
}
Fact
*
gimbalPitch
(
void
)
{
return
&
_gimbalPitchFact
;
}
bool
altitudeRelative
(
void
)
const
{
return
_altitudeRelative
;
}
int
cameraShots
(
void
)
const
;
...
...
@@ -98,6 +100,7 @@ public:
static
const
char
*
altitudeName
;
static
const
char
*
structureHeightName
;
static
const
char
*
layersName
;
static
const
char
*
gimbalPitchName
;
signals:
void
cameraShotsChanged
(
int
cameraShots
);
...
...
@@ -114,6 +117,7 @@ private slots:
void
_recalcCameraShots
(
void
);
void
_recalcLayerInfo
(
void
);
void
_updateLastSequenceNumber
(
void
);
void
_updateGimbalPitch
(
void
);
private:
void
_setExitCoordinate
(
const
QGeoCoordinate
&
coordinate
);
...
...
@@ -141,6 +145,7 @@ private:
SettingsFact
_altitudeFact
;
SettingsFact
_structureHeightFact
;
SettingsFact
_layersFact
;
SettingsFact
_gimbalPitchFact
;
static
const
char
*
_jsonCameraCalcKey
;
static
const
char
*
_jsonAltitudeRelativeKey
;
...
...
src/PlanView/StructureScanEditor.qml
View file @
604d4051
...
...
@@ -126,6 +126,16 @@ Rectangle {
Layout.fillWidth
:
true
}
QGCLabel
{
text
:
qsTr
(
"
Gimbal pitch
"
)
visible
:
missionItem
.
cameraCalc
.
isManualCamera
}
FactTextField
{
fact
:
missionItem
.
gimbalPitch
Layout.fillWidth
:
true
visible
:
missionItem
.
cameraCalc
.
isManualCamera
}
QGCCheckBox
{
text
:
qsTr
(
"
Relative altitude
"
)
checked
:
missionItem
.
altitudeRelative
...
...
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