Browse Source

Use new yawRadians method

QGC4.4
Don Gagne 10 years ago
parent
commit
10bff8552e
  1. 2
      src/ui/HSIDisplay.cc
  2. 2
      src/ui/map/QGCMapWidget.cc
  3. 4
      src/ui/map/Waypoint2DIcon.cc

2
src/ui/HSIDisplay.cc

@ -1313,7 +1313,7 @@ void HSIDisplay::drawWaypoint(QPainter& painter, const QColor& color, float widt
float radius = (waypointSize/2.0f) * 0.8 * (1/sqrt(2.0f)); float radius = (waypointSize/2.0f) * 0.8 * (1/sqrt(2.0f));
float acceptRadius = w->getAcceptanceRadius(); float acceptRadius = w->getAcceptanceRadius();
double yawDiff = w->yaw()/180.0*M_PI-yaw; double yawDiff = w->yawRadians()/180.0*M_PI-yaw;
// Draw background // Draw background
pen.setColor(Qt::black); pen.setColor(Qt::black);

2
src/ui/map/QGCMapWidget.cc

@ -750,7 +750,7 @@ void QGCMapWidget::updateWaypoint(int uas, MissionItem* wp)
// Use safe standard interfaces for non MissionItem-class based wps // Use safe standard interfaces for non MissionItem-class based wps
icon->SetCoord(internals::PointLatLng(wp->latitude(), wp->longitude())); icon->SetCoord(internals::PointLatLng(wp->latitude(), wp->longitude()));
icon->SetAltitude(wp->altitude()); icon->SetAltitude(wp->altitude());
icon->SetHeading(wp->yaw()); icon->SetHeading(wp->yawRadians());
icon->SetNumber(wpindex); icon->SetNumber(wpindex);
} }
// Re-enable signals again // Re-enable signals again

4
src/ui/map/Waypoint2DIcon.cc

@ -33,7 +33,7 @@ Waypoint2DIcon::Waypoint2DIcon(mapcontrol::MapGraphicItem* map, mapcontrol::OPMa
showOrbit(false), showOrbit(false),
color(color) color(color)
{ {
SetHeading(wp->yaw()); SetHeading(wp->yawRadians());
SetNumber(listindex); SetNumber(listindex);
this->setFlag(QGraphicsItem::ItemIgnoresTransformations,true); this->setFlag(QGraphicsItem::ItemIgnoresTransformations,true);
picture = QPixmap(radius+1, radius+1); picture = QPixmap(radius+1, radius+1);
@ -59,7 +59,7 @@ void Waypoint2DIcon::updateWaypoint()
// Store old size // Store old size
static QRectF oldSize; static QRectF oldSize;
SetHeading(waypoint->yaw()); SetHeading(waypoint->yawRadians());
SetCoord(internals::PointLatLng(waypoint->latitude(), waypoint->longitude())); SetCoord(internals::PointLatLng(waypoint->latitude(), waypoint->longitude()));
// qDebug() << "UPDATING WP:" << waypoint->sequenceNumber() << "LAT:" << waypoint->latitude() << "LON:" << waypoint->longitude(); // qDebug() << "UPDATING WP:" << waypoint->sequenceNumber() << "LAT:" << waypoint->latitude() << "LON:" << waypoint->longitude();

Loading…
Cancel
Save