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
2b712a47
Commit
2b712a47
authored
Apr 22, 2017
by
Don Gagne
Committed by
GitHub
Apr 22, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5044 from DonLakeFlyer/SurveyGimbal
Plan: Survey gimbal
parents
305b1a08
b4a7e0af
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
96 additions
and
17 deletions
+96
-17
FirmwarePlugin.cc
src/FirmwarePlugin/FirmwarePlugin.cc
+9
-0
FirmwarePlugin.h
src/FirmwarePlugin/FirmwarePlugin.h
+8
-1
MissionController.cc
src/MissionManager/MissionController.cc
+44
-0
PlanMasterController.cc
src/MissionManager/PlanMasterController.cc
+24
-10
PlanToolBar.qml
src/PlanView/PlanToolBar.qml
+4
-4
PlanView.qml
src/PlanView/PlanView.qml
+7
-2
No files found.
src/FirmwarePlugin/FirmwarePlugin.cc
View file @
2b712a47
...
...
@@ -475,3 +475,12 @@ void FirmwarePlugin::missionFlightSpeedInfo(Vehicle* vehicle, double& hoverSpeed
hoverSpeed
=
appSettings
->
offlineEditingHoverSpeed
()
->
rawValue
().
toDouble
();
cruiseSpeed
=
appSettings
->
offlineEditingCruiseSpeed
()
->
rawValue
().
toDouble
();
}
bool
FirmwarePlugin
::
hasGimbal
(
Vehicle
*
vehicle
,
bool
&
rollSupported
,
bool
&
pitchSupported
,
bool
&
yawSupported
)
{
Q_UNUSED
(
vehicle
);
rollSupported
=
false
;
pitchSupported
=
false
;
yawSupported
=
false
;
return
false
;
}
src/FirmwarePlugin/FirmwarePlugin.h
View file @
2b712a47
...
...
@@ -287,9 +287,16 @@ public:
/// @param[out] cruiseSpeed Flight speed for vehicle flying in fixed wing forward flight mode. 0 for none, or not available.
virtual
void
missionFlightSpeedInfo
(
Vehicle
*
vehicle
,
double
&
hoverSpeed
,
double
&
cruiseSpeed
);
// Returns the parameter which control auto-dis
mar
. Assume == 0 means no auto disarm
// Returns the parameter which control auto-dis
arm
. Assume == 0 means no auto disarm
virtual
QString
autoDisarmParameter
(
Vehicle
*
vehicle
);
/// Used to determine whether a vehicle has a gimbal.
/// @param[out] rollSupported Gimbal supports roll
/// @param[out] pitchSupported Gimbal supports pitch
/// @param[out] yawSupported Gimbal supports yaw
/// @return true: vehicle has gimbal, false: gimbal support unknown
virtual
bool
hasGimbal
(
Vehicle
*
vehicle
,
bool
&
rollSupported
,
bool
&
pitchSupported
,
bool
&
yawSupported
);
// FIXME: Hack workaround for non pluginize FollowMe support
static
const
char
*
px4FollowMeFlightMode
;
...
...
src/MissionManager/MissionController.cc
View file @
2b712a47
...
...
@@ -288,6 +288,19 @@ int MissionController::insertComplexMissionItem(QString itemName, QGeoCoordinate
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
bool
rollSupported
=
false
;
bool
pitchSupported
=
false
;
bool
yawSupported
=
false
;
if
(
_controllerVehicle
->
firmwarePlugin
()
->
hasGimbal
(
_controllerVehicle
,
rollSupported
,
pitchSupported
,
yawSupported
)
&&
pitchSupported
)
{
MissionSettingsItem
*
settingsItem
=
_visualItems
->
value
<
MissionSettingsItem
*>
(
0
);
// If the user already specified a gimbal angle leave it alone
CameraSection
*
cameraSection
=
settingsItem
->
cameraSection
();
if
(
!
cameraSection
->
specifyGimbal
())
{
cameraSection
->
setSpecifyGimbal
(
true
);
cameraSection
->
gimbalYaw
()
->
setRawValue
(
-
90.0
);
}
}
}
else
if
(
itemName
==
_fwLandingMissionItemName
)
{
newItem
=
new
FixedWingLandingComplexItem
(
_controllerVehicle
,
_visualItems
);
}
else
{
...
...
@@ -306,11 +319,42 @@ int MissionController::insertComplexMissionItem(QString itemName, QGeoCoordinate
void
MissionController
::
removeMissionItem
(
int
index
)
{
if
(
index
<=
0
||
index
>=
_visualItems
->
count
())
{
qWarning
()
<<
"MissionController::removeMissionItem called with bad index - count:index"
<<
_visualItems
->
count
()
<<
index
;
return
;
}
bool
surveyRemoved
=
_visualItems
->
value
<
SurveyMissionItem
*>
(
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
bool
foundSurvey
=
false
;
for
(
int
i
=
1
;
i
<
_visualItems
->
count
();
i
++
)
{
if
(
_visualItems
->
value
<
SurveyMissionItem
*>
(
i
))
{
foundSurvey
=
true
;
break
;
}
}
// If there is no longer a survey item in the mission remove the gimbal pitch command
if
(
!
foundSurvey
)
{
bool
rollSupported
=
false
;
bool
pitchSupported
=
false
;
bool
yawSupported
=
false
;
if
(
_controllerVehicle
->
firmwarePlugin
()
->
hasGimbal
(
_controllerVehicle
,
rollSupported
,
pitchSupported
,
yawSupported
)
&&
pitchSupported
)
{
MissionSettingsItem
*
settingsItem
=
_visualItems
->
value
<
MissionSettingsItem
*>
(
0
);
CameraSection
*
cameraSection
=
settingsItem
->
cameraSection
();
if
(
cameraSection
->
specifyGimbal
()
&&
cameraSection
->
gimbalYaw
()
->
rawValue
().
toDouble
()
==
-
90.0
&&
cameraSection
->
gimbalPitch
()
->
rawValue
().
toDouble
()
==
0.0
)
{
cameraSection
->
setSpecifyGimbal
(
false
);
}
}
}
}
_recalcAll
();
setDirty
(
true
);
}
...
...
src/MissionManager/PlanMasterController.cc
View file @
2b712a47
...
...
@@ -119,9 +119,13 @@ void PlanMasterController::_activeVehicleChanged(Vehicle* activeVehicle)
void
PlanMasterController
::
loadFromVehicle
(
void
)
{
_loadGeoFence
=
true
;
_missionController
.
loadFromVehicle
();
setDirty
(
false
);
if
(
!
offline
())
{
_loadGeoFence
=
true
;
_missionController
.
loadFromVehicle
();
setDirty
(
false
);
}
else
{
qWarning
()
<<
"PlanMasterController::sendToVehicle called while offline"
;
}
}
...
...
@@ -154,9 +158,13 @@ void PlanMasterController::_loadSendGeoFenceCompelte(void)
void
PlanMasterController
::
sendToVehicle
(
void
)
{
_sendGeoFence
=
true
;
_missionController
.
sendToVehicle
();
setDirty
(
false
);
if
(
!
offline
())
{
_sendGeoFence
=
true
;
_missionController
.
sendToVehicle
();
setDirty
(
false
);
}
else
{
qWarning
()
<<
"PlanMasterController::sendToVehicle called while offline"
;
}
}
void
PlanMasterController
::
loadFromFile
(
const
QString
&
filename
)
...
...
@@ -264,14 +272,20 @@ void PlanMasterController::saveToFile(const QString& filename)
void
PlanMasterController
::
removeAll
(
void
)
{
_missionController
.
removeAll
();
_geoFenceController
.
removeAll
();
_rallyPointController
.
removeAll
();
}
void
PlanMasterController
::
removeAllFromVehicle
(
void
)
{
_missionController
.
removeAllFromVehicle
();
_geoFenceController
.
removeAllFromVehicle
();
_rallyPointController
.
removeAllFromVehicle
();
if
(
!
offline
())
{
_missionController
.
removeAllFromVehicle
();
_geoFenceController
.
removeAllFromVehicle
();
_rallyPointController
.
removeAllFromVehicle
();
}
else
{
qWarning
()
<<
"PlanMasterController::removeAllFromVehicle called while offline"
;
}
}
bool
PlanMasterController
::
containsItems
(
void
)
const
...
...
src/PlanView/PlanToolBar.qml
View file @
2b712a47
...
...
@@ -33,9 +33,9 @@ Rectangle {
property
bool
missionDirty
:
_controllerValid
?
planMasterController
.
missionController
.
dirty
:
false
property
bool
_controllerValid
:
planMasterController
!=
undefined
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicl
e
property
var
_controllerDirty
:
planMasterController
?
planMasterController
.
dirty
:
false
property
var
_controllerSyncInProgress
:
planMasterController
?
planMasterController
.
syncInProgress
:
false
property
bool
_controllerOffline
:
_controllerValid
?
planMasterController
.
offline
:
tru
e
property
var
_controllerDirty
:
_controllerValid
?
planMasterController
.
dirty
:
false
property
var
_controllerSyncInProgress
:
_controllerValid
?
planMasterController
.
syncInProgress
:
false
property
bool
_statusValid
:
currentMissionItem
!=
undefined
property
bool
_missionValid
:
missionItems
!=
undefined
...
...
@@ -274,7 +274,7 @@ Rectangle {
anchors.verticalCenter
:
parent
.
verticalCenter
text
:
_controllerDirty
?
qsTr
(
"
Upload Required
"
)
:
qsTr
(
"
Upload
"
)
enabled
:
!
_controllerSyncInProgress
visible
:
!
planMasterController
.
o
ffline
visible
:
!
_controllerO
ffline
onClicked
:
planMasterController
.
upload
()
PropertyAnimation
on
opacity
{
...
...
src/PlanView/PlanView.qml
View file @
2b712a47
...
...
@@ -664,9 +664,14 @@ QGCView {
Component
{
id
:
removeAllPromptDialog
QGCViewMessage
{
message
:
qsTr
(
"
Are you sure you want to remove all items? This will also remove all items from the vehicle.
"
)
message
:
qsTr
(
"
Are you sure you want to remove all items?
"
)
+
(
_planMasterController
.
offline
?
""
:
qsTr
(
"
This will also remove all items from the vehicle.
"
))
function
accept
()
{
masterController
.
removeAllFromVehicle
()
if
(
_planMasterController
.
offline
)
{
masterController
.
removeAll
()
}
else
{
masterController
.
removeAllFromVehicle
()
}
hideDialog
()
}
}
...
...
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