Commit 875034c0 authored by LM's avatar LM

Fixed trail plotting

parent 14c97a7e
......@@ -86,7 +86,7 @@ namespace mapcontrol
}
else if(trailtype==UAVTrailType::ByDistance)
{
if(qAbs(internals::PureProjection::DistanceBetweenLatLng(lastcoord,position))>traildistance)
if(qAbs(internals::PureProjection::DistanceBetweenLatLng(lastcoord,position)*1000)>traildistance)
{
trail->addToGroup(new TrailItem(position,altitude,color,this));
if(!lasttrailline.IsEmpty())
......
......@@ -26,6 +26,9 @@ QGCMapWidget::~QGCMapWidget()
void QGCMapWidget::showEvent(QShowEvent* event)
{
// FIXME XXX this is a hack to trick OPs current 1-system design
SetShowUAV(false);
// Pass on to parent widget
OPMapWidget::showEvent(event);
......@@ -67,20 +70,21 @@ void QGCMapWidget::showEvent(QShowEvent* event)
SetFollowMouse(true); // we want a contiuous mouse position reading
SetShowHome(true); // display the HOME position on the map
SetShowUAV(true); // display the UAV position on the map
// SetShowUAV(true); // display the UAV position on the map
//SetShowDiagnostics(true); // Not needed in flight / production mode
Home->SetSafeArea(safe_area_radius_list[0]); // set radius (meters)
Home->SetShowSafeArea(true); // show the safe area
// UAV->SetTrailTime(uav_trail_time_list[0]); // seconds
// UAV->SetTrailDistance(uav_trail_distance_list[1]); // meters
//// UAV->SetTrailTime(uav_trail_time_list[0]); // seconds
//// UAV->SetTrailDistance(uav_trail_distance_list[1]); // meters
// UAV->SetTrailType(UAVTrailType::ByTimeElapsed);
// UAV->SetTrailType(UAVTrailType::ByDistance);
//// UAV->SetTrailType(mapcontrol::UAVTrailType::ByTimeElapsed);
//// UAV->SetTrailType(mapcontrol::UAVTrailType::ByDistance);
GPS->SetTrailTime(uav_trail_time_list[0]); // seconds
GPS->SetTrailDistance(uav_trail_distance_list[1]); // meters
// GPS->SetTrailTime(uav_trail_time_list[0]); // seconds
// GPS->SetTrailDistance(uav_trail_distance_list[1]); // meters
// GPS->SetTrailType(UAVTrailType::ByTimeElapsed);
......@@ -245,9 +249,9 @@ void QGCMapWidget::updateGlobalPosition(UASInterface* uas, double lat, double lo
newUAV->setParentItem(map);
UAVS.insert(uas->getUASID(), newUAV);
uav = GetUAV(uas->getUASID());
// uav->SetTrailTime(1);
// uav->SetTrailDistance(5);
// uav->SetTrailType(mapcontrol::UAVTrailType::ByTimeElapsed);
uav->SetTrailTime(1);
uav->SetTrailDistance(5);
uav->SetTrailType(mapcontrol::UAVTrailType::ByTimeElapsed);
}
// Set new lat/lon position of UAV icon
......@@ -276,6 +280,9 @@ void QGCMapWidget::updateGlobalPosition()
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
......
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