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
3c7c9b74
Commit
3c7c9b74
authored
Feb 24, 2017
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added altitude to the Vehicle coordinate (QGeoCoordinate)
parent
c62e1fbb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
Vehicle.cc
src/Vehicle/Vehicle.cc
+15
-5
Vehicle.h
src/Vehicle/Vehicle.h
+5
-2
No files found.
src/Vehicle/Vehicle.cc
View file @
3c7c9b74
...
...
@@ -605,8 +605,11 @@ void Vehicle::_handleGpsRawInt(mavlink_message_t& message)
if
(
gpsRawInt
.
fix_type
>=
GPS_FIX_TYPE_3D_FIX
)
{
if
(
!
_globalPositionIntMessageAvailable
)
{
setLatitude
(
gpsRawInt
.
lat
/
(
double
)
1E7
);
setLongitude
(
gpsRawInt
.
lon
/
(
double
)
1E7
);
//-- Set these here and emit a single signal instead of 3 for the same variable (_coordinate)
_coordinate
.
setLatitude
(
gpsRawInt
.
lat
/
(
double
)
1E7
);
_coordinate
.
setLongitude
(
gpsRawInt
.
lon
/
(
double
)
1E7
);
_coordinate
.
setAltitude
(
gpsRawInt
.
alt
/
1000.0
);
emit
coordinateChanged
(
_coordinate
);
_altitudeAMSLFact
.
setRawValue
(
gpsRawInt
.
alt
/
1000.0
);
}
}
...
...
@@ -628,9 +631,11 @@ void Vehicle::_handleGlobalPositionInt(mavlink_message_t& message)
mavlink_msg_global_position_int_decode
(
&
message
,
&
globalPositionInt
);
_globalPositionIntMessageAvailable
=
true
;
setLatitude
(
globalPositionInt
.
lat
/
(
double
)
1E7
);
setLongitude
(
globalPositionInt
.
lon
/
(
double
)
1E7
);
//-- Set these here and emit a single signal instead of 3 for the same variable (_coordinate)
_coordinate
.
setLatitude
(
globalPositionInt
.
lat
/
(
double
)
1E7
);
_coordinate
.
setLongitude
(
globalPositionInt
.
lon
/
(
double
)
1E7
);
_coordinate
.
setAltitude
(
globalPositionInt
.
alt
/
1000.0
);
emit
coordinateChanged
(
_coordinate
);
_altitudeRelativeFact
.
setRawValue
(
globalPositionInt
.
relative_alt
/
1000.0
);
_altitudeAMSLFact
.
setRawValue
(
globalPositionInt
.
alt
/
1000.0
);
}
...
...
@@ -1136,6 +1141,11 @@ void Vehicle::setLongitude(double longitude){
emit
coordinateChanged
(
_coordinate
);
}
void
Vehicle
::
setAltitude
(
double
altitude
){
_coordinate
.
setAltitude
(
altitude
);
emit
coordinateChanged
(
_coordinate
);
}
void
Vehicle
::
_updateAttitude
(
UASInterface
*
,
double
roll
,
double
pitch
,
double
yaw
,
quint64
)
{
if
(
qIsInf
(
roll
))
{
...
...
src/Vehicle/Vehicle.h
View file @
3c7c9b74
...
...
@@ -645,8 +645,11 @@ public:
QString
vehicleImageCompass
()
const
;
public
slots
:
void
setLatitude
(
double
latitude
);
void
setLongitude
(
double
longitude
);
/// Sets the firmware plugin instance data associated with this Vehicle. This object will be parented to the Vehicle
/// and destroyed when the vehicle goes away.
void
setLatitude
(
double
latitude
);
void
setLongitude
(
double
longitude
);
void
setAltitude
(
double
altitude
);
signals:
void
allLinksInactive
(
Vehicle
*
vehicle
);
...
...
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