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
6e68375f
Unverified
Commit
6e68375f
authored
Jan 01, 2020
by
Don Gagne
Committed by
GitHub
Jan 01, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8195 from DonLakeFlyer/GCSHeading
Don't show GCS heading unless it comes from plugin
parents
ac65f8e4
19c73739
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
14 deletions
+19
-14
FlightMap.qml
src/FlightMap/FlightMap.qml
+1
-1
PositionManager.cpp
src/PositionManager/PositionManager.cpp
+11
-7
PositionManager.h
src/PositionManager/PositionManager.h
+7
-6
No files found.
src/FlightMap/FlightMap.qml
View file @
6e68375f
...
...
@@ -35,7 +35,7 @@ Map {
property
string
mapName
:
'
defaultMap
'
property
bool
isSatelliteMap
:
activeMapType
.
name
.
indexOf
(
"
Satellite
"
)
>
-
1
||
activeMapType
.
name
.
indexOf
(
"
Hybrid
"
)
>
-
1
property
var
gcsPosition
:
QGroundControl
.
qgcPositionManger
.
gcsPosition
property
int
gcsHeading
:
QGroundControl
.
qgcPositionManger
.
gcsHeading
property
real
gcsHeading
:
QGroundControl
.
qgcPositionManger
.
gcsHeading
property
bool
userPanned
:
false
///< true: the user has manually panned the map
property
bool
allowGCSLocationCenter
:
false
///< true: map will center/zoom to gcs location one time
property
bool
allowVehicleLocationCenter
:
false
///< true: map will center/zoom to vehicle location one time
...
...
src/PositionManager/PositionManager.cpp
View file @
6e68375f
...
...
@@ -13,12 +13,6 @@
QGCPositionManager
::
QGCPositionManager
(
QGCApplication
*
app
,
QGCToolbox
*
toolbox
)
:
QGCTool
(
app
,
toolbox
)
,
_updateInterval
(
0
)
,
_gcsHeading
(
NAN
)
,
_currentSource
(
nullptr
)
,
_defaultSource
(
nullptr
)
,
_nmeaSource
(
nullptr
)
,
_simulatedSource
(
nullptr
)
{
}
...
...
@@ -34,6 +28,9 @@ void QGCPositionManager::setToolbox(QGCToolbox *toolbox)
QGCTool
::
setToolbox
(
toolbox
);
//-- First see if plugin provides a position source
_defaultSource
=
toolbox
->
corePlugin
()
->
createPositionSource
(
this
);
if
(
_defaultSource
)
{
_usingPluginSource
=
true
;
}
if
(
qgcApp
()
->
runningUnitTests
())
{
// Units test on travis fail due to lack of position source
...
...
@@ -91,7 +88,14 @@ void QGCPositionManager::_positionUpdated(const QGeoPositionInfo &update)
_gcsPosition
=
newGCSPosition
;
emit
gcsPositionChanged
(
_gcsPosition
);
}
if
(
newGCSHeading
!=
_gcsHeading
)
{
// At this point only plugins support gcs heading. The reason is that the quality of heading information from a local
// position device (not a compass) is unknown. In many cases it can only be trusted if the GCS location is moving above
// a certain rate of speed. When it is not, or the gcs is standing still the heading is just random. We don't want these
// random heading to be shown on the fly view. So until we can get a true compass based heading or some smarted heading quality
// information which takes into account the speed of movement we normally don't set a heading. We do use the heading though
// if the plugin overrides the position source. In that case we assume that it hopefully know what it is doing.
if
(
_usingPluginSource
&&
newGCSHeading
!=
_gcsHeading
)
{
_gcsHeading
=
newGCSHeading
;
emit
gcsHeadingChanged
(
_gcsHeading
);
}
...
...
src/PositionManager/PositionManager.h
View file @
6e68375f
...
...
@@ -56,13 +56,14 @@ signals:
void
positionInfoUpdated
(
QGeoPositionInfo
update
);
private:
int
_updateInterval
;
int
_updateInterval
=
0
;
QGeoPositionInfo
_geoPositionInfo
;
QGeoCoordinate
_gcsPosition
;
qreal
_gcsHeading
;
qreal
_gcsHeading
=
qQNaN
()
;
QGeoPositionInfoSource
*
_currentSource
;
QGeoPositionInfoSource
*
_defaultSource
;
QNmeaPositionInfoSource
*
_nmeaSource
;
QGeoPositionInfoSource
*
_simulatedSource
;
QGeoPositionInfoSource
*
_currentSource
=
nullptr
;
QGeoPositionInfoSource
*
_defaultSource
=
nullptr
;
QNmeaPositionInfoSource
*
_nmeaSource
=
nullptr
;
QGeoPositionInfoSource
*
_simulatedSource
=
nullptr
;
bool
_usingPluginSource
=
false
;
};
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