|
|
|
@ -605,8 +605,11 @@ void Vehicle::_handleGpsRawInt(mavlink_message_t& message)
@@ -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)
@@ -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){
@@ -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)) { |
|
|
|
|