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
48f97727
Commit
48f97727
authored
Jan 30, 2018
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add gimbal/mode commands for Corridor Scan as well
parent
790d03b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
14 deletions
+25
-14
MissionController.cc
src/MissionManager/MissionController.cc
+25
-14
No files found.
src/MissionManager/MissionController.cc
View file @
48f97727
...
...
@@ -389,22 +389,41 @@ int MissionController::insertROIMissionItem(QGeoCoordinate coordinate, int i)
int
MissionController
::
insertComplexMissionItem
(
QString
itemName
,
QGeoCoordinate
mapCenterCoordinate
,
int
i
)
{
ComplexMissionItem
*
newItem
;
bool
surveyStyleItem
=
false
;
int
sequenceNumber
=
_nextSequenceNumber
();
if
(
itemName
==
_surveyMissionItemName
)
{
newItem
=
new
SurveyMissionItem
(
_controllerVehicle
,
_visualItems
);
newItem
->
setCoordinate
(
mapCenterCoordinate
);
// If the vehicle is known to have a gimbal then we automatically point the gimbal straight down if not already set
surveyStyleItem
=
true
;
}
else
if
(
itemName
==
_fwLandingMissionItemName
)
{
newItem
=
new
FixedWingLandingComplexItem
(
_controllerVehicle
,
_visualItems
);
}
else
if
(
itemName
==
_structureScanMissionItemName
)
{
newItem
=
new
StructureScanComplexItem
(
_controllerVehicle
,
_visualItems
);
}
else
if
(
itemName
==
_corridorScanMissionItemName
)
{
newItem
=
new
CorridorScanComplexItem
(
_controllerVehicle
,
_visualItems
);
surveyStyleItem
=
true
;
}
else
{
qWarning
()
<<
"Internal error: Unknown complex item:"
<<
itemName
;
return
sequenceNumber
;
}
if
(
surveyStyleItem
)
{
bool
rollSupported
=
false
;
bool
pitchSupported
=
false
;
bool
yawSupported
=
false
;
// If the vehicle is known to have a gimbal then we automatically point the gimbal straight down if not already set
MissionSettingsItem
*
settingsItem
=
_visualItems
->
value
<
MissionSettingsItem
*>
(
0
);
CameraSection
*
cameraSection
=
settingsItem
->
cameraSection
();
// Set camera to photo mode (leave alone if user already specified)
if
(
cameraSection
->
cameraModeSupported
()
&&
!
cameraSection
->
specifyCameraMode
())
{
cameraSection
->
setSpecifyCameraMode
(
true
);
cameraSection
->
cameraMode
()
->
setRawValue
(
CAMERA_MODE_IMAGE_SURVEY
);
}
// Point gimbal straight down
if
(
_controllerVehicle
->
firmwarePlugin
()
->
hasGimbal
(
_controllerVehicle
,
rollSupported
,
pitchSupported
,
yawSupported
)
&&
pitchSupported
)
{
// If the user already specified a gimbal angle leave it alone
...
...
@@ -413,16 +432,8 @@ int MissionController::insertComplexMissionItem(QString itemName, QGeoCoordinate
cameraSection
->
gimbalPitch
()
->
setRawValue
(
-
90.0
);
}
}
}
else
if
(
itemName
==
_fwLandingMissionItemName
)
{
newItem
=
new
FixedWingLandingComplexItem
(
_controllerVehicle
,
_visualItems
);
}
else
if
(
itemName
==
_structureScanMissionItemName
)
{
newItem
=
new
StructureScanComplexItem
(
_controllerVehicle
,
_visualItems
);
}
else
if
(
itemName
==
_corridorScanMissionItemName
)
{
newItem
=
new
CorridorScanComplexItem
(
_controllerVehicle
,
_visualItems
);
}
else
{
qWarning
()
<<
"Internal error: Unknown complex item:"
<<
itemName
;
return
sequenceNumber
;
}
newItem
->
setSequenceNumber
(
sequenceNumber
);
_initVisualItem
(
newItem
);
...
...
@@ -440,17 +451,17 @@ void MissionController::removeMissionItem(int index)
return
;
}
bool
surveyRemoved
=
_visualItems
->
value
<
SurveyMission
Item
*>
(
index
);
bool
removeSurveyStyle
=
_visualItems
->
value
<
SurveyMissionItem
*>
(
index
)
||
_visualItems
->
value
<
CorridorScanComplex
Item
*>
(
index
);
VisualMissionItem
*
item
=
qobject_cast
<
VisualMissionItem
*>
(
_visualItems
->
removeAt
(
index
));
_deinitVisualItem
(
item
);
item
->
deleteLater
();
if
(
surveyRemoved
)
{
// Determine if the mission still has another survey in it
if
(
removeSurveyStyle
)
{
// Determine if the mission still has another survey
style item
in it
bool
foundSurvey
=
false
;
for
(
int
i
=
1
;
i
<
_visualItems
->
count
();
i
++
)
{
if
(
_visualItems
->
value
<
SurveyMissionItem
*>
(
i
))
{
if
(
_visualItems
->
value
<
SurveyMissionItem
*>
(
i
)
||
_visualItems
->
value
<
CorridorScanComplexItem
*>
(
index
)
)
{
foundSurvey
=
true
;
break
;
}
...
...
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