mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-03 11:24:10 +01:00
Show the altitude on the map
This commit is contained in:
parent
495bb280c7
commit
416618a26f
@ -2538,7 +2538,7 @@ void OPMapGadgetWidget::doVisualizationChanged(QList<PathCompiler::waypoint> way
|
|||||||
foreach (PathCompiler::waypoint waypoint, waypoints) {
|
foreach (PathCompiler::waypoint waypoint, waypoints) {
|
||||||
internals::PointLatLng position(waypoint.latitude, waypoint.longitude);
|
internals::PointLatLng position(waypoint.latitude, waypoint.longitude);
|
||||||
|
|
||||||
WayPointItem * wayPointItem = m_map->WPCreate(position, 0, QString(index));
|
WayPointItem * wayPointItem = m_map->WPCreate(position, waypoint.altitude, QString(index));
|
||||||
Q_ASSERT(wayPointItem);
|
Q_ASSERT(wayPointItem);
|
||||||
if(wayPointItem) {
|
if(wayPointItem) {
|
||||||
wayPointItem->SetNumber(index);
|
wayPointItem->SetNumber(index);
|
||||||
|
@ -335,6 +335,7 @@ struct PathCompiler::waypoint PathCompiler::UavoToInternal(Waypoint::DataFields
|
|||||||
|
|
||||||
internalWaypoint.latitude = LLA[0];
|
internalWaypoint.latitude = LLA[0];
|
||||||
internalWaypoint.longitude = LLA[1];
|
internalWaypoint.longitude = LLA[1];
|
||||||
|
internalWaypoint.altitude = LLA[2];
|
||||||
return internalWaypoint;
|
return internalWaypoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -363,7 +364,7 @@ Waypoint::DataFields PathCompiler::InternalToUavo(waypoint internal)
|
|||||||
// TODO: Give the point a concept of altitude
|
// TODO: Give the point a concept of altitude
|
||||||
LLA[0] = internal.latitude;
|
LLA[0] = internal.latitude;
|
||||||
LLA[1] = internal.longitude;
|
LLA[1] = internal.longitude;
|
||||||
LLA[2] = -50;
|
LLA[2] = internal.altitude;
|
||||||
|
|
||||||
Utils::CoordinateConversions().GetNED(homeLLA, LLA, NED);
|
Utils::CoordinateConversions().GetNED(homeLLA, LLA, NED);
|
||||||
|
|
||||||
|
@ -76,6 +76,7 @@ public:
|
|||||||
|
|
||||||
double latitude;
|
double latitude;
|
||||||
double longitude;
|
double longitude;
|
||||||
|
double altitude;
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user