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
09b28319
Unverified
Commit
09b28319
authored
Nov 15, 2017
by
Don Gagne
Committed by
GitHub
Nov 15, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5841 from DonLakeFlyer/WaypointsOnlyROI
Support ROI tool button in WaypointsOnly mode
parents
dce6c6aa
19c5257e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
83 additions
and
29 deletions
+83
-29
MavCmdInfoCommon.json
src/FirmwarePlugin/PX4/MavCmdInfoCommon.json
+5
-0
MavCmdInfoCommon.json
src/MissionManager/MavCmdInfoCommon.json
+1
-1
MissionController.cc
src/MissionManager/MissionController.cc
+24
-0
MissionController.h
src/MissionManager/MissionController.h
+5
-0
SimpleMissionItem.cc
src/MissionManager/SimpleMissionItem.cc
+9
-7
PlanView.qml
src/PlanView/PlanView.qml
+39
-14
PositionManager.cpp
src/PositionManager/PositionManager.cpp
+0
-6
PositionManager.h
src/PositionManager/PositionManager.h
+0
-1
No files found.
src/FirmwarePlugin/PX4/MavCmdInfoCommon.json
View file @
09b28319
...
...
@@ -13,6 +13,11 @@
"id"
:
21
,
"comment"
:
"MAV_CMD_NAV_LAND"
,
"paramRemove"
:
"1"
},
{
"id"
:
201
,
"comment"
:
"MAV_CMD_DO_SET_ROI"
,
"paramRemove"
:
"1,2,3"
}
]
}
src/MissionManager/MavCmdInfoCommon.json
View file @
09b28319
...
...
@@ -655,7 +655,7 @@
{
"id"
:
201
,
"rawName"
:
"MAV_CMD_DO_SET_ROI"
,
"friendlyName"
:
"Region of interest
(cmd)
"
,
"friendlyName"
:
"Region of interest"
,
"description"
:
"Sets the region of interest for cameras."
,
"specifiesCoordinate"
:
true
,
"standaloneCoordinate"
:
true
,
...
...
src/MissionManager/MissionController.cc
View file @
09b28319
...
...
@@ -359,6 +359,30 @@ int MissionController::insertSimpleMissionItem(QGeoCoordinate coordinate, int i)
return
newItem
->
sequenceNumber
();
}
int
MissionController
::
insertROIMissionItem
(
QGeoCoordinate
coordinate
,
int
i
)
{
int
sequenceNumber
=
_nextSequenceNumber
();
SimpleMissionItem
*
newItem
=
new
SimpleMissionItem
(
_controllerVehicle
,
this
);
newItem
->
setSequenceNumber
(
sequenceNumber
);
newItem
->
setCoordinate
(
coordinate
);
newItem
->
setCommand
(
MavlinkQmlSingleton
::
MAV_CMD_DO_SET_ROI
);
_initVisualItem
(
newItem
);
newItem
->
setDefaultsForCommand
();
double
prevAltitude
;
MAV_FRAME
prevFrame
;
if
(
_findPreviousAltitude
(
i
,
&
prevAltitude
,
&
prevFrame
))
{
newItem
->
missionItem
().
setFrame
(
prevFrame
);
newItem
->
missionItem
().
setParam7
(
prevAltitude
);
}
_visualItems
->
insert
(
i
,
newItem
);
_recalcAll
();
return
newItem
->
sequenceNumber
();
}
int
MissionController
::
insertComplexMissionItem
(
QString
itemName
,
QGeoCoordinate
mapCenterCoordinate
,
int
i
)
{
ComplexMissionItem
*
newItem
;
...
...
src/MissionManager/MissionController.h
View file @
09b28319
...
...
@@ -95,6 +95,11 @@ public:
/// @return Sequence number for new item
Q_INVOKABLE
int
insertSimpleMissionItem
(
QGeoCoordinate
coordinate
,
int
i
);
/// Add a new ROI mission item to the list
/// @param i: index to insert at
/// @return Sequence number for new item
Q_INVOKABLE
int
insertROIMissionItem
(
QGeoCoordinate
coordinate
,
int
i
);
/// Add a new complex mission item to the list
/// @param itemName: Name of complex item to create (from complexMissionItemNames)
/// @param mapCenterCoordinate: coordinate for current center of map
...
...
src/MissionManager/SimpleMissionItem.cc
View file @
09b28319
...
...
@@ -349,19 +349,21 @@ QString SimpleMissionItem::commandName(void) const
QString
SimpleMissionItem
::
abbreviation
()
const
{
if
(
homePosition
())
return
QStringLiteral
(
"H"
);
return
tr
(
"H"
);
switch
(
command
())
{
default:
return
QString
();
case
MavlinkQmlSingleton
:
:
MAV_CMD_NAV_TAKEOFF
:
return
QStringLiteral
(
"Takeoff"
);
return
tr
(
"Takeoff"
);
case
MavlinkQmlSingleton
:
:
MAV_CMD_NAV_LAND
:
return
QStringLiteral
(
"Land"
);
return
tr
(
"Land"
);
case
MavlinkQmlSingleton
:
:
MAV_CMD_NAV_VTOL_TAKEOFF
:
return
QStringLiteral
(
"VTOL Takeoff"
);
return
tr
(
"VTOL Takeoff"
);
case
MavlinkQmlSingleton
:
:
MAV_CMD_NAV_VTOL_LAND
:
return
QStringLiteral
(
"VTOL Land"
);
return
tr
(
"VTOL Land"
);
case
MavlinkQmlSingleton
:
:
MAV_CMD_DO_SET_ROI
:
return
tr
(
"ROI"
);
default:
return
QString
();
}
}
...
...
src/PlanView/PlanView.qml
View file @
09b28319
...
...
@@ -32,13 +32,14 @@ QGCView {
viewPanel
:
panel
z
:
QGroundControl
.
zOrderTopMost
readonly
property
int
_decimalPlaces
:
8
readonly
property
real
_horizontalMargin
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_margin
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
readonly
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
readonly
property
real
_rightPanelWidth
:
Math
.
min
(
parent
.
width
/
3
,
ScreenTools
.
defaultFontPixelWidth
*
30
)
readonly
property
real
_toolButtonTopMargin
:
parent
.
height
-
ScreenTools
.
availableHeight
+
(
ScreenTools
.
defaultFontPixelHeight
/
2
)
readonly
property
var
_defaultVehicleCoordinate
:
QtPositioning
.
coordinate
(
37.803784
,
-
122.462276
)
readonly
property
int
_decimalPlaces
:
8
readonly
property
real
_horizontalMargin
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
_margin
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
readonly
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
readonly
property
real
_rightPanelWidth
:
Math
.
min
(
parent
.
width
/
3
,
ScreenTools
.
defaultFontPixelWidth
*
30
)
readonly
property
real
_toolButtonTopMargin
:
parent
.
height
-
ScreenTools
.
availableHeight
+
(
ScreenTools
.
defaultFontPixelHeight
/
2
)
readonly
property
var
_defaultVehicleCoordinate
:
QtPositioning
.
coordinate
(
37.803784
,
-
122.462276
)
readonly
property
bool
_waypointsOnlyMode
:
QGroundControl
.
corePlugin
.
options
.
missionWaypointsOnly
property
var
_planMasterController
:
masterController
property
var
_missionController
:
_planMasterController
.
missionController
...
...
@@ -47,6 +48,7 @@ QGCView {
property
var
_visualItems
:
_missionController
.
visualItems
property
bool
_lightWidgetBorders
:
editorMap
.
isSatelliteMap
property
bool
_addWaypointOnClick
:
false
property
bool
_addROIOnClick
:
false
property
bool
_singleComplexItem
:
_missionController
.
complexMissionItemNames
.
length
===
1
property
real
_toolbarHeight
:
_qgcView
.
height
-
ScreenTools
.
availableHeight
property
int
_editingLayer
:
_layerMission
...
...
@@ -219,6 +221,16 @@ QGCView {
_missionController
.
setCurrentPlanViewIndex
(
sequenceNumber
,
true
)
}
/// Inserts a new ROI mission item
/// @param coordinate Location to insert item
/// @param index Insert item at this index
function
insertROIMissionItem
(
coordinate
,
index
)
{
var
sequenceNumber
=
_missionController
.
insertROIMissionItem
(
coordinate
,
index
)
_missionController
.
setCurrentPlanViewIndex
(
sequenceNumber
,
true
)
_addROIOnClick
=
false
toolStrip
.
uncheckAll
()
}
property
int
_moveDialogMissionItemIndex
QGCFileDialog
{
...
...
@@ -329,6 +341,9 @@ QGCView {
case
_layerMission
:
if
(
_addWaypointOnClick
)
{
insertSimpleMissionItem
(
coordinate
,
_missionController
.
visualItems
.
count
)
}
else
if
(
_addROIOnClick
)
{
_addROIOnClick
=
false
insertROIMissionItem
(
coordinate
,
_missionController
.
visualItems
.
count
)
}
break
case
_layerRallyPoints
:
...
...
@@ -394,11 +409,11 @@ QGCView {
color
:
qgcPal
.
window
title
:
qsTr
(
"
Plan
"
)
z
:
QGroundControl
.
zOrderWidgets
showAlternateIcon
:
[
false
,
false
,
masterController
.
dirty
,
false
,
false
,
false
]
rotateImage
:
[
false
,
false
,
masterController
.
syncInProgress
,
false
,
false
,
false
]
animateImage
:
[
false
,
false
,
masterController
.
dirty
,
false
,
false
,
false
]
buttonEnabled
:
[
true
,
true
,
!
masterController
.
syncInProgress
,
true
,
true
,
true
]
buttonVisible
:
[
true
,
true
,
true
,
true
,
_showZoom
,
_showZoom
]
showAlternateIcon
:
[
false
,
false
,
false
,
masterController
.
dirty
,
false
,
false
,
false
]
rotateImage
:
[
false
,
false
,
false
,
masterController
.
syncInProgress
,
false
,
false
,
false
]
animateImage
:
[
false
,
false
,
false
,
masterController
.
dirty
,
false
,
false
,
false
]
buttonEnabled
:
[
true
,
true
,
true
,
!
masterController
.
syncInProgress
,
true
,
true
,
true
]
buttonVisible
:
[
true
,
_waypointsOnlyMode
,
true
,
true
,
true
,
_showZoom
,
_showZoom
]
maxHeight
:
mapScale
.
y
-
toolStrip
.
y
property
bool
_showZoom
:
!
ScreenTools
.
isMobile
...
...
@@ -409,6 +424,11 @@ QGCView {
iconSource
:
"
/qmlimages/MapAddMission.svg
"
,
toggle
:
true
},
{
name
:
"
ROI
"
,
iconSource
:
"
/qmlimages/MapAddMission.svg
"
,
toggle
:
true
},
{
name
:
_singleComplexItem
?
_missionController
.
complexMissionItemNames
[
0
]
:
"
Pattern
"
,
iconSource
:
"
/qmlimages/MapDrawShape.svg
"
,
...
...
@@ -439,16 +459,21 @@ QGCView {
switch
(
index
)
{
case
0
:
_addWaypointOnClick
=
checked
_addROIOnClick
=
false
break
case
1
:
_addROIOnClick
=
checked
_addWaypointOnClick
=
false
break
case
2
:
if
(
_singleComplexItem
)
{
addComplexItem
(
_missionController
.
complexMissionItemNames
[
0
])
}
break
case
4
:
case
5
:
editorMap
.
zoomLevel
+=
0.5
break
case
5
:
case
6
:
editorMap
.
zoomLevel
-=
0.5
break
}
...
...
src/PositionManager/PositionManager.cpp
View file @
09b28319
...
...
@@ -84,7 +84,6 @@ void QGCPositionManager::setPositionSource(QGCPositionManager::QGCPositionSource
_currentSource
->
setPreferredPositioningMethods
(
QGeoPositionInfoSource
::
SatellitePositioningMethods
);
_currentSource
->
setUpdateInterval
(
_updateInterval
);
connect
(
_currentSource
,
&
QGeoPositionInfoSource
::
positionUpdated
,
this
,
&
QGCPositionManager
::
_positionUpdated
);
connect
(
_currentSource
,
&
QGeoPositionInfoSource
::
updateTimeout
,
this
,
&
QGCPositionManager
::
_updateTimeout
);
connect
(
_currentSource
,
SIGNAL
(
error
(
QGeoPositionInfoSource
::
Error
)),
this
,
SLOT
(
_error
(
QGeoPositionInfoSource
::
Error
)));
_currentSource
->
startUpdates
();
}
...
...
@@ -94,8 +93,3 @@ void QGCPositionManager::_error(QGeoPositionInfoSource::Error positioningError)
{
qWarning
()
<<
"QGCPositionManager error"
<<
positioningError
;
}
void
QGCPositionManager
::
_updateTimeout
(
void
)
{
qWarning
()
<<
"QGCPositionManager updateTimeout"
;
}
src/PositionManager/PositionManager.h
View file @
09b28319
...
...
@@ -39,7 +39,6 @@ public:
private
slots
:
void
_positionUpdated
(
const
QGeoPositionInfo
&
update
);
void
_error
(
QGeoPositionInfoSource
::
Error
positioningError
);
void
_updateTimeout
(
void
);
signals:
void
lastPositionUpdated
(
bool
valid
,
QVariant
lastPosition
);
...
...
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