Commit fcdf550b authored by Bryant Mairs's avatar Bryant Mairs

Removed some sources for warnings.

Also removed redundant code in QGCMapWidget.cc.
parent 6821ff47
...@@ -303,9 +303,6 @@ void QGCMapWidget::updateLocalPosition() ...@@ -303,9 +303,6 @@ void QGCMapWidget::updateLocalPosition()
} }
// Set new lat/lon position of UAV icon // Set new lat/lon position of UAV icon
double latitude = UASManager::instance()->getHomeLatitude();
double longitude = UASManager::instance()->getHomeLongitude();
double altitude = UASManager::instance()->getHomeAltitude();
internals::PointLatLng pos_lat_lon = internals::PointLatLng(system->getLatitude(), system->getLongitude()); internals::PointLatLng pos_lat_lon = internals::PointLatLng(system->getLatitude(), system->getLongitude());
uav->SetUAVPos(pos_lat_lon, system->getAltitude()); uav->SetUAVPos(pos_lat_lon, system->getAltitude());
// Follow status // Follow status
...@@ -317,33 +314,7 @@ void QGCMapWidget::updateLocalPosition() ...@@ -317,33 +314,7 @@ void QGCMapWidget::updateLocalPosition()
void QGCMapWidget::updateLocalPositionEstimates() void QGCMapWidget::updateLocalPositionEstimates()
{ {
QList<UASInterface*> systems = UASManager::instance()->getUASList(); updateLocalPosition();
foreach (UASInterface* system, systems)
{
// Get reference to graphic UAV item
mapcontrol::UAVItem* uav = GetUAV(system->getUASID());
// Check if reference is valid, else create a new one
if (uav == NULL)
{
MAV2DIcon* newUAV = new MAV2DIcon(map, this, system);
AddUAV(system->getUASID(), newUAV);
uav = newUAV;
uav->SetTrailTime(1);
uav->SetTrailDistance(5);
uav->SetTrailType(mapcontrol::UAVTrailType::ByTimeElapsed);
}
// Set new lat/lon position of UAV icon
double latitude = UASManager::instance()->getHomeLatitude();
double longitude = UASManager::instance()->getHomeLongitude();
double altitude = UASManager::instance()->getHomeAltitude();
internals::PointLatLng pos_lat_lon = internals::PointLatLng(system->getLatitude(), system->getLongitude());
uav->SetUAVPos(pos_lat_lon, system->getAltitude());
// Follow status
if (followUAVEnabled && system->getUASID() == followUAVID) SetCurrentPosition(pos_lat_lon);
// Convert from radians to degrees and apply
uav->SetUAVHeading((system->getYaw()/M_PI)*180.0f);
}
} }
......
...@@ -23,7 +23,6 @@ QGCMAVLinkMessageSender::QGCMAVLinkMessageSender(MAVLinkProtocol* mavlink, QWidg ...@@ -23,7 +23,6 @@ QGCMAVLinkMessageSender::QGCMAVLinkMessageSender(MAVLinkProtocol* mavlink, QWidg
void QGCMAVLinkMessageSender::refresh() void QGCMAVLinkMessageSender::refresh()
{ {
unsigned int maxUpdateRate = 0;
// Send messages // Send messages
foreach (unsigned int i, managementItems.keys()) foreach (unsigned int i, managementItems.keys())
{ {
...@@ -79,7 +78,7 @@ bool QGCMAVLinkMessageSender::sendMessage(unsigned int msgid) ...@@ -79,7 +78,7 @@ bool QGCMAVLinkMessageSender::sendMessage(unsigned int msgid)
uint8_t* nums = m+messageInfo[msgid].fields[fieldid].wire_offset; uint8_t* nums = m+messageInfo[msgid].fields[fieldid].wire_offset;
for (unsigned int j = 0; j < messageInfo[msgid].fields[fieldid].array_length; ++j) for (unsigned int j = 0; j < messageInfo[msgid].fields[fieldid].array_length; ++j)
{ {
if (field->data(1, Qt::DisplayRole).toString().split(" ").size() > j) if ((unsigned int)(field->data(1, Qt::DisplayRole).toString().split(" ").size()) > j)
{ {
nums[j] = field->data(1, Qt::DisplayRole).toString().split(" ").at(j).toInt(); nums[j] = field->data(1, Qt::DisplayRole).toString().split(" ").at(j).toInt();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment