Commit a9d7bb16 authored by lm's avatar lm

Merge branch 'dev' of github.com:pixhawk/qgroundcontrol into dev

parents ff9a7a77 958bd1de
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<html>
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" />
<head> <head>
<!-- <!-- QGroundControl -->
Copyright 2008 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<title>QGroundControl Google Earth View</title> <title>QGroundControl Google Earth View</title>
<!-- *** Replace the key below below with your own API key, available at http://code.google.com/apis/maps/signup.html *** --> <!-- *** Replace the key below below with your own API key, available at http://code.google.com/apis/maps/signup.html *** -->
<script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAwbkbZLyhsmTCWXbTcjbgbRSzHs7K5SvaUdm8ua-Xxy_-2dYwMxQMhnagaawTo7L1FE1-amhuQxIlXw"></script> <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAwbkbZLyhsmTCWXbTcjbgbRSzHs7K5SvaUdm8ua-Xxy_-2dYwMxQMhnagaawTo7L1FE1-amhuQxIlXw"></script>
<script type="text/javascript"> <script type="text/javascript">
google.load("earth", "1"); google.load("earth", "1", { 'language': 'en'});
var ge = null; var ge = null;
var initialized = false;
var aircraft = new Array();
var currAircraft = 220;
var followAircraft = false;
var currLat = 47.3769;
var currLon = 8.549444;
var currAlt = 470;
var homeLat = 0;
var homeLon = 0;
var homeAlt = 0;
var homeViewRange = 500;
var homeLocation = null;
var homeGroundLevel = 0;
var currViewRange = 3.0; ///<< The current viewing range from this position (in meters)
var currTilt = 40.0; ///<< The tilt angle (in degrees)
var currFollowTilt = 40.0;
var currView = null;
var planeOrient;
var planeLoc;
// Aircraft class
function isInitialized()
{
return initialized;
}
function init() { function init() {
google.earth.createInstance("map3d", initCallback, failureCallback); google.earth.createInstance("map3d", initCallback, failureCallback);
}
function setGCSHome(lat, lon, alt)
{
homeLat = lat;
homeLon = lon;
homeAlt = alt;
var placemark = ge.createPlacemark('');
var icon = ge.createIcon('');
icon.setHref('http://google-maps-icons.googlecode.com/files/blackH.png');
var style = ge.createStyle('');
style.getIconStyle().setIcon(icon);
//style.getIconStyle().setScale(0.5);
placemark.setStyleSelector(style);
// Set the placemark's location.
homeLocation = ge.createPoint('');
homeLocation.setLatitude(lat);
homeLocation.setLongitude(lon);
homeLocation.setAltitude(alt);
placemark.setGeometry(homeLocation);
// Add the placemark to Earth.
ge.getFeatures().appendChild(placemark);
homeGroundLevel = ge.getGlobe().getGroundAltitude(lat,lon);
if (homeGroundLevel == 0)
{
homeGroundLevel = alt;
}
goHome();
} }
function initCallback(object) { function initCallback(object)
{
ge = object; ge = object;
ge.getWindow().setVisibility(true); ge.getWindow().setVisibility(true);
ge.getOptions().setStatusBarVisibility(true); ge.getOptions().setStatusBarVisibility(true);
...@@ -40,11 +107,104 @@ function initCallback(object) { ...@@ -40,11 +107,104 @@ function initCallback(object) {
ge.getLayerRoot().enableLayerById(ge.LAYER_BUILDINGS, true); ge.getLayerRoot().enableLayerById(ge.LAYER_BUILDINGS, true);
ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true); ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true);
ge.getLayerRoot().enableLayerById(ge.LAYER_TREES, true); ge.getLayerRoot().enableLayerById(ge.LAYER_TREES, true);
// Now after the Google Earth initialization, initialize the GCS view
setGCSHome(currLat, currLon, currAlt);
// Create the first aircraft model
// Load 3D model
var planePlacemark = ge.createPlacemark('');
planePlacemark.setName('aircraft');
planeModel = ge.createModel('');
ge.getFeatures().appendChild(planePlacemark);
planeLoc = ge.createLocation('');
planeModel.setLocation(planeLoc);
planeLink = ge.createLink('');
planeOrient = ge.createOrientation('');
planeModel.setOrientation(planeOrient);
planeLink.setHref('http://qgroundcontrol.org/_media/users/models/multiplex-twinstar.dae');
planeModel.setLink(planeLink);
planeModel.setAltitudeMode (ge.ALTITUDE_ABSOLUTE);
planeLoc.setLatitude(currLat);
planeLoc.setLongitude(currLon);
planeLoc.setAltitude(currAlt);
planePlacemark.setGeometry(planeModel);
setAircraftPositionAttitude(220, 47.3772, currLon, currAlt+50, 20, 15, 50);
enableFollowing(true);
updateFollowAircraft();
initialized = true;
}
function setAircraftPositionAttitude(id, lat, lon, alt, roll, pitch, yaw)
{
if (id == currAircraft)
{
currLat = lat;
currLon = lon;
currAlt = alt;
}
planeOrient.setRoll(roll);
planeOrient.setTilt(pitch);
planeOrient.setHeading(yaw);
planeLoc.setLatitude(lat);
planeLoc.setLongitude(lon);
planeLoc.setAltitude(alt);
} }
function failureCallback(object) { function goHome()
{
var currView = ge.getView().copyAsLookAt(ge.ALTITUDE_ABSOLUTE);
currView.setLatitude(homeLat);
currView.setLongitude(homeLon);
currView.setAltitude(homeAlt);
currView.setRange(homeViewRange);
currView.setTilt(currTilt);
ge.getView().setAbstractView(currView);
} }
</script>
function setCurrentAircraft(id)
{
currAircraft = id;
}
function enableFollowing(follow)
{
followEnabled = follow;
}
function updateFollowAircraft()
{
if (followEnabled)
{
currView = ge.getView().copyAsLookAt(ge.ALTITUDE_ABSOLUTE);
currView.setLatitude(currLat);
currView.setLongitude(currLon);
currView.setAltitude(currAlt);
currView.setRange(currViewRange);
currView.setTilt(currFollowTilt);
ge.getView().setAbstractView(currView);
}
}
function failureCallback(object)
{
}
</script>
<style type="text/css"> <style type="text/css">
html, body { html, body {
margin: 0; margin: 0;
......
This diff is collapsed.
...@@ -95,7 +95,9 @@ namespace qmapcontrol ...@@ -95,7 +95,9 @@ namespace qmapcontrol
} }
else else
{ {
qDebug() << "NETWORK_PIXMAP_ERROR: " << ax; // QGC FIXME Error is currently undetected
// TODO Error is currently undetected
//qDebug() << "NETWORK_PIXMAP_ERROR: " << ax;
} }
} }
......
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
<file>images/mapproviders/google.png</file> <file>images/mapproviders/google.png</file>
<file>images/mapproviders/yahoo.png</file> <file>images/mapproviders/yahoo.png</file>
<file>images/earth.html</file> <file>images/earth.html</file>
<file>images/mapproviders/googleearth.svg</file>
</qresource> </qresource>
<qresource prefix="/general"> <qresource prefix="/general">
<file alias="vera.ttf">images/Vera.ttf</file> <file alias="vera.ttf">images/Vera.ttf</file>
......
B໿SketchUp Model૿{8.0.3161}䪯鷘Hᭇ亾胳튪弣ÿ璆䳺￿ 噃牥楳湯慍ー￾䌉䄀爀挀䌀甀爀瘀攀Ā＀￾䌊䄀琀琀爀椀戀甀琀攀＀￾䌓䄀琀琀爀椀戀甀琀攀䌀漀渀琀愀椀渀攀爀＀￾䌏䄀琀琀爀椀戀甀琀攀一愀洀攀搀Ā＀￾䌐䈀愀挀欀最爀漀甀渀搀䤀洀愀最攀਀＀￾䌇䌀愀洀攀爀愀Ԁ＀￾䌊䌀漀洀瀀漀渀攀渀琀଀＀￾䌒䌀漀洀瀀漀渀攀渀琀䈀攀栀愀瘀椀漀爀Ԁ＀￾䌔䌀漀洀瀀漀渀攀渀琀䐀攀昀椀渀椀琀椀漀渀਀＀￾䌒䌀漀洀瀀漀渀攀渀琀䤀渀猀琀愀渀挀攀Ѐ＀￾䌕䌀漀渀猀琀爀甀挀琀椀漀渀䜀攀漀洀攀琀爀礀＀￾䌑䌀漀渀猀琀爀甀挀琀椀漀渀䰀椀渀攀Ā＀￾䌒䌀漀渀猀琀爀甀挀琀椀漀渀倀漀椀渀琀＀￾䌆䌀甀爀瘀攀Ѐ＀￾䌏䐀攀昀椀渀椀琀椀漀渀䰀椀猀琀＀￾䌄䐀椀戀̀＀￾䌊䐀椀洀攀渀猀椀漀渀Ā＀￾䌐䐀椀洀攀渀猀椀漀渀䰀椀渀攀愀爀؀＀￾䌐䐀椀洀攀渀猀椀漀渀刀愀搀椀愀氀Ȁ＀￾䌏䐀椀洀攀渀猀椀漀渀匀琀礀氀攀Ѐ＀￾䌏䐀爀愀眀椀渀最䔀氀攀洀攀渀琀ऀ＀￾䌅䔀搀最攀Ȁ＀￾䌈䔀搀最攀唀猀攀Ā＀￾䌇䔀渀琀椀琀礀̀＀￾䌅䘀愀挀攀̀＀￾䌒䘀愀挀攀吀攀砀琀甀爀攀䌀漀漀爀搀猀Ѐ＀￾䌌䘀漀渀琀䴀愀渀愀最攀爀＀￾䌆䜀爀漀甀瀀Ā＀￾䌆䤀洀愀最攀Ā＀￾䌆䰀愀礀攀爀Ȁ＀￾䌍䰀愀礀攀爀䴀愀渀愀最攀爀Ѐ＀￾䌅䰀漀漀瀀Ā＀￾䌉䴀愀琀攀爀椀愀氀ఀ＀￾䌐䴀愀琀攀爀椀愀氀䴀愀渀愀最攀爀Ѐ＀￾䌉倀愀最攀䰀椀猀琀Ā＀￾䌋倀漀氀礀氀椀渀攀㌀搀＀￾䌍刀攀氀愀琀椀漀渀猀栀椀瀀＀￾䌐刀攀氀愀琀椀漀渀猀栀椀瀀䴀愀瀀＀￾䌑刀攀渀搀攀爀椀渀最伀瀀琀椀漀渀猀␀＀￾䌍匀攀挀琀椀漀渀倀氀愀渀攀Ȁ＀￾䌋匀栀愀搀漀眀䤀渀昀漀܀＀￾䌇匀欀䘀漀渀琀Ā＀￾䌉匀欀攀琀挀栀䌀匀＀￾䌎匀欀攀琀挀栀唀瀀䴀漀搀攀氀ᘀ＀￾䌍匀欀攀琀挀栀唀瀀倀愀最攀Ā＀￾䌉匀欀瀀匀琀礀氀攀Ā＀￾䌐匀欀瀀匀琀礀氀攀䴀愀渀愀最攀爀Ȁ＀￾䌅吀攀砀琀ऀ＀￾䌊吀攀砀琀匀琀礀氀攀Ԁ＀￾䌈吀攀砀琀甀爀攀؀＀￾䌊吀栀甀洀戀渀愀椀氀Ā＀￾䌇嘀攀爀琀攀砀＀￾䌉嘀椀攀眀倀愀最攀ఀ＀￾䌊圀愀琀攀爀洀愀爀欀Ā＀￾䌑圀愀琀攀爀洀愀爀欀䴀愀渀愀最攀爀Ȁ＀￾䔒渀搀ⴀ伀昀ⴀ嘀攀爀猀椀漀渀ⴀ䴀愀瀀Ȁ뀀Ā＀ϿЀ䌀楄Ѣ阀 褀乐േᨊ B໿SketchUp Model૿{8.0.3161}䪯鷘Hᭇ亾胳튪弣ÿ璆䳺￿ 噃牥楳湯慍ー￾䌉䄀爀挀䌀甀爀瘀攀Ā＀￾䌊䄀琀琀爀椀戀甀琀攀＀￾䌓䄀琀琀爀椀戀甀琀攀䌀漀渀琀愀椀渀攀爀＀￾䌏䄀琀琀爀椀戀甀琀攀一愀洀攀搀Ā＀￾䌐䈀愀挀欀最爀漀甀渀搀䤀洀愀最攀਀＀￾䌇䌀愀洀攀爀愀Ԁ＀￾䌊䌀漀洀瀀漀渀攀渀琀଀＀￾䌒䌀漀洀瀀漀渀攀渀琀䈀攀栀愀瘀椀漀爀Ԁ＀￾䌔䌀漀洀瀀漀渀攀渀琀䐀攀昀椀渀椀琀椀漀渀਀＀￾䌒䌀漀洀瀀漀渀攀渀琀䤀渀猀琀愀渀挀攀Ѐ＀￾䌕䌀漀渀猀琀爀甀挀琀椀漀渀䜀攀漀洀攀琀爀礀＀￾䌑䌀漀渀猀琀爀甀挀琀椀漀渀䰀椀渀攀Ā＀￾䌒䌀漀渀猀琀爀甀挀琀椀漀渀倀漀椀渀琀＀￾䌆䌀甀爀瘀攀Ѐ＀￾䌏䐀攀昀椀渀椀琀椀漀渀䰀椀猀琀＀￾䌄䐀椀戀̀＀￾䌊䐀椀洀攀渀猀椀漀渀Ā＀￾䌐䐀椀洀攀渀猀椀漀渀䰀椀渀攀愀爀؀＀￾䌐䐀椀洀攀渀猀椀漀渀刀愀搀椀愀氀Ȁ＀￾䌏䐀椀洀攀渀猀椀漀渀匀琀礀氀攀Ѐ＀￾䌏䐀爀愀眀椀渀最䔀氀攀洀攀渀琀ऀ＀￾䌅䔀搀最攀Ȁ＀￾䌈䔀搀最攀唀猀攀Ā＀￾䌇䔀渀琀椀琀礀̀＀￾䌅䘀愀挀攀̀＀￾䌒䘀愀挀攀吀攀砀琀甀爀攀䌀漀漀爀搀猀Ѐ＀￾䌌䘀漀渀琀䴀愀渀愀最攀爀＀￾䌆䜀爀漀甀瀀Ā＀￾䌆䤀洀愀最攀Ā＀￾䌆䰀愀礀攀爀Ȁ＀￾䌍䰀愀礀攀爀䴀愀渀愀最攀爀Ѐ＀￾䌅䰀漀漀瀀Ā＀￾䌉䴀愀琀攀爀椀愀氀ఀ＀￾䌐䴀愀琀攀爀椀愀氀䴀愀渀愀最攀爀Ѐ＀￾䌉倀愀最攀䰀椀猀琀Ā＀￾䌋倀漀氀礀氀椀渀攀㌀搀＀￾䌍刀攀氀愀琀椀漀渀猀栀椀瀀＀￾䌐刀攀氀愀琀椀漀渀猀栀椀瀀䴀愀瀀＀￾䌑刀攀渀搀攀爀椀渀最伀瀀琀椀漀渀猀␀＀￾䌍匀攀挀琀椀漀渀倀氀愀渀攀Ȁ＀￾䌋匀栀愀搀漀眀䤀渀昀漀܀＀￾䌇匀欀䘀漀渀琀Ā＀￾䌉匀欀攀琀挀栀䌀匀＀￾䌎匀欀攀琀挀栀唀瀀䴀漀搀攀氀ᘀ＀￾䌍匀欀攀琀挀栀唀瀀倀愀最攀Ā＀￾䌉匀欀瀀匀琀礀氀攀Ā＀￾䌐匀欀瀀匀琀礀氀攀䴀愀渀愀最攀爀Ȁ＀￾䌅吀攀砀琀ऀ＀￾䌊吀攀砀琀匀琀礀氀攀Ԁ＀￾䌈吀攀砀琀甀爀攀؀＀￾䌊吀栀甀洀戀渀愀椀氀Ā＀￾䌇嘀攀爀琀攀砀＀￾䌉嘀椀攀眀倀愀最攀ఀ＀￾䌊圀愀琀攀爀洀愀爀欀Ā＀￾䌑圀愀琀攀爀洀愀爀欀䴀愀渀愀最攀爀Ȁ＀￾䔒渀搀ⴀ伀昀ⴀ嘀攀爀猀椀漀渀ⴀ䴀愀瀀Ȁ뀀Ā＀ϿЀ䌀楄Ѣ阀 褀乐േᨊ
B໿SketchUp Model૿{8.0.3161}脔뗇밖㍆溃轧Ⳍÿ碐䳺￿ 噃牥楳湯慍ー￾䌉䄀爀挀䌀甀爀瘀攀Ā＀￾䌊䄀琀琀爀椀戀甀琀攀＀￾䌓䄀琀琀爀椀戀甀琀攀䌀漀渀琀愀椀渀攀爀＀￾䌏䄀琀琀爀椀戀甀琀攀一愀洀攀搀Ā＀￾䌐䈀愀挀欀最爀漀甀渀搀䤀洀愀最攀਀＀￾䌇䌀愀洀攀爀愀Ԁ＀￾䌊䌀漀洀瀀漀渀攀渀琀଀＀￾䌒䌀漀洀瀀漀渀攀渀琀䈀攀栀愀瘀椀漀爀Ԁ＀￾䌔䌀漀洀瀀漀渀攀渀琀䐀攀昀椀渀椀琀椀漀渀਀＀￾䌒䌀漀洀瀀漀渀攀渀琀䤀渀猀琀愀渀挀攀Ѐ＀￾䌕䌀漀渀猀琀爀甀挀琀椀漀渀䜀攀漀洀攀琀爀礀＀￾䌑䌀漀渀猀琀爀甀挀琀椀漀渀䰀椀渀攀Ā＀￾䌒䌀漀渀猀琀爀甀挀琀椀漀渀倀漀椀渀琀＀￾䌆䌀甀爀瘀攀Ѐ＀￾䌏䐀攀昀椀渀椀琀椀漀渀䰀椀猀琀＀￾䌄䐀椀戀̀＀￾䌊䐀椀洀攀渀猀椀漀渀Ā＀￾䌐䐀椀洀攀渀猀椀漀渀䰀椀渀攀愀爀؀＀￾䌐䐀椀洀攀渀猀椀漀渀刀愀搀椀愀氀Ȁ＀￾䌏䐀椀洀攀渀猀椀漀渀匀琀礀氀攀Ѐ＀￾䌏䐀爀愀眀椀渀最䔀氀攀洀攀渀琀ऀ＀￾䌅䔀搀最攀Ȁ＀￾䌈䔀搀最攀唀猀攀Ā＀￾䌇䔀渀琀椀琀礀̀＀￾䌅䘀愀挀攀̀＀￾䌒䘀愀挀攀吀攀砀琀甀爀攀䌀漀漀爀搀猀Ѐ＀￾䌌䘀漀渀琀䴀愀渀愀最攀爀＀￾䌆䜀爀漀甀瀀Ā＀￾䌆䤀洀愀最攀Ā＀￾䌆䰀愀礀攀爀Ȁ＀￾䌍䰀愀礀攀爀䴀愀渀愀最攀爀Ѐ＀￾䌅䰀漀漀瀀Ā＀￾䌉䴀愀琀攀爀椀愀氀ఀ＀￾䌐䴀愀琀攀爀椀愀氀䴀愀渀愀最攀爀Ѐ＀￾䌉倀愀最攀䰀椀猀琀Ā＀￾䌋倀漀氀礀氀椀渀攀㌀搀＀￾䌍刀攀氀愀琀椀漀渀猀栀椀瀀＀￾䌐刀攀氀愀琀椀漀渀猀栀椀瀀䴀愀瀀＀￾䌑刀攀渀搀攀爀椀渀最伀瀀琀椀漀渀猀␀＀￾䌍匀攀挀琀椀漀渀倀氀愀渀攀Ȁ＀￾䌋匀栀愀搀漀眀䤀渀昀漀܀＀￾䌇匀欀䘀漀渀琀Ā＀￾䌉匀欀攀琀挀栀䌀匀＀￾䌎匀欀攀琀挀栀唀瀀䴀漀搀攀氀ᘀ＀￾䌍匀欀攀琀挀栀唀瀀倀愀最攀Ā＀￾䌉匀欀瀀匀琀礀氀攀Ā＀￾䌐匀欀瀀匀琀礀氀攀䴀愀渀愀最攀爀Ȁ＀￾䌅吀攀砀琀ऀ＀￾䌊吀攀砀琀匀琀礀氀攀Ԁ＀￾䌈吀攀砀琀甀爀攀؀＀￾䌊吀栀甀洀戀渀愀椀氀Ā＀￾䌇嘀攀爀琀攀砀＀￾䌉嘀椀攀眀倀愀最攀ఀ＀￾䌊圀愀琀攀爀洀愀爀欀Ā＀￾䌑圀愀琀攀爀洀愀爀欀䴀愀渀愀最攀爀Ȁ＀￾䔒渀搀ⴀ伀昀ⴀ嘀攀爀猀椀漀渀ⴀ䴀愀瀀Ȁ뀀Ā＀ϿЀ䌀楄Ѣ쌀褀乐േᨊ B໿SketchUp Model૿{8.0.3161}脔뗇밖㍆溃轧Ⳍÿ碐䳺￿ 噃牥楳湯慍ー￾䌉䄀爀挀䌀甀爀瘀攀Ā＀￾䌊䄀琀琀爀椀戀甀琀攀＀￾䌓䄀琀琀爀椀戀甀琀攀䌀漀渀琀愀椀渀攀爀＀￾䌏䄀琀琀爀椀戀甀琀攀一愀洀攀搀Ā＀￾䌐䈀愀挀欀最爀漀甀渀搀䤀洀愀最攀਀＀￾䌇䌀愀洀攀爀愀Ԁ＀￾䌊䌀漀洀瀀漀渀攀渀琀଀＀￾䌒䌀漀洀瀀漀渀攀渀琀䈀攀栀愀瘀椀漀爀Ԁ＀￾䌔䌀漀洀瀀漀渀攀渀琀䐀攀昀椀渀椀琀椀漀渀਀＀￾䌒䌀漀洀瀀漀渀攀渀琀䤀渀猀琀愀渀挀攀Ѐ＀￾䌕䌀漀渀猀琀爀甀挀琀椀漀渀䜀攀漀洀攀琀爀礀＀￾䌑䌀漀渀猀琀爀甀挀琀椀漀渀䰀椀渀攀Ā＀￾䌒䌀漀渀猀琀爀甀挀琀椀漀渀倀漀椀渀琀＀￾䌆䌀甀爀瘀攀Ѐ＀￾䌏䐀攀昀椀渀椀琀椀漀渀䰀椀猀琀＀￾䌄䐀椀戀̀＀￾䌊䐀椀洀攀渀猀椀漀渀Ā＀￾䌐䐀椀洀攀渀猀椀漀渀䰀椀渀攀愀爀؀＀￾䌐䐀椀洀攀渀猀椀漀渀刀愀搀椀愀氀Ȁ＀￾䌏䐀椀洀攀渀猀椀漀渀匀琀礀氀攀Ѐ＀￾䌏䐀爀愀眀椀渀最䔀氀攀洀攀渀琀ऀ＀￾䌅䔀搀最攀Ȁ＀￾䌈䔀搀最攀唀猀攀Ā＀￾䌇䔀渀琀椀琀礀̀＀￾䌅䘀愀挀攀̀＀￾䌒䘀愀挀攀吀攀砀琀甀爀攀䌀漀漀爀搀猀Ѐ＀￾䌌䘀漀渀琀䴀愀渀愀最攀爀＀￾䌆䜀爀漀甀瀀Ā＀￾䌆䤀洀愀最攀Ā＀￾䌆䰀愀礀攀爀Ȁ＀￾䌍䰀愀礀攀爀䴀愀渀愀最攀爀Ѐ＀￾䌅䰀漀漀瀀Ā＀￾䌉䴀愀琀攀爀椀愀氀ఀ＀￾䌐䴀愀琀攀爀椀愀氀䴀愀渀愀最攀爀Ѐ＀￾䌉倀愀最攀䰀椀猀琀Ā＀￾䌋倀漀氀礀氀椀渀攀㌀搀＀￾䌍刀攀氀愀琀椀漀渀猀栀椀瀀＀￾䌐刀攀氀愀琀椀漀渀猀栀椀瀀䴀愀瀀＀￾䌑刀攀渀搀攀爀椀渀最伀瀀琀椀漀渀猀␀＀￾䌍匀攀挀琀椀漀渀倀氀愀渀攀Ȁ＀￾䌋匀栀愀搀漀眀䤀渀昀漀܀＀￾䌇匀欀䘀漀渀琀Ā＀￾䌉匀欀攀琀挀栀䌀匀＀￾䌎匀欀攀琀挀栀唀瀀䴀漀搀攀氀ᘀ＀￾䌍匀欀攀琀挀栀唀瀀倀愀最攀Ā＀￾䌉匀欀瀀匀琀礀氀攀Ā＀￾䌐匀欀瀀匀琀礀氀攀䴀愀渀愀最攀爀Ȁ＀￾䌅吀攀砀琀ऀ＀￾䌊吀攀砀琀匀琀礀氀攀Ԁ＀￾䌈吀攀砀琀甀爀攀؀＀￾䌊吀栀甀洀戀渀愀椀氀Ā＀￾䌇嘀攀爀琀攀砀＀￾䌉嘀椀攀眀倀愀最攀ఀ＀￾䌊圀愀琀攀爀洀愀爀欀Ā＀￾䌑圀愀琀攀爀洀愀爀欀䴀愀渀愀最攀爀Ȁ＀￾䔒渀搀ⴀ伀昀ⴀ嘀攀爀猀椀漀渀ⴀ䴀愀瀀Ȁ뀀Ā＀ϿЀ䌀楄Ѣ쌀褀乐േᨊ
B໿SketchUp Model૿{8.0.3161}횀팾뚥罁㞸켭᩼㳚ÿ筋䳺￿ 噃牥楳湯慍ー￾䌉䄀爀挀䌀甀爀瘀攀Ā＀￾䌊䄀琀琀爀椀戀甀琀攀＀￾䌓䄀琀琀爀椀戀甀琀攀䌀漀渀琀愀椀渀攀爀＀￾䌏䄀琀琀爀椀戀甀琀攀一愀洀攀搀Ā＀￾䌐䈀愀挀欀最爀漀甀渀搀䤀洀愀最攀਀＀￾䌇䌀愀洀攀爀愀Ԁ＀￾䌊䌀漀洀瀀漀渀攀渀琀଀＀￾䌒䌀漀洀瀀漀渀攀渀琀䈀攀栀愀瘀椀漀爀Ԁ＀￾䌔䌀漀洀瀀漀渀攀渀琀䐀攀昀椀渀椀琀椀漀渀਀＀￾䌒䌀漀洀瀀漀渀攀渀琀䤀渀猀琀愀渀挀攀Ѐ＀￾䌕䌀漀渀猀琀爀甀挀琀椀漀渀䜀攀漀洀攀琀爀礀＀￾䌑䌀漀渀猀琀爀甀挀琀椀漀渀䰀椀渀攀Ā＀￾䌒䌀漀渀猀琀爀甀挀琀椀漀渀倀漀椀渀琀＀￾䌆䌀甀爀瘀攀Ѐ＀￾䌏䐀攀昀椀渀椀琀椀漀渀䰀椀猀琀＀￾䌄䐀椀戀̀＀￾䌊䐀椀洀攀渀猀椀漀渀Ā＀￾䌐䐀椀洀攀渀猀椀漀渀䰀椀渀攀愀爀؀＀￾䌐䐀椀洀攀渀猀椀漀渀刀愀搀椀愀氀Ȁ＀￾䌏䐀椀洀攀渀猀椀漀渀匀琀礀氀攀Ѐ＀￾䌏䐀爀愀眀椀渀最䔀氀攀洀攀渀琀ऀ＀￾䌅䔀搀最攀Ȁ＀￾䌈䔀搀最攀唀猀攀Ā＀￾䌇䔀渀琀椀琀礀̀＀￾䌅䘀愀挀攀̀＀￾䌒䘀愀挀攀吀攀砀琀甀爀攀䌀漀漀爀搀猀Ѐ＀￾䌌䘀漀渀琀䴀愀渀愀最攀爀＀￾䌆䜀爀漀甀瀀Ā＀￾䌆䤀洀愀最攀Ā＀￾䌆䰀愀礀攀爀Ȁ＀￾䌍䰀愀礀攀爀䴀愀渀愀最攀爀Ѐ＀￾䌅䰀漀漀瀀Ā＀￾䌉䴀愀琀攀爀椀愀氀ఀ＀￾䌐䴀愀琀攀爀椀愀氀䴀愀渀愀最攀爀Ѐ＀￾䌉倀愀最攀䰀椀猀琀Ā＀￾䌋倀漀氀礀氀椀渀攀㌀搀＀￾䌍刀攀氀愀琀椀漀渀猀栀椀瀀＀￾䌐刀攀氀愀琀椀漀渀猀栀椀瀀䴀愀瀀＀￾䌑刀攀渀搀攀爀椀渀最伀瀀琀椀漀渀猀␀＀￾䌍匀攀挀琀椀漀渀倀氀愀渀攀Ȁ＀￾䌋匀栀愀搀漀眀䤀渀昀漀܀＀￾䌇匀欀䘀漀渀琀Ā＀￾䌉匀欀攀琀挀栀䌀匀＀￾䌎匀欀攀琀挀栀唀瀀䴀漀搀攀氀ᘀ＀￾䌍匀欀攀琀挀栀唀瀀倀愀最攀Ā＀￾䌉匀欀瀀匀琀礀氀攀Ā＀￾䌐匀欀瀀匀琀礀氀攀䴀愀渀愀最攀爀Ȁ＀￾䌅吀攀砀琀ऀ＀￾䌊吀攀砀琀匀琀礀氀攀Ԁ＀￾䌈吀攀砀琀甀爀攀؀＀￾䌊吀栀甀洀戀渀愀椀氀Ā＀￾䌇嘀攀爀琀攀砀＀￾䌉嘀椀攀眀倀愀最攀ఀ＀￾䌊圀愀琀攀爀洀愀爀欀Ā＀￾䌑圀愀琀攀爀洀愀爀欀䴀愀渀愀最攀爀Ȁ＀￾䔒渀搀ⴀ伀昀ⴀ嘀攀爀猀椀漀渀ⴀ䴀愀瀀Ȁ뀀Ā＀ϿЀ䌀楄Ѣ㴀褀乐േᨊ B໿SketchUp Model૿{8.0.3161}횀팾뚥罁㞸켭᩼㳚ÿ筋䳺￿ 噃牥楳湯慍ー￾䌉䄀爀挀䌀甀爀瘀攀Ā＀￾䌊䄀琀琀爀椀戀甀琀攀＀￾䌓䄀琀琀爀椀戀甀琀攀䌀漀渀琀愀椀渀攀爀＀￾䌏䄀琀琀爀椀戀甀琀攀一愀洀攀搀Ā＀￾䌐䈀愀挀欀最爀漀甀渀搀䤀洀愀最攀਀＀￾䌇䌀愀洀攀爀愀Ԁ＀￾䌊䌀漀洀瀀漀渀攀渀琀଀＀￾䌒䌀漀洀瀀漀渀攀渀琀䈀攀栀愀瘀椀漀爀Ԁ＀￾䌔䌀漀洀瀀漀渀攀渀琀䐀攀昀椀渀椀琀椀漀渀਀＀￾䌒䌀漀洀瀀漀渀攀渀琀䤀渀猀琀愀渀挀攀Ѐ＀￾䌕䌀漀渀猀琀爀甀挀琀椀漀渀䜀攀漀洀攀琀爀礀＀￾䌑䌀漀渀猀琀爀甀挀琀椀漀渀䰀椀渀攀Ā＀￾䌒䌀漀渀猀琀爀甀挀琀椀漀渀倀漀椀渀琀＀￾䌆䌀甀爀瘀攀Ѐ＀￾䌏䐀攀昀椀渀椀琀椀漀渀䰀椀猀琀＀￾䌄䐀椀戀̀＀￾䌊䐀椀洀攀渀猀椀漀渀Ā＀￾䌐䐀椀洀攀渀猀椀漀渀䰀椀渀攀愀爀؀＀￾䌐䐀椀洀攀渀猀椀漀渀刀愀搀椀愀氀Ȁ＀￾䌏䐀椀洀攀渀猀椀漀渀匀琀礀氀攀Ѐ＀￾䌏䐀爀愀眀椀渀最䔀氀攀洀攀渀琀ऀ＀￾䌅䔀搀最攀Ȁ＀￾䌈䔀搀最攀唀猀攀Ā＀￾䌇䔀渀琀椀琀礀̀＀￾䌅䘀愀挀攀̀＀￾䌒䘀愀挀攀吀攀砀琀甀爀攀䌀漀漀爀搀猀Ѐ＀￾䌌䘀漀渀琀䴀愀渀愀最攀爀＀￾䌆䜀爀漀甀瀀Ā＀￾䌆䤀洀愀最攀Ā＀￾䌆䰀愀礀攀爀Ȁ＀￾䌍䰀愀礀攀爀䴀愀渀愀最攀爀Ѐ＀￾䌅䰀漀漀瀀Ā＀￾䌉䴀愀琀攀爀椀愀氀ఀ＀￾䌐䴀愀琀攀爀椀愀氀䴀愀渀愀最攀爀Ѐ＀￾䌉倀愀最攀䰀椀猀琀Ā＀￾䌋倀漀氀礀氀椀渀攀㌀搀＀￾䌍刀攀氀愀琀椀漀渀猀栀椀瀀＀￾䌐刀攀氀愀琀椀漀渀猀栀椀瀀䴀愀瀀＀￾䌑刀攀渀搀攀爀椀渀最伀瀀琀椀漀渀猀␀＀￾䌍匀攀挀琀椀漀渀倀氀愀渀攀Ȁ＀￾䌋匀栀愀搀漀眀䤀渀昀漀܀＀￾䌇匀欀䘀漀渀琀Ā＀￾䌉匀欀攀琀挀栀䌀匀＀￾䌎匀欀攀琀挀栀唀瀀䴀漀搀攀氀ᘀ＀￾䌍匀欀攀琀挀栀唀瀀倀愀最攀Ā＀￾䌉匀欀瀀匀琀礀氀攀Ā＀￾䌐匀欀瀀匀琀礀氀攀䴀愀渀愀最攀爀Ȁ＀￾䌅吀攀砀琀ऀ＀￾䌊吀攀砀琀匀琀礀氀攀Ԁ＀￾䌈吀攀砀琀甀爀攀؀＀￾䌊吀栀甀洀戀渀愀椀氀Ā＀￾䌇嘀攀爀琀攀砀＀￾䌉嘀椀攀眀倀愀最攀ఀ＀￾䌊圀愀琀攀爀洀愀爀欀Ā＀￾䌑圀愀琀攀爀洀愀爀欀䴀愀渀愀最攀爀Ȁ＀￾䔒渀搀ⴀ伀昀ⴀ嘀攀爀猀椀漀渀ⴀ䴀愀瀀Ȁ뀀Ā＀ϿЀ䌀楄Ѣ㴀褀乐േᨊ
B໿SketchUp Model૿{8.0.3161}賥ₓ蹆ힲꪅ쳐棒ÿ瘢䳺￿ 噃牥楳湯慍ー￾䌉䄀爀挀䌀甀爀瘀攀Ā＀￾䌊䄀琀琀爀椀戀甀琀攀＀￾䌓䄀琀琀爀椀戀甀琀攀䌀漀渀琀愀椀渀攀爀＀￾䌏䄀琀琀爀椀戀甀琀攀一愀洀攀搀Ā＀￾䌐䈀愀挀欀最爀漀甀渀搀䤀洀愀最攀਀＀￾䌇䌀愀洀攀爀愀Ԁ＀￾䌊䌀漀洀瀀漀渀攀渀琀଀＀￾䌒䌀漀洀瀀漀渀攀渀琀䈀攀栀愀瘀椀漀爀Ԁ＀￾䌔䌀漀洀瀀漀渀攀渀琀䐀攀昀椀渀椀琀椀漀渀਀＀￾䌒䌀漀洀瀀漀渀攀渀琀䤀渀猀琀愀渀挀攀Ѐ＀￾䌕䌀漀渀猀琀爀甀挀琀椀漀渀䜀攀漀洀攀琀爀礀＀￾䌑䌀漀渀猀琀爀甀挀琀椀漀渀䰀椀渀攀Ā＀￾䌒䌀漀渀猀琀爀甀挀琀椀漀渀倀漀椀渀琀＀￾䌆䌀甀爀瘀攀Ѐ＀￾䌏䐀攀昀椀渀椀琀椀漀渀䰀椀猀琀＀￾䌄䐀椀戀̀＀￾䌊䐀椀洀攀渀猀椀漀渀Ā＀￾䌐䐀椀洀攀渀猀椀漀渀䰀椀渀攀愀爀؀＀￾䌐䐀椀洀攀渀猀椀漀渀刀愀搀椀愀氀Ȁ＀￾䌏䐀椀洀攀渀猀椀漀渀匀琀礀氀攀Ѐ＀￾䌏䐀爀愀眀椀渀最䔀氀攀洀攀渀琀ऀ＀￾䌅䔀搀最攀Ȁ＀￾䌈䔀搀最攀唀猀攀Ā＀￾䌇䔀渀琀椀琀礀̀＀￾䌅䘀愀挀攀̀＀￾䌒䘀愀挀攀吀攀砀琀甀爀攀䌀漀漀爀搀猀Ѐ＀￾䌌䘀漀渀琀䴀愀渀愀最攀爀＀￾䌆䜀爀漀甀瀀Ā＀￾䌆䤀洀愀最攀Ā＀￾䌆䰀愀礀攀爀Ȁ＀￾䌍䰀愀礀攀爀䴀愀渀愀最攀爀Ѐ＀￾䌅䰀漀漀瀀Ā＀￾䌉䴀愀琀攀爀椀愀氀ఀ＀￾䌐䴀愀琀攀爀椀愀氀䴀愀渀愀最攀爀Ѐ＀￾䌉倀愀最攀䰀椀猀琀Ā＀￾䌋倀漀氀礀氀椀渀攀㌀搀＀￾䌍刀攀氀愀琀椀漀渀猀栀椀瀀＀￾䌐刀攀氀愀琀椀漀渀猀栀椀瀀䴀愀瀀＀￾䌑刀攀渀搀攀爀椀渀最伀瀀琀椀漀渀猀␀＀￾䌍匀攀挀琀椀漀渀倀氀愀渀攀Ȁ＀￾䌋匀栀愀搀漀眀䤀渀昀漀܀＀￾䌇匀欀䘀漀渀琀Ā＀￾䌉匀欀攀琀挀栀䌀匀＀￾䌎匀欀攀琀挀栀唀瀀䴀漀搀攀氀ᘀ＀￾䌍匀欀攀琀挀栀唀瀀倀愀最攀Ā＀￾䌉匀欀瀀匀琀礀氀攀Ā＀￾䌐匀欀瀀匀琀礀氀攀䴀愀渀愀最攀爀Ȁ＀￾䌅吀攀砀琀ऀ＀￾䌊吀攀砀琀匀琀礀氀攀Ԁ＀￾䌈吀攀砀琀甀爀攀؀＀￾䌊吀栀甀洀戀渀愀椀氀Ā＀￾䌇嘀攀爀琀攀砀＀￾䌉嘀椀攀眀倀愀最攀ఀ＀￾䌊圀愀琀攀爀洀愀爀欀Ā＀￾䌑圀愀琀攀爀洀愀爀欀䴀愀渀愀最攀爀Ȁ＀￾䔒渀搀ⴀ伀昀ⴀ嘀攀爀猀椀漀渀ⴀ䴀愀瀀Ȁ뀀Ā＀ϿЀ䌀楄Ѣ B໿SketchUp Model૿{8.0.3161}賥ₓ蹆ힲꪅ쳐棒ÿ瘢䳺￿ 噃牥楳湯慍ー￾䌉䄀爀挀䌀甀爀瘀攀Ā＀￾䌊䄀琀琀爀椀戀甀琀攀＀￾䌓䄀琀琀爀椀戀甀琀攀䌀漀渀琀愀椀渀攀爀＀￾䌏䄀琀琀爀椀戀甀琀攀一愀洀攀搀Ā＀￾䌐䈀愀挀欀最爀漀甀渀搀䤀洀愀最攀਀＀￾䌇䌀愀洀攀爀愀Ԁ＀￾䌊䌀漀洀瀀漀渀攀渀琀଀＀￾䌒䌀漀洀瀀漀渀攀渀琀䈀攀栀愀瘀椀漀爀Ԁ＀￾䌔䌀漀洀瀀漀渀攀渀琀䐀攀昀椀渀椀琀椀漀渀਀＀￾䌒䌀漀洀瀀漀渀攀渀琀䤀渀猀琀愀渀挀攀Ѐ＀￾䌕䌀漀渀猀琀爀甀挀琀椀漀渀䜀攀漀洀攀琀爀礀＀￾䌑䌀漀渀猀琀爀甀挀琀椀漀渀䰀椀渀攀Ā＀￾䌒䌀漀渀猀琀爀甀挀琀椀漀渀倀漀椀渀琀＀￾䌆䌀甀爀瘀攀Ѐ＀￾䌏䐀攀昀椀渀椀琀椀漀渀䰀椀猀琀＀￾䌄䐀椀戀̀＀￾䌊䐀椀洀攀渀猀椀漀渀Ā＀￾䌐䐀椀洀攀渀猀椀漀渀䰀椀渀攀愀爀؀＀￾䌐䐀椀洀攀渀猀椀漀渀刀愀搀椀愀氀Ȁ＀￾䌏䐀椀洀攀渀猀椀漀渀匀琀礀氀攀Ѐ＀￾䌏䐀爀愀眀椀渀最䔀氀攀洀攀渀琀ऀ＀￾䌅䔀搀最攀Ȁ＀￾䌈䔀搀最攀唀猀攀Ā＀￾䌇䔀渀琀椀琀礀̀＀￾䌅䘀愀挀攀̀＀￾䌒䘀愀挀攀吀攀砀琀甀爀攀䌀漀漀爀搀猀Ѐ＀￾䌌䘀漀渀琀䴀愀渀愀最攀爀＀￾䌆䜀爀漀甀瀀Ā＀￾䌆䤀洀愀最攀Ā＀￾䌆䰀愀礀攀爀Ȁ＀￾䌍䰀愀礀攀爀䴀愀渀愀最攀爀Ѐ＀￾䌅䰀漀漀瀀Ā＀￾䌉䴀愀琀攀爀椀愀氀ఀ＀￾䌐䴀愀琀攀爀椀愀氀䴀愀渀愀最攀爀Ѐ＀￾䌉倀愀最攀䰀椀猀琀Ā＀￾䌋倀漀氀礀氀椀渀攀㌀搀＀￾䌍刀攀氀愀琀椀漀渀猀栀椀瀀＀￾䌐刀攀氀愀琀椀漀渀猀栀椀瀀䴀愀瀀＀￾䌑刀攀渀搀攀爀椀渀最伀瀀琀椀漀渀猀␀＀￾䌍匀攀挀琀椀漀渀倀氀愀渀攀Ȁ＀￾䌋匀栀愀搀漀眀䤀渀昀漀܀＀￾䌇匀欀䘀漀渀琀Ā＀￾䌉匀欀攀琀挀栀䌀匀＀￾䌎匀欀攀琀挀栀唀瀀䴀漀搀攀氀ᘀ＀￾䌍匀欀攀琀挀栀唀瀀倀愀最攀Ā＀￾䌉匀欀瀀匀琀礀氀攀Ā＀￾䌐匀欀瀀匀琀礀氀攀䴀愀渀愀最攀爀Ȁ＀￾䌅吀攀砀琀ऀ＀￾䌊吀攀砀琀匀琀礀氀攀Ԁ＀￾䌈吀攀砀琀甀爀攀؀＀￾䌊吀栀甀洀戀渀愀椀氀Ā＀￾䌇嘀攀爀琀攀砀＀￾䌉嘀椀攀眀倀愀最攀ఀ＀￾䌊圀愀琀攀爀洀愀爀欀Ā＀￾䌑圀愀琀攀爀洀愀爀欀䴀愀渀愀最攀爀Ȁ＀￾䔒渀搀ⴀ伀昀ⴀ嘀攀爀猀椀漀渀ⴀ䴀愀瀀Ȁ뀀Ā＀ϿЀ䌀楄Ѣ
...@@ -80,6 +80,8 @@ macx { ...@@ -80,6 +80,8 @@ macx {
QMAKE_PRE_LINK += && cp -rf $$BASEDIR/audio $$DESTDIR/qgroundcontrol.app/Contents/MacOs/. QMAKE_PRE_LINK += && cp -rf $$BASEDIR/audio $$DESTDIR/qgroundcontrol.app/Contents/MacOs/.
# Copy google earth starter file # Copy google earth starter file
QMAKE_PRE_LINK += && cp -f $$BASEDIR/images/earth.html $$DESTDIR/qgroundcontrol.app/Contents/MacOs/. QMAKE_PRE_LINK += && cp -f $$BASEDIR/images/earth.html $$DESTDIR/qgroundcontrol.app/Contents/MacOs/.
# Copy model files
QMAKE_PRE_LINK += && cp -f $$BASEDIR/models/*.skp $$DESTDIR/qgroundcontrol.app/Contents/MacOs/.
exists(/Library/Frameworks/osg.framework):exists(/Library/Frameworks/OpenThreads.framework) { exists(/Library/Frameworks/osg.framework):exists(/Library/Frameworks/OpenThreads.framework) {
# No check for GLUT.framework since it's a MAC default # No check for GLUT.framework since it's a MAC default
...@@ -278,6 +280,8 @@ win32-msvc2008 { ...@@ -278,6 +280,8 @@ win32-msvc2008 {
message(Building for Windows Visual Studio 2008 (32bit)) message(Building for Windows Visual Studio 2008 (32bit))
CONFIG += qaxcontainer
# Special settings for debug # Special settings for debug
#CONFIG += CONSOLE #CONFIG += CONSOLE
......
...@@ -141,7 +141,9 @@ FORMS += src/ui/MainWindow.ui \ ...@@ -141,7 +141,9 @@ FORMS += src/ui/MainWindow.ui \
src/ui/QGCRemoteControlView.ui \ src/ui/QGCRemoteControlView.ui \
src/ui/QMap3D.ui \ src/ui/QMap3D.ui \
src/ui/QGCWebView.ui \ src/ui/QGCWebView.ui \
src/ui/map3D/QGCGoogleEarthView.ui src/ui/map3D/QGCGoogleEarthView.ui \
src/ui/map3D/QGCGoogleEarthViewWin.ui \
src/ui/map3D/QGCGoogleEarthControls.ui
# src/ui/WaypointGlobalView.ui # src/ui/WaypointGlobalView.ui
INCLUDEPATH += src \ INCLUDEPATH += src \
...@@ -234,8 +236,8 @@ HEADERS += src/MG.h \ ...@@ -234,8 +236,8 @@ HEADERS += src/MG.h \
src/ui/RadioCalibration/AbstractCalibrator.h \ src/ui/RadioCalibration/AbstractCalibrator.h \
src/comm/QGCMAVLink.h \ src/comm/QGCMAVLink.h \
src/ui/QGCWebView.h \ src/ui/QGCWebView.h \
src/ui/map3D/QGCGoogleEarthView.h src/ui/map3D/QGCGoogleEarthView.h \
src/ui/map3D/QGCWebPage.h
contains(DEPENDENCIES_PRESENT, osg) { contains(DEPENDENCIES_PRESENT, osg) {
message("Including headers for OpenSceneGraph") message("Including headers for OpenSceneGraph")
...@@ -252,7 +254,8 @@ contains(DEPENDENCIES_PRESENT, osg) { ...@@ -252,7 +254,8 @@ contains(DEPENDENCIES_PRESENT, osg) {
src/ui/map3D/WebImage.h \ src/ui/map3D/WebImage.h \
src/ui/map3D/TextureCache.h \ src/ui/map3D/TextureCache.h \
src/ui/map3D/Texture.h \ src/ui/map3D/Texture.h \
src/ui/map3D/Imagery.h src/ui/map3D/Imagery.h \
src/ui/map3D/HUDScaleGeode.h
contains(DEPENDENCIES_PRESENT, osgearth) { contains(DEPENDENCIES_PRESENT, osgearth) {
message("Including headers for OSGEARTH") message("Including headers for OSGEARTH")
...@@ -336,7 +339,8 @@ SOURCES += src/main.cc \ ...@@ -336,7 +339,8 @@ SOURCES += src/main.cc \
src/ui/RadioCalibration/AbstractCalibrator.cc \ src/ui/RadioCalibration/AbstractCalibrator.cc \
src/ui/RadioCalibration/RadioCalibrationData.cc \ src/ui/RadioCalibration/RadioCalibrationData.cc \
src/ui/QGCWebView.cc \ src/ui/QGCWebView.cc \
src/ui/map3D/QGCGoogleEarthView.cc src/ui/map3D/QGCGoogleEarthView.cc \
src/ui/map3D/QGCWebPage.cc
contains(DEPENDENCIES_PRESENT, osg) { contains(DEPENDENCIES_PRESENT, osg) {
message("Including sources for OpenSceneGraph") message("Including sources for OpenSceneGraph")
...@@ -352,7 +356,8 @@ contains(DEPENDENCIES_PRESENT, osg) { ...@@ -352,7 +356,8 @@ contains(DEPENDENCIES_PRESENT, osg) {
src/ui/map3D/WebImage.cc \ src/ui/map3D/WebImage.cc \
src/ui/map3D/TextureCache.cc \ src/ui/map3D/TextureCache.cc \
src/ui/map3D/Texture.cc \ src/ui/map3D/Texture.cc \
src/ui/map3D/Imagery.cc src/ui/map3D/Imagery.cc \
src/ui/map3D/HUDScaleGeode.cc
contains(DEPENDENCIES_PRESENT, osgearth) { contains(DEPENDENCIES_PRESENT, osgearth) {
message("Including sources for osgEarth") message("Including sources for osgEarth")
......
...@@ -99,12 +99,6 @@ MAVLinkSimulationLink::MAVLinkSimulationLink(QString readFile, QString writeFile ...@@ -99,12 +99,6 @@ MAVLinkSimulationLink::MAVLinkSimulationLink(QString readFile, QString writeFile
// Open packet log // Open packet log
mavlinkLogFile = new QFile(MAVLinkProtocol::getLogfileName()); mavlinkLogFile = new QFile(MAVLinkProtocol::getLogfileName());
mavlinkLogFile->open(QIODevice::ReadOnly); mavlinkLogFile->open(QIODevice::ReadOnly);
// position at Pixhawk lab @ ETHZ
x = 5247273.0f;
y = 465955.0f;
z = -0.2f;
yaw = 0;
} }
MAVLinkSimulationLink::~MAVLinkSimulationLink() MAVLinkSimulationLink::~MAVLinkSimulationLink()
...@@ -383,15 +377,14 @@ void MAVLinkSimulationLink::mainloop() ...@@ -383,15 +377,14 @@ void MAVLinkSimulationLink::mainloop()
x = x*0.93f + 0.07f*(x+sin(static_cast<float>(QGC::groundTimeUsecs()) * 0.08f)); x = x*0.93f + 0.07f*(x+sin(static_cast<float>(QGC::groundTimeUsecs()) * 0.08f));
y = y*0.93f + 0.07f*(y+sin(static_cast<float>(QGC::groundTimeUsecs()) * 0.5f)); y = y*0.93f + 0.07f*(y+sin(static_cast<float>(QGC::groundTimeUsecs()) * 0.5f));
z = z*0.93f + 0.07f*(z+sin(static_cast<float>(QGC::groundTimeUsecs()*0.001f)) * 0.1f); z = z*0.93f + 0.07f*(z+sin(static_cast<float>(QGC::groundTimeUsecs()*0.001f)) * 0.1f);
x = 5247273.0f;
y = 465955.0f; x = (x > 5.0f) ? 5.0f : x;
// x = (x > 5.0f) ? 5.0f : x; y = (y > 5.0f) ? 5.0f : y;
// y = (y > 5.0f) ? 5.0f : y; z = (z > 3.0f) ? 3.0f : z;
// z = (z > 3.0f) ? 3.0f : z;
// x = (x < -5.0f) ? -5.0f : x;
// x = (x < -5.0f) ? -5.0f : x; y = (y < -5.0f) ? -5.0f : y;
// y = (y < -5.0f) ? -5.0f : y; z = (z < -3.0f) ? -3.0f : z;
// z = (z < -3.0f) ? -3.0f : z;
// Send back new setpoint // Send back new setpoint
mavlink_message_t ret; mavlink_message_t ret;
...@@ -409,14 +402,14 @@ void MAVLinkSimulationLink::mainloop() ...@@ -409,14 +402,14 @@ void MAVLinkSimulationLink::mainloop()
streampointer += bufferlength; streampointer += bufferlength;
// GPS RAW // GPS RAW
mavlink_msg_gps_raw_pack(systemId, componentId, &ret, 0, 3, 47.376417+(x*0.001), 8.548103+(y*0.001), z, 0, 0, 2.5f, 0.1f); mavlink_msg_gps_raw_pack(systemId, componentId, &ret, 0, 3, 47.376417+(x*0.00001), 8.548103+(y*0.00001), z, 0, 0, 2.5f, 0.1f);
bufferlength = mavlink_msg_to_send_buffer(buffer, &ret); bufferlength = mavlink_msg_to_send_buffer(buffer, &ret);
//add data into datastream //add data into datastream
memcpy(stream+streampointer,buffer, bufferlength); memcpy(stream+streampointer,buffer, bufferlength);
streampointer += bufferlength; streampointer += bufferlength;
// GLOBAL POSITION // GLOBAL POSITION
mavlink_msg_global_position_pack(systemId, componentId, &ret, 0, 3, 47.376417+(x*0.001), 8.548103+(y*0.001), z, 0, 0); mavlink_msg_global_position_pack(systemId, componentId, &ret, 0, 47.378028137103+(x*0.00001), 8.54899892510421+(y*0.00001), z, 0, 0, 0);
bufferlength = mavlink_msg_to_send_buffer(buffer, &ret); bufferlength = mavlink_msg_to_send_buffer(buffer, &ret);
//add data into datastream //add data into datastream
memcpy(stream+streampointer,buffer, bufferlength); memcpy(stream+streampointer,buffer, bufferlength);
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of the class Freenect.
*
* @author Lionel Heng <hengli@student.ethz.ch>
*
*/
#include "Freenect.h" #include "Freenect.h"
#include <cmath> #include <cmath>
...@@ -197,7 +228,7 @@ Freenect::get3DPointCloudData(void) ...@@ -197,7 +228,7 @@ Freenect::get3DPointCloudData(void)
unsigned short* data = reinterpret_cast<unsigned short*>(depth); unsigned short* data = reinterpret_cast<unsigned short*>(depth);
for (int i = 0; i < FREENECT_FRAME_PIX; ++i) for (int i = 0; i < FREENECT_FRAME_PIX; ++i)
{ {
if (data[i] <= 2048) if (data[i] > 0 && data[i] <= 2048)
{ {
// see www.ros.org/wiki/kinect_node for details // see www.ros.org/wiki/kinect_node for details
double range = 1.0f / (-0.00307f * static_cast<float>(data[i]) + 3.33f); double range = 1.0f / (-0.00307f * static_cast<float>(data[i]) + 3.33f);
...@@ -226,9 +257,9 @@ Freenect::get6DPointCloudData(void) ...@@ -226,9 +257,9 @@ Freenect::get6DPointCloudData(void)
{ {
Vector6D point; Vector6D point;
point.x = rawPointCloud[i].x(); point.x = rawPointCloud.at(i).x();
point.y = rawPointCloud[i].y(); point.y = rawPointCloud.at(i).y();
point.z = rawPointCloud[i].z(); point.z = rawPointCloud.at(i).z();
QVector4D transformedPoint = transformMatrix * QVector4D(point.x, point.y, point.z, 1.0); QVector4D transformedPoint = transformMatrix * QVector4D(point.x, point.y, point.z, 1.0);
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of the class Freenect.
*
* @author Lionel Heng <hengli@student.ethz.ch>
*
*/
#ifndef FREENECT_H #ifndef FREENECT_H
#define FREENECT_H #define FREENECT_H
......
...@@ -73,12 +73,15 @@ UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(), ...@@ -73,12 +73,15 @@ UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(),
sendDropRate(0), sendDropRate(0),
lowBattAlarm(false), lowBattAlarm(false),
positionLock(false), positionLock(false),
localX(0), localX(0.0),
localY(0), localY(0.0),
localZ(0), localZ(0.0),
roll(0), latitude(0.0),
pitch(0), longitude(0.0),
yaw(0), altitude(0.0),
roll(0.0),
pitch(0.0),
yaw(0.0),
statusTimeout(new QTimer(this)) statusTimeout(new QTimer(this))
{ {
color = UASInterface::getNextColor(); color = UASInterface::getNextColor();
...@@ -342,6 +345,9 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -342,6 +345,9 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
mavlink_global_position_t pos; mavlink_global_position_t pos;
mavlink_msg_global_position_decode(&message, &pos); mavlink_msg_global_position_decode(&message, &pos);
quint64 time = getUnixTime(pos.usec); quint64 time = getUnixTime(pos.usec);
latitude = pos.lat;
longitude = pos.lon;
altitude = pos.alt;
emit valueChanged(uasId, "lat", pos.lat, time); emit valueChanged(uasId, "lat", pos.lat, time);
emit valueChanged(uasId, "lon", pos.lon, time); emit valueChanged(uasId, "lon", pos.lon, time);
emit valueChanged(uasId, "alt", pos.alt, time); emit valueChanged(uasId, "alt", pos.alt, time);
...@@ -776,6 +782,7 @@ void UAS::sendMessage(LinkInterface* link, mavlink_message_t message) ...@@ -776,6 +782,7 @@ void UAS::sendMessage(LinkInterface* link, mavlink_message_t message)
uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
// Write message into buffer, prepending start sign // Write message into buffer, prepending start sign
int len = mavlink_msg_to_send_buffer(buffer, &message); int len = mavlink_msg_to_send_buffer(buffer, &message);
mavlink_finalize_message_chan(&message, mavlink->getSystemId(), mavlink->getComponentId(), link->getId(), message.len);
// If link is connected // If link is connected
if (link->isConnected()) if (link->isConnected())
{ {
......
...@@ -82,6 +82,9 @@ public: ...@@ -82,6 +82,9 @@ public:
double getLocalX() const { return localX; }; double getLocalX() const { return localX; };
double getLocalY() const { return localY; }; double getLocalY() const { return localY; };
double getLocalZ() const { return localZ; }; double getLocalZ() const { return localZ; };
double getLatitude() const { return latitude; };
double getLongitude() const { return longitude; };
double getAltitude() const { return altitude; };
double getRoll() const { return roll; }; double getRoll() const { return roll; };
double getPitch() const { return pitch; }; double getPitch() const { return pitch; };
...@@ -139,6 +142,9 @@ protected: ...@@ -139,6 +142,9 @@ protected:
double localX; double localX;
double localY; double localY;
double localZ; double localZ;
double latitude;
double longitude;
double altitude;
double roll; double roll;
double pitch; double pitch;
double yaw; double yaw;
......
...@@ -70,6 +70,10 @@ public: ...@@ -70,6 +70,10 @@ public:
virtual double getLocalY() const = 0; virtual double getLocalY() const = 0;
virtual double getLocalZ() const = 0; virtual double getLocalZ() const = 0;
virtual double getLatitude() const = 0;
virtual double getLongitude() const = 0;
virtual double getAltitude() const = 0;
virtual double getRoll() const = 0; virtual double getRoll() const = 0;
virtual double getPitch() const = 0; virtual double getPitch() const = 0;
virtual double getYaw() const = 0; virtual double getYaw() const = 0;
......
This diff is collapsed.
...@@ -332,7 +332,7 @@ ...@@ -332,7 +332,7 @@
<action name="actionGoogleEarthView"> <action name="actionGoogleEarthView">
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../mavground.qrc">
<normaloff>:/images/mapproviders/google.png</normaloff>:/images/mapproviders/google.png</iconset> <normaloff>:/images/mapproviders/googleearth.svg</normaloff>:/images/mapproviders/googleearth.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Google Earth View</string> <string>Google Earth View</string>
......
...@@ -199,10 +199,9 @@ void WaypointList::add() ...@@ -199,10 +199,9 @@ void WaypointList::add()
} }
else else
{ {
//isLocalWP = true; //isLocalWP = true;
Waypoint *wp = new Waypoint(0, 1.1, 1.1, -0.8, 0.0, true, true, 0.15, 2000); Waypoint *wp = new Waypoint(0, uas->getLongitude(), uas->getLatitude(), uas->getAltitude(),
0.0, true, true, 0.15, 2000);
uas->getWaypointManager().addWaypoint(wp); uas->getWaypointManager().addWaypoint(wp);
......
...@@ -33,21 +33,21 @@ This file is part of the QGROUNDCONTROL project ...@@ -33,21 +33,21 @@ This file is part of the QGROUNDCONTROL project
GCManipulator::GCManipulator() GCManipulator::GCManipulator()
{ {
_moveSensitivity = 0.05f; _moveSensitivity = 0.05;
_zoomSensitivity = 1.0f; _zoomSensitivity = 1.0;
_minZoomRange = 2.0f; _minZoomRange = 2.0;
} }
void void
GCManipulator::setMinZoomRange(float minZoomRange) GCManipulator::setMinZoomRange(double minZoomRange)
{ {
_minZoomRange = minZoomRange; _minZoomRange = minZoomRange;
} }
void void
GCManipulator::move(float dx, float dy, float dz) GCManipulator::move(double dx, double dy, double dz)
{ {
_center += osg::Vec3(dx, dy, dz); _center += osg::Vec3d(dx, dy, dz);
} }
bool bool
...@@ -126,15 +126,15 @@ GCManipulator::handle(const osgGA::GUIEventAdapter& ea, ...@@ -126,15 +126,15 @@ GCManipulator::handle(const osgGA::GUIEventAdapter& ea,
case GUIEventAdapter::SCROLL: case GUIEventAdapter::SCROLL:
{ {
// zoom model // zoom model
float scale = 1.0f; double scale = 1.0;
if (ea.getScrollingMotion() == GUIEventAdapter::SCROLL_UP) if (ea.getScrollingMotion() == GUIEventAdapter::SCROLL_UP)
{ {
scale -= _zoomSensitivity * 0.1f; scale -= _zoomSensitivity * 0.1;
} }
else else
{ {
scale += _zoomSensitivity * 0.1f; scale += _zoomSensitivity * 0.1;
} }
if (_distance * scale > _minZoomRange) if (_distance * scale > _minZoomRange)
{ {
...@@ -161,12 +161,12 @@ GCManipulator::handle(const osgGA::GUIEventAdapter& ea, ...@@ -161,12 +161,12 @@ GCManipulator::handle(const osgGA::GUIEventAdapter& ea,
} }
case GUIEventAdapter::KEY_Left: case GUIEventAdapter::KEY_Left:
{ {
float scale = -_moveSensitivity * _distance; double scale = -_moveSensitivity * _distance;
osg::Matrix rotation_matrix; osg::Matrix rotation_matrix;
rotation_matrix.makeRotate(_rotation); rotation_matrix.makeRotate(_rotation);
osg::Vec3 dv(scale, 0.0f, 0.0f); osg::Vec3d dv(scale, 0.0, 0.0);
_center += dv * rotation_matrix; _center += dv * rotation_matrix;
...@@ -174,12 +174,12 @@ GCManipulator::handle(const osgGA::GUIEventAdapter& ea, ...@@ -174,12 +174,12 @@ GCManipulator::handle(const osgGA::GUIEventAdapter& ea,
} }
case GUIEventAdapter::KEY_Right: case GUIEventAdapter::KEY_Right:
{ {
float scale = _moveSensitivity * _distance; double scale = _moveSensitivity * _distance;
osg::Matrix rotation_matrix; osg::Matrix rotation_matrix;
rotation_matrix.makeRotate(_rotation); rotation_matrix.makeRotate(_rotation);
osg::Vec3 dv(scale, 0.0f, 0.0f); osg::Vec3d dv(scale, 0.0, 0.0);
_center += dv * rotation_matrix; _center += dv * rotation_matrix;
...@@ -187,12 +187,12 @@ GCManipulator::handle(const osgGA::GUIEventAdapter& ea, ...@@ -187,12 +187,12 @@ GCManipulator::handle(const osgGA::GUIEventAdapter& ea,
} }
case GUIEventAdapter::KEY_Up: case GUIEventAdapter::KEY_Up:
{ {
float scale = _moveSensitivity * _distance; double scale = _moveSensitivity * _distance;
osg::Matrix rotation_matrix; osg::Matrix rotation_matrix;
rotation_matrix.makeRotate(_rotation); rotation_matrix.makeRotate(_rotation);
osg::Vec3 dv(0.0f, scale, 0.0f); osg::Vec3d dv(0.0, scale, 0.0);
_center += dv * rotation_matrix; _center += dv * rotation_matrix;
...@@ -200,12 +200,12 @@ GCManipulator::handle(const osgGA::GUIEventAdapter& ea, ...@@ -200,12 +200,12 @@ GCManipulator::handle(const osgGA::GUIEventAdapter& ea,
} }
case GUIEventAdapter::KEY_Down: case GUIEventAdapter::KEY_Down:
{ {
float scale = -_moveSensitivity * _distance; double scale = -_moveSensitivity * _distance;
osg::Matrix rotation_matrix; osg::Matrix rotation_matrix;
rotation_matrix.makeRotate(_rotation); rotation_matrix.makeRotate(_rotation);
osg::Vec3 dv(0.0f, scale, 0.0f); osg::Vec3d dv(0.0, scale, 0.0);
_center += dv * rotation_matrix; _center += dv * rotation_matrix;
...@@ -231,7 +231,7 @@ GCManipulator::handle(const osgGA::GUIEventAdapter& ea, ...@@ -231,7 +231,7 @@ GCManipulator::handle(const osgGA::GUIEventAdapter& ea,
bool bool
GCManipulator::calcMovement() GCManipulator::calcMovement(void)
{ {
using namespace osgGA; using namespace osgGA;
...@@ -241,11 +241,11 @@ GCManipulator::calcMovement() ...@@ -241,11 +241,11 @@ GCManipulator::calcMovement()
return false; return false;
} }
float dx = _ga_t0->getXnormalized() - _ga_t1->getXnormalized(); double dx = _ga_t0->getXnormalized() - _ga_t1->getXnormalized();
float dy = _ga_t0->getYnormalized() - _ga_t1->getYnormalized(); double dy = _ga_t0->getYnormalized() - _ga_t1->getYnormalized();
// return if there is no movement. // return if there is no movement.
if (dx == 0.0f && dy == 0.0f) if (dx == 0.0 && dy == 0.0)
{ {
return false; return false;
} }
...@@ -282,12 +282,12 @@ GCManipulator::calcMovement() ...@@ -282,12 +282,12 @@ GCManipulator::calcMovement()
GUIEventAdapter::RIGHT_MOUSE_BUTTON)) GUIEventAdapter::RIGHT_MOUSE_BUTTON))
{ {
// pan model // pan model
float scale = -_moveSensitivity * _distance; double scale = -_moveSensitivity * _distance;
osg::Matrix rotation_matrix; osg::Matrix rotation_matrix;
rotation_matrix.makeRotate(_rotation); rotation_matrix.makeRotate(_rotation);
osg::Vec3 dv(dx * scale, dy * scale, 0.0f); osg::Vec3d dv(dx * scale, dy * scale, 0.0);
_center += dv * rotation_matrix; _center += dv * rotation_matrix;
...@@ -297,7 +297,7 @@ GCManipulator::calcMovement() ...@@ -297,7 +297,7 @@ GCManipulator::calcMovement()
else if (buttonMask == GUIEventAdapter::RIGHT_MOUSE_BUTTON) else if (buttonMask == GUIEventAdapter::RIGHT_MOUSE_BUTTON)
{ {
// zoom model // zoom model
float scale = 1.0f + dy * _zoomSensitivity; double scale = 1.0 + dy * _zoomSensitivity;
if (_distance * scale > _minZoomRange) if (_distance * scale > _minZoomRange)
{ {
......
...@@ -39,9 +39,9 @@ class GCManipulator : public osgGA::TrackballManipulator ...@@ -39,9 +39,9 @@ class GCManipulator : public osgGA::TrackballManipulator
public: public:
GCManipulator(); GCManipulator();
void setMinZoomRange(float minZoomRange); void setMinZoomRange(double minZoomRange);
virtual void move(float dx, float dy, float dz); virtual void move(double dx, double dy, double dz);
/** /**
* @brief Handle events. * @brief Handle events.
...@@ -51,11 +51,11 @@ public: ...@@ -51,11 +51,11 @@ public:
osgGA::GUIActionAdapter& us); osgGA::GUIActionAdapter& us);
protected: protected:
bool calcMovement(); bool calcMovement(void);
float _moveSensitivity; double _moveSensitivity;
float _zoomSensitivity; double _zoomSensitivity;
float _minZoomRange; double _minZoomRange;
}; };
#endif // GCMANIPULATOR_H #endif // GCMANIPULATOR_H
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of the class HUDScaleGeode.
*
* @author Lionel Heng <hengli@student.ethz.ch>
*
*/
#include "HUDScaleGeode.h"
#include <osg/Geometry>
#include <osg/LineWidth>
HUDScaleGeode::HUDScaleGeode()
{
}
void
HUDScaleGeode::init(void)
{
osg::ref_ptr<osg::Vec2Array> outlineVertices(new osg::Vec2Array);
outlineVertices->push_back(osg::Vec2(20.0f, 50.0f));
outlineVertices->push_back(osg::Vec2(20.0f, 70.0f));
outlineVertices->push_back(osg::Vec2(20.0f, 60.0f));
outlineVertices->push_back(osg::Vec2(100.0f, 60.0f));
outlineVertices->push_back(osg::Vec2(100.0f, 50.0f));
outlineVertices->push_back(osg::Vec2(100.0f, 70.0f));
osg::ref_ptr<osg::Geometry> outlineGeometry(new osg::Geometry);
outlineGeometry->setVertexArray(outlineVertices);
osg::ref_ptr<osg::Vec4Array> outlineColor(new osg::Vec4Array);
outlineColor->push_back(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f));
outlineGeometry->setColorArray(outlineColor);
outlineGeometry->setColorBinding(osg::Geometry::BIND_OVERALL);
outlineGeometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,
0, 6));
osg::ref_ptr<osg::LineWidth> outlineWidth(new osg::LineWidth());
outlineWidth->setWidth(4.0f);
outlineGeometry->getOrCreateStateSet()->
setAttributeAndModes(outlineWidth, osg::StateAttribute::ON);
addDrawable(outlineGeometry);
osg::ref_ptr<osg::Vec2Array> markerVertices(new osg::Vec2Array);
markerVertices->push_back(osg::Vec2(20.0f, 50.0f));
markerVertices->push_back(osg::Vec2(20.0f, 70.0f));
markerVertices->push_back(osg::Vec2(20.0f, 60.0f));
markerVertices->push_back(osg::Vec2(100.0f, 60.0f));
markerVertices->push_back(osg::Vec2(100.0f, 50.0f));
markerVertices->push_back(osg::Vec2(100.0f, 70.0f));
osg::ref_ptr<osg::Geometry> markerGeometry(new osg::Geometry);
markerGeometry->setVertexArray(markerVertices);
osg::ref_ptr<osg::Vec4Array> markerColor(new osg::Vec4Array);
markerColor->push_back(osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
markerGeometry->setColorArray(markerColor);
markerGeometry->setColorBinding(osg::Geometry::BIND_OVERALL);
markerGeometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,
0, 6));
osg::ref_ptr<osg::LineWidth> markerWidth(new osg::LineWidth());
markerWidth->setWidth(1.5f);
markerGeometry->getOrCreateStateSet()->
setAttributeAndModes(markerWidth, osg::StateAttribute::ON);
addDrawable(markerGeometry);
text = new osgText::Text;
text->setCharacterSize(11);
text->setFont("images/Vera.ttf");
text->setAxisAlignment(osgText::Text::SCREEN);
text->setColor(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f));
text->setPosition(osg::Vec3(40.0f, 45.0f, -1.5f));
addDrawable(text);
}
void
HUDScaleGeode::update(int windowHeight, float cameraFov, float cameraDistance,
bool darkBackground)
{
float f = static_cast<float>(windowHeight) / 2.0f
/ tanf(cameraFov / 180.0f * M_PI / 2.0f);
float dist = cameraDistance / f * 80.0f;
if (darkBackground)
{
text->setColor(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f));
}
else
{
text->setColor(osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
}
text->setText(QString("%1 m").arg(dist, 0, 'f', 2).toStdString());
}
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of the class HUDScaleGeode.
*
* @author Lionel Heng <hengli@student.ethz.ch>
*
*/
#ifndef HUDSCALEGEODE_H
#define HUDSCALEGEODE_H
#include <osg/Geode>
#include <osgText/Text>
#include <QString>
class HUDScaleGeode : public osg::Geode
{
public:
HUDScaleGeode();
void init(void);
void update(int windowHeight, float cameraFov, float cameraDistance,
bool darkBackground);
private:
osg::ref_ptr<osgText::Text> text;
};
#endif // HUDSCALEGEODE_H
...@@ -70,6 +70,11 @@ Imagery::prefetch2D(double windowWidth, double windowHeight, ...@@ -70,6 +70,11 @@ Imagery::prefetch2D(double windowWidth, double windowHeight,
double zoom, double xOrigin, double yOrigin, double zoom, double xOrigin, double yOrigin,
const QString& utmZone) const QString& utmZone)
{ {
if (currentImageryType == BLANK_MAP)
{
return;
}
double tileResolution; double tileResolution;
if (currentImageryType == GOOGLE_SATELLITE || if (currentImageryType == GOOGLE_SATELLITE ||
currentImageryType == GOOGLE_MAP) currentImageryType == GOOGLE_MAP)
...@@ -113,8 +118,19 @@ Imagery::prefetch2D(double windowWidth, double windowHeight, ...@@ -113,8 +118,19 @@ Imagery::prefetch2D(double windowWidth, double windowHeight,
void void
Imagery::draw2D(double windowWidth, double windowHeight, Imagery::draw2D(double windowWidth, double windowHeight,
double zoom, double xOrigin, double yOrigin, double zoom, double xOrigin, double yOrigin,
double xOffset, double yOffset, double zOffset,
const QString& utmZone) const QString& utmZone)
{ {
if (getNumDrawables() > 0)
{
removeDrawables(0, getNumDrawables());
}
if (currentImageryType == BLANK_MAP)
{
return;
}
double tileResolution; double tileResolution;
if (currentImageryType == GOOGLE_SATELLITE || if (currentImageryType == GOOGLE_SATELLITE ||
currentImageryType == GOOGLE_MAP) currentImageryType == GOOGLE_MAP)
...@@ -144,11 +160,6 @@ Imagery::draw2D(double windowWidth, double windowHeight, ...@@ -144,11 +160,6 @@ Imagery::draw2D(double windowWidth, double windowHeight,
yOrigin + windowHeight / 2.0 / zoom * 1.5, utmZone, yOrigin + windowHeight / 2.0 / zoom * 1.5, utmZone,
minTileX, minTileY, maxTileX, maxTileY, zoomLevel); minTileX, minTileY, maxTileX, maxTileY, zoomLevel);
if (getNumDrawables() > 0)
{
removeDrawables(0, getNumDrawables());
}
for (int r = minTileY; r <= maxTileY; ++r) for (int r = minTileY; r <= maxTileY; ++r)
{ {
for (int c = minTileX; c <= maxTileX; ++c) for (int c = minTileX; c <= maxTileX; ++c)
...@@ -161,10 +172,11 @@ Imagery::draw2D(double windowWidth, double windowHeight, ...@@ -161,10 +172,11 @@ Imagery::draw2D(double windowWidth, double windowHeight,
TexturePtr t = textureCache->get(tileURL); TexturePtr t = textureCache->get(tileURL);
if (!t.isNull()) if (!t.isNull())
{ {
addDrawable(t->draw(y1 - yOrigin, x1 - xOrigin, addDrawable(t->draw(y1 - yOffset, x1 - xOffset,
y2 - yOrigin, x2 - xOrigin, y2 - yOffset, x2 - xOffset,
y3 - yOrigin, x3 - xOrigin, y3 - yOffset, x3 - xOffset,
y4 - yOrigin, x4 - xOrigin, y4 - yOffset, x4 - xOffset,
zOffset,
true)); true));
} }
} }
...@@ -176,6 +188,11 @@ Imagery::prefetch3D(double radius, double tileResolution, ...@@ -176,6 +188,11 @@ Imagery::prefetch3D(double radius, double tileResolution,
double xOrigin, double yOrigin, double xOrigin, double yOrigin,
const QString& utmZone) const QString& utmZone)
{ {
if (currentImageryType == BLANK_MAP)
{
return;
}
int minTileX, minTileY, maxTileX, maxTileY; int minTileX, minTileY, maxTileX, maxTileY;
int zoomLevel; int zoomLevel;
...@@ -198,8 +215,19 @@ Imagery::prefetch3D(double radius, double tileResolution, ...@@ -198,8 +215,19 @@ Imagery::prefetch3D(double radius, double tileResolution,
void void
Imagery::draw3D(double radius, double tileResolution, Imagery::draw3D(double radius, double tileResolution,
double xOrigin, double yOrigin, double xOrigin, double yOrigin,
double xOffset, double yOffset, double zOffset,
const QString& utmZone) const QString& utmZone)
{ {
if (getNumDrawables() > 0)
{
removeDrawables(0, getNumDrawables());
}
if (currentImageryType == BLANK_MAP)
{
return;
}
int minTileX, minTileY, maxTileX, maxTileY; int minTileX, minTileY, maxTileX, maxTileY;
int zoomLevel; int zoomLevel;
...@@ -208,11 +236,6 @@ Imagery::draw3D(double radius, double tileResolution, ...@@ -208,11 +236,6 @@ Imagery::draw3D(double radius, double tileResolution,
xOrigin + radius, yOrigin + radius, utmZone, xOrigin + radius, yOrigin + radius, utmZone,
minTileX, minTileY, maxTileX, maxTileY, zoomLevel); minTileX, minTileY, maxTileX, maxTileY, zoomLevel);
if (getNumDrawables() > 0)
{
removeDrawables(0, getNumDrawables());
}
for (int r = minTileY; r <= maxTileY; ++r) for (int r = minTileY; r <= maxTileY; ++r)
{ {
for (int c = minTileX; c <= maxTileX; ++c) for (int c = minTileX; c <= maxTileX; ++c)
...@@ -226,10 +249,11 @@ Imagery::draw3D(double radius, double tileResolution, ...@@ -226,10 +249,11 @@ Imagery::draw3D(double radius, double tileResolution,
if (!t.isNull()) if (!t.isNull())
{ {
addDrawable(t->draw(y1 - yOrigin, x1 - xOrigin, addDrawable(t->draw(y1 - yOffset, x1 - xOffset,
y2 - yOrigin, x2 - xOrigin, y2 - yOffset, x2 - xOffset,
y3 - yOrigin, x3 - xOrigin, y3 - yOffset, x3 - xOffset,
y4 - yOrigin, x4 - xOrigin, y4 - yOffset, x4 - xOffset,
zOffset,
true)); true));
} }
} }
...@@ -377,7 +401,7 @@ Imagery::UTMtoTile(double northing, double easting, const QString& utmZone, ...@@ -377,7 +401,7 @@ Imagery::UTMtoTile(double northing, double easting, const QString& utmZone,
} }
QChar QChar
Imagery::UTMLetterDesignator(double latitude) const Imagery::UTMLetterDesignator(double latitude)
{ {
// This routine determines the correct UTM letter designator for the given latitude // This routine determines the correct UTM letter designator for the given latitude
// returns 'Z' if latitude is outside the UTM limits of 84N to 80S // returns 'Z' if latitude is outside the UTM limits of 84N to 80S
...@@ -412,7 +436,7 @@ Imagery::UTMLetterDesignator(double latitude) const ...@@ -412,7 +436,7 @@ Imagery::UTMLetterDesignator(double latitude) const
void void
Imagery::LLtoUTM(double latitude, double longitude, Imagery::LLtoUTM(double latitude, double longitude,
double& utmNorthing, double& utmEasting, double& utmNorthing, double& utmEasting,
QString& utmZone) const QString& utmZone)
{ {
// converts lat/long to UTM coords. Equations from USGS Bulletin 1532 // converts lat/long to UTM coords. Equations from USGS Bulletin 1532
// East Longitudes are positive, West longitudes are negative. // East Longitudes are positive, West longitudes are negative.
...@@ -493,7 +517,7 @@ Imagery::LLtoUTM(double latitude, double longitude, ...@@ -493,7 +517,7 @@ Imagery::LLtoUTM(double latitude, double longitude,
void void
Imagery::UTMtoLL(double utmNorthing, double utmEasting, const QString& utmZone, Imagery::UTMtoLL(double utmNorthing, double utmEasting, const QString& utmZone,
double& latitude, double& longitude) const double& latitude, double& longitude)
{ {
// converts UTM coords to lat/long. Equations from USGS Bulletin 1532 // converts UTM coords to lat/long. Equations from USGS Bulletin 1532
// East Longitudes are positive, West longitudes are negative. // East Longitudes are positive, West longitudes are negative.
...@@ -563,7 +587,7 @@ Imagery::UTMtoLL(double utmNorthing, double utmEasting, const QString& utmZone, ...@@ -563,7 +587,7 @@ Imagery::UTMtoLL(double utmNorthing, double utmEasting, const QString& utmZone,
* D * D * D * D * D / 120.0) / cos(phi1Rad); * D * D * D * D * D / 120.0) / cos(phi1Rad);
longitude = LongOrigin + longitude / M_PI * 180.0; longitude = LongOrigin + longitude / M_PI * 180.0;
} }
#include <QDebug>
QString QString
Imagery::getTileLocation(int tileX, int tileY, int zoomLevel, Imagery::getTileLocation(int tileX, int tileY, int zoomLevel,
double tileResolution) const double tileResolution) const
......
...@@ -60,6 +60,7 @@ public: ...@@ -60,6 +60,7 @@ public:
const QString& utmZone); const QString& utmZone);
void draw2D(double windowWidth, double windowHeight, void draw2D(double windowWidth, double windowHeight,
double zoom, double xOrigin, double yOrigin, double zoom, double xOrigin, double yOrigin,
double xOffset, double yOffset, double zOffset,
const QString& utmZone); const QString& utmZone);
void prefetch3D(double radius, double tileResolution, void prefetch3D(double radius, double tileResolution,
...@@ -67,10 +68,17 @@ public: ...@@ -67,10 +68,17 @@ public:
const QString& utmZone); const QString& utmZone);
void draw3D(double radius, double tileResolution, void draw3D(double radius, double tileResolution,
double xOrigin, double yOrigin, double xOrigin, double yOrigin,
double xOffset, double yOffset, double zOffset,
const QString& utmZone); const QString& utmZone);
bool update(void); bool update(void);
static void LLtoUTM(double latitude, double longitude,
double& utmNorthing, double& utmEasting,
QString& utmZone);
static void UTMtoLL(double utmNorthing, double utmEasting, const QString& utmZone,
double& latitude, double& longitude);
private: private:
void imageBounds(int tileX, int tileY, double tileResolution, void imageBounds(int tileX, int tileY, double tileResolution,
double& x1, double& y1, double& x2, double& y2, double& x1, double& y1, double& x2, double& y2,
...@@ -90,13 +98,7 @@ private: ...@@ -90,13 +98,7 @@ private:
void UTMtoTile(double northing, double easting, const QString& utmZone, void UTMtoTile(double northing, double easting, const QString& utmZone,
double tileResolution, int& tileX, int& tileY, double tileResolution, int& tileX, int& tileY,
int& zoomLevel) const; int& zoomLevel) const;
QChar UTMLetterDesignator(double latitude) const; static QChar UTMLetterDesignator(double latitude);
void LLtoUTM(double latitude, double longitude,
double& utmNorthing, double& utmEasting,
QString& utmZone) const;
void UTMtoLL(double utmNorthing, double utmEasting, const QString& utmZone,
double& latitude, double& longitude) const;
QString getTileLocation(int tileX, int tileY, int zoomLevel, QString getTileLocation(int tileX, int tileY, int zoomLevel,
double tileResolution) const; double tileResolution) const;
......
This diff is collapsed.
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <osgText/Text> #include <osgText/Text>
#include "HUDScaleGeode.h"
#include "Imagery.h" #include "Imagery.h"
#include "ImageWindowGeode.h" #include "ImageWindowGeode.h"
...@@ -68,6 +69,13 @@ private slots: ...@@ -68,6 +69,13 @@ private slots:
void recenter(void); void recenter(void);
void toggleFollowCamera(int state); void toggleFollowCamera(int state);
void insertWaypoint(void);
void moveWaypoint(void);
void setWaypoint(void);
void deleteWaypoint(void);
void setWaypointAltitude(void);
void clearAllWaypoints(void);
protected: protected:
QVector< osg::ref_ptr<osg::Node> > findVehicleModels(void); QVector< osg::ref_ptr<osg::Node> > findVehicleModels(void);
void buildLayout(void); void buildLayout(void);
...@@ -88,10 +96,11 @@ private: ...@@ -88,10 +96,11 @@ private:
void setupHUD(void); void setupHUD(void);
void resizeHUD(void); void resizeHUD(void);
void updateHUD(float robotX, float robotY, float robotZ, void updateHUD(double robotX, double robotY, double robotZ,
float robotRoll, float robotPitch, float robotYaw); double robotRoll, double robotPitch, double robotYaw);
void updateTrail(float robotX, float robotY, float robotZ); void updateTrail(double robotX, double robotY, double robotZ);
void updateImagery(void); void updateImagery(double originX, double originY, double originZ,
const QString& zone);
void updateTarget(void); void updateTarget(void);
void updateWaypoints(void); void updateWaypoints(void);
#ifdef QGC_LIBFREENECT_ENABLED #ifdef QGC_LIBFREENECT_ENABLED
...@@ -100,6 +109,17 @@ private: ...@@ -100,6 +109,17 @@ private:
void markTarget(void); void markTarget(void);
int findWaypoint(int mouseX, int mouseY);
void showInsertWaypointMenu(const QPoint& cursorPos);
void showEditWaypointMenu(const QPoint& cursorPos);
enum Mode {
DEFAULT_MODE,
MOVE_WAYPOINT_MODE
};
Mode mode;
int selectedWpIndex;
bool displayGrid; bool displayGrid;
bool displayTrail; bool displayTrail;
bool displayImagery; bool displayImagery;
...@@ -111,12 +131,13 @@ private: ...@@ -111,12 +131,13 @@ private:
bool followCamera; bool followCamera;
osg::ref_ptr<osg::Vec3Array> trailVertices; osg::ref_ptr<osg::Vec3dArray> trailVertices;
QVarLengthArray<osg::Vec3, 10000> trail; QVarLengthArray<osg::Vec3d, 10000> trail;
osg::ref_ptr<osg::Node> vehicleModel; osg::ref_ptr<osg::Node> vehicleModel;
osg::ref_ptr<osg::Geometry> hudBackgroundGeometry; osg::ref_ptr<osg::Geometry> hudBackgroundGeometry;
osg::ref_ptr<osgText::Text> statusText; osg::ref_ptr<osgText::Text> statusText;
osg::ref_ptr<HUDScaleGeode> scaleGeode;
osg::ref_ptr<ImageWindowGeode> rgb2DGeode; osg::ref_ptr<ImageWindowGeode> rgb2DGeode;
osg::ref_ptr<ImageWindowGeode> depth2DGeode; osg::ref_ptr<ImageWindowGeode> depth2DGeode;
osg::ref_ptr<osg::Image> rgbImage; osg::ref_ptr<osg::Image> rgbImage;
...@@ -134,6 +155,7 @@ private: ...@@ -134,6 +155,7 @@ private:
QScopedPointer<Freenect> freenect; QScopedPointer<Freenect> freenect;
QVector<Freenect::Vector6D> pointCloud; QVector<Freenect::Vector6D> pointCloud;
#endif #endif
bool enableFreenect;
QSharedPointer<QByteArray> rgb; QSharedPointer<QByteArray> rgb;
QSharedPointer<QByteArray> coloredDepth; QSharedPointer<QByteArray> coloredDepth;
...@@ -141,7 +163,7 @@ private: ...@@ -141,7 +163,7 @@ private:
QPushButton* targetButton; QPushButton* targetButton;
float lastRobotX, lastRobotY, lastRobotZ; double lastRobotX, lastRobotY, lastRobotZ;
}; };
#endif // PIXHAWK3DWIDGET_H #endif // PIXHAWK3DWIDGET_H
...@@ -71,6 +71,9 @@ void ...@@ -71,6 +71,9 @@ void
Q3DWidget::init(float fps) Q3DWidget::init(float fps)
{ {
getCamera()->setGraphicsContext(osgGW); getCamera()->setGraphicsContext(osgGW);
// manually specify near and far clip planes
getCamera()->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);
setLightingMode(osg::View::SKY_LIGHT); setLightingMode(osg::View::SKY_LIGHT);
...@@ -149,8 +152,9 @@ Q3DWidget::createRobot(void) ...@@ -149,8 +152,9 @@ Q3DWidget::createRobot(void)
osg::ref_ptr<osg::Node> osg::ref_ptr<osg::Node>
Q3DWidget::createHUD(void) Q3DWidget::createHUD(void)
{ {
hudProjectionMatrix->setMatrix(osg::Matrix::ortho2D(0, width(), hudProjectionMatrix->setMatrix(osg::Matrix::ortho(0.0, width(),
0, height())); 0.0, height(),
-10.0, 10.0));
osg::ref_ptr<osg::MatrixTransform> hudModelViewMatrix( osg::ref_ptr<osg::MatrixTransform> hudModelViewMatrix(
new osg::MatrixTransform); new osg::MatrixTransform);
...@@ -181,13 +185,13 @@ Q3DWidget::setCameraParams(float minZoomRange, float cameraFov, ...@@ -181,13 +185,13 @@ Q3DWidget::setCameraParams(float minZoomRange, float cameraFov,
} }
void void
Q3DWidget::moveCamera(float dx, float dy, float dz) Q3DWidget::moveCamera(double dx, double dy, double dz)
{ {
cameraManipulator->move(dx, dy, dz); cameraManipulator->move(dx, dy, dz);
} }
void void
Q3DWidget::recenterCamera(float x, float y, float z) Q3DWidget::recenterCamera(double x, double y, double z)
{ {
cameraManipulator->setCenter(osg::Vec3d(x, y, z)); cameraManipulator->setCenter(osg::Vec3d(x, y, z));
} }
...@@ -256,8 +260,9 @@ Q3DWidget::getMouseY(void) ...@@ -256,8 +260,9 @@ Q3DWidget::getMouseY(void)
void void
Q3DWidget::resizeGL(int width, int height) Q3DWidget::resizeGL(int width, int height)
{ {
hudProjectionMatrix->setMatrix(osg::Matrix::ortho2D(0, width, hudProjectionMatrix->setMatrix(osg::Matrix::ortho(0.0, width,
0, height)); 0.0, height,
-10.0, 10.0));
osgGW->getEventQueue()->windowResize(0, 0, width, height); osgGW->getEventQueue()->windowResize(0, 0, width, height);
osgGW->resized(0 , 0, width, height); osgGW->resized(0 , 0, width, height);
...@@ -385,18 +390,6 @@ Q3DWidget::wheelEvent(QWheelEvent* event) ...@@ -385,18 +390,6 @@ Q3DWidget::wheelEvent(QWheelEvent* event)
osgGA::GUIEventAdapter::SCROLL_DOWN); osgGA::GUIEventAdapter::SCROLL_DOWN);
} }
float
Q3DWidget::r2d(float angle)
{
return angle * 57.295779513082320876f;
}
float
Q3DWidget::d2r(float angle)
{
return angle * 0.0174532925199432957692f;
}
osgGA::GUIEventAdapter::KeySymbol osgGA::GUIEventAdapter::KeySymbol
Q3DWidget::convertKey(int key) const Q3DWidget::convertKey(int key) const
{ {
......
...@@ -88,12 +88,12 @@ public: ...@@ -88,12 +88,12 @@ public:
* @param dy Translation along the y-axis in meters. * @param dy Translation along the y-axis in meters.
* @param dz Translation along the z-axis in meters. * @param dz Translation along the z-axis in meters.
*/ */
void moveCamera(float dx, float dy, float dz); void moveCamera(double dx, double dy, double dz);
/** /**
* @brief Recenters the camera at (x,y,z). * @brief Recenters the camera at (x,y,z).
*/ */
void recenterCamera(float x, float y, float z); void recenterCamera(double x, double y, double z);
/** /**
* @brief Sets up 3D display mode. * @brief Sets up 3D display mode.
...@@ -211,20 +211,6 @@ protected: ...@@ -211,20 +211,6 @@ protected:
*/ */
virtual void wheelEvent(QWheelEvent* event); virtual void wheelEvent(QWheelEvent* event);
/**
* @brief Converts radians to degrees.
* @param angle Angle in radians.
* @return angle in degrees.
*/
float r2d(float angle);
/**
* @brief Converts degrees to radians.
* @param angle Angle in degrees.
* @return angle in radians.
*/
float d2r(float angle);
/** /**
* @brief Converts Qt-defined key to OSG-defined key. * @brief Converts Qt-defined key to OSG-defined key.
* @param key Qt-defined key. * @param key Qt-defined key.
......
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>Form</class>
<widget class="QWidget" name="Form" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
</widget>
<pixmapfunction></pixmapfunction>
<connections/>
</ui>
#include <QWebFrame>
#include <QWebPage>
#include <QDebug>
#include "QGCGoogleEarthView.h" #include "QGCGoogleEarthView.h"
#include "QGCWebPage.h"
#include "UASManager.h"
#include "ui_QGCGoogleEarthControls.h"
#if (defined Q_OS_WIN) && !(defined __MINGW32__)
#include "ui_QGCGoogleEarthViewWin.h"
#else
#include "ui_QGCGoogleEarthView.h" #include "ui_QGCGoogleEarthView.h"
#endif
QGCGoogleEarthView::QGCGoogleEarthView(QWidget *parent) : QGCGoogleEarthView::QGCGoogleEarthView(QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::QGCGoogleEarthView) updateTimer(new QTimer(this)),
mav(NULL),
followCamera(true),
#if (defined Q_OS_MAC)
webViewMac(new QWebView(this)),
#endif
#if (defined Q_OS_WIN) & !(defined __MINGW32__)
webViewWin(new QGCWebAxWidget(this)),
#else
ui(new Ui::QGCGoogleEarthView)
#endif
{ {
#if (defined Q_OS_WIN) & !(defined __MINGW32__)
// Create layout and attach webViewWin
#else
#endif
ui->setupUi(this); ui->setupUi(this);
ui->webView->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
ui->webView->load(QUrl("earth.html")); #if (defined Q_OS_MAC)
ui->webViewLayout->addWidget(webViewMac);
webViewMac->setPage(new QGCWebPage(webViewMac));
webViewMac->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
webViewMac->load(QUrl("earth.html"));
#endif
#if (defined Q_OS_WIN) & !(defined __MINGW32__)
webViewWin->load(QUrl("earth.html"));
#endif
#if ((defined Q_OS_MAC) | ((defined Q_OS_WIN) & !(defined __MINGW32__)))
connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*)));
connect(updateTimer, SIGNAL(timeout()), this, SLOT(updateState()));
updateTimer->start(200);
#endif
// Get list of available 3D models
// Load HTML file
// Parse for model links
// Populate model list
} }
QGCGoogleEarthView::~QGCGoogleEarthView() QGCGoogleEarthView::~QGCGoogleEarthView()
...@@ -15,6 +65,71 @@ QGCGoogleEarthView::~QGCGoogleEarthView() ...@@ -15,6 +65,71 @@ QGCGoogleEarthView::~QGCGoogleEarthView()
delete ui; delete ui;
} }
void QGCGoogleEarthView::setActiveUAS(UASInterface* uas)
{
mav = uas;
}
void QGCGoogleEarthView::showTrail(int state)
{
}
void QGCGoogleEarthView::showWaypoints(int state)
{
}
void QGCGoogleEarthView::follow(bool follow)
{
}
void QGCGoogleEarthView::updateState()
{
if (webViewMac->page()->currentFrame()->evaluateJavaScript("isInitialized();").toBool())
{
static bool initialized = false;
if (!initialized)
{
webViewMac->page()->currentFrame()->evaluateJavaScript("setGCSHome(22.679833,8.549444, 470);");
initialized = true;
}
int uasId = 0;
double lat = 22.679833;
double lon = 8.549444;
double alt = 470.0;
float roll = 0.0f;
float pitch = 0.0f;
float yaw = 0.0f;
if (mav)
{
uasId = mav->getUASID();
lat = mav->getLatitude();
lon = mav->getLongitude();
alt = mav->getAltitude();
roll = mav->getRoll();
pitch = mav->getPitch();
yaw = mav->getYaw();
}
webViewMac->page()->currentFrame()->evaluateJavaScript(QString("setAircraftPositionAttitude(%1, %2, %3, %4, %6, %7, %8);")
.arg(uasId)
.arg(lat)
.arg(lon)
.arg(alt+500)
.arg(roll)
.arg(pitch)
.arg(yaw));
if (followCamera)
{
webViewMac->page()->currentFrame()->evaluateJavaScript(QString("updateFollowAircraft()"));
}
}
}
void QGCGoogleEarthView::changeEvent(QEvent *e) void QGCGoogleEarthView::changeEvent(QEvent *e)
{ {
QWidget::changeEvent(e); QWidget::changeEvent(e);
......
...@@ -2,10 +2,46 @@ ...@@ -2,10 +2,46 @@
#define QGCGOOGLEEARTHVIEW_H #define QGCGOOGLEEARTHVIEW_H
#include <QWidget> #include <QWidget>
#include <QTimer>
#include <UASInterface.h>
#if (defined Q_OS_MAC)
#include <QWebView>
#endif
#if (defined Q_OS_WIN) && !(defined __MINGW32__)
QGCWebAxWidget* webViewWin;
#include <ActiveQt/QAxWidget>
#include "windows.h"
class WebAxWidget : public QAxWidget
{
public:
WebAxWidget(QWidget* parent = 0, Qt::WindowFlags f = 0)
: QAxWidget(parent, f)
{
}
protected:
virtual bool translateKeyEvent(int message, int keycode) const
{
if (message >= WM_KEYFIRST && message <= WM_KEYLAST)
return true;
else
return QAxWidget::translateKeyEvent(message, keycode);
}
};
#else
namespace Ui { namespace Ui {
class QGCGoogleEarthControls;
#if (defined Q_OS_WIN) && !(defined __MINGW32__)
class QGCGoogleEarthViewWin;
#else
class QGCGoogleEarthView; class QGCGoogleEarthView;
#endif
} }
#endif
class QGCGoogleEarthView : public QWidget class QGCGoogleEarthView : public QWidget
{ {
...@@ -15,11 +51,37 @@ public: ...@@ -15,11 +51,37 @@ public:
explicit QGCGoogleEarthView(QWidget *parent = 0); explicit QGCGoogleEarthView(QWidget *parent = 0);
~QGCGoogleEarthView(); ~QGCGoogleEarthView();
public slots:
/** @brief Update the internal state. Does not trigger a redraw */
void updateState();
/** @brief Set the currently selected UAS */
void setActiveUAS(UASInterface* uas);
/** @brief Show the vehicle trail */
void showTrail(int state);
/** @brief Show the waypoints */
void showWaypoints(int state);
/** @brief Follow the aircraft during flight */
void follow(bool follow);
protected: protected:
void changeEvent(QEvent *e); void changeEvent(QEvent *e);
QTimer* updateTimer;
UASInterface* mav;
bool followCamera;
#if (defined Q_OS_WIN) && !(defined __MINGW32__)
WebAxWidget* webViewWin;
#endif
#if (defined Q_OS_MAC)
QWebView* webViewMac;
#endif
private: private:
Ui::QGCGoogleEarthView *ui; Ui::QGCGoogleEarthControls* controls;
#if (defined Q_OS_WIN) && !(defined __MINGW32__)
Ui::QGCGoogleEarthViewWin* ui;
#else
Ui::QGCGoogleEarthView* ui;
#endif
}; };
#endif // QGCGOOGLEEARTHVIEW_H #endif // QGCGOOGLEEARTHVIEW_H
...@@ -6,35 +6,72 @@ ...@@ -6,35 +6,72 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>400</width> <width>597</width>
<height>300</height> <height>300</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QGridLayout" name="gridLayout">
<property name="horizontalSpacing">
<number>10</number>
</property>
<property name="verticalSpacing">
<number>5</number>
</property>
<property name="margin"> <property name="margin">
<number>0</number> <number>2</number>
</property> </property>
<item> <item row="0" column="0" colspan="6">
<widget class="QWebView" name="webView"> <layout class="QVBoxLayout" name="webViewLayout"/>
<property name="url"> </item>
<url> <item row="1" column="0">
<string>about:blank</string> <widget class="QComboBox" name="mavComboBox"/>
</url> </item>
<item row="1" column="1">
<widget class="QPushButton" name="goHomeButton">
<property name="text">
<string>Home</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QCheckBox" name="followAirplaneCheckbox">
<property name="text">
<string>Follow</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QCheckBox" name="trailCheckbox">
<property name="text">
<string>Trail</string>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QPushButton" name="clearWPButton">
<property name="text">
<string>Clear WPs</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="5">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>177</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header>QtWebKit/QWebView</header>
</customwidget>
</customwidgets>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>Form</class>
<widget class="QWidget" name="Form" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
</widget>
<pixmapfunction></pixmapfunction>
<connections/>
</ui>
#include "QGCWebPage.h"
#include <QDebug>
QGCWebPage::QGCWebPage(QObject *parent) :
QWebPage(parent)
{
}
void QGCWebPage::javaScriptConsoleMessage ( const QString & message, int lineNumber, const QString & sourceID )
{
qDebug() << "JAVASCRIPT: " << lineNumber << sourceID << message;
}
#ifndef QGCWEBPAGE_H
#define QGCWEBPAGE_H
#include <QWebPage>
class QGCWebPage : public QWebPage
{
Q_OBJECT
public:
explicit QGCWebPage(QObject *parent = 0);
signals:
public slots:
protected:
void javaScriptConsoleMessage ( const QString & message, int lineNumber, const QString & sourceID );
};
#endif // QGCWEBPAGE_H
...@@ -47,7 +47,7 @@ Texture::Texture(unsigned int _id) ...@@ -47,7 +47,7 @@ Texture::Texture(unsigned int _id)
osg::ref_ptr<osg::Image> image = new osg::Image; osg::ref_ptr<osg::Image> image = new osg::Image;
texture2D->setImage(image); texture2D->setImage(image);
osg::ref_ptr<osg::Vec2Array> vertices(new osg::Vec2Array(4)); osg::ref_ptr<osg::Vec3dArray> vertices(new osg::Vec3dArray(4));
geometry->setVertexArray(vertices); geometry->setVertexArray(vertices);
osg::ref_ptr<osg::Vec2Array> textureCoords = new osg::Vec2Array; osg::ref_ptr<osg::Vec2Array> textureCoords = new osg::Vec2Array;
...@@ -55,7 +55,7 @@ Texture::Texture(unsigned int _id) ...@@ -55,7 +55,7 @@ Texture::Texture(unsigned int _id)
textureCoords->push_back(osg::Vec2(1.0f, 1.0f)); textureCoords->push_back(osg::Vec2(1.0f, 1.0f));
textureCoords->push_back(osg::Vec2(1.0f, 0.0f)); textureCoords->push_back(osg::Vec2(1.0f, 0.0f));
textureCoords->push_back(osg::Vec2(0.0f, 0.0f)); textureCoords->push_back(osg::Vec2(0.0f, 0.0f));
geometry->setTexCoordArray(id, textureCoords); geometry->setTexCoordArray(0, textureCoords);
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES, geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,
0, 4)); 0, 4));
...@@ -66,6 +66,13 @@ Texture::Texture(unsigned int _id) ...@@ -66,6 +66,13 @@ Texture::Texture(unsigned int _id)
geometry->setColorBinding(osg::Geometry::BIND_OVERALL); geometry->setColorBinding(osg::Geometry::BIND_OVERALL);
geometry->setUseDisplayList(false); geometry->setUseDisplayList(false);
osg::ref_ptr<osg::LineWidth> linewidth(new osg::LineWidth);
linewidth->setWidth(2.0f);
geometry->getOrCreateStateSet()->
setAttributeAndModes(linewidth, osg::StateAttribute::ON);
geometry->getOrCreateStateSet()->
setMode(GL_LIGHTING, osg::StateAttribute::OFF);
} }
const QString& const QString&
...@@ -94,8 +101,8 @@ Texture::sync(const WebImagePtr& image) ...@@ -94,8 +101,8 @@ Texture::sync(const WebImagePtr& image)
texture2D->getImage()->setImage(image->getWidth(), texture2D->getImage()->setImage(image->getWidth(),
image->getHeight(), image->getHeight(),
1, 1,
GL_RGB, GL_RGBA,
GL_RGB, GL_RGBA,
GL_UNSIGNED_BYTE, GL_UNSIGNED_BYTE,
image->getImageData(), image->getImageData(),
osg::Image::NO_DELETE); osg::Image::NO_DELETE);
...@@ -105,23 +112,25 @@ Texture::sync(const WebImagePtr& image) ...@@ -105,23 +112,25 @@ Texture::sync(const WebImagePtr& image)
} }
osg::ref_ptr<osg::Geometry> osg::ref_ptr<osg::Geometry>
Texture::draw(float x1, float y1, float x2, float y2, Texture::draw(double x1, double y1, double x2, double y2,
double z,
bool smoothInterpolation) const bool smoothInterpolation) const
{ {
return draw(x1, y1, x2, y1, x2, y2, x1, y2, smoothInterpolation); return draw(x1, y1, x2, y1, x2, y2, x1, y2, z, smoothInterpolation);
} }
osg::ref_ptr<osg::Geometry> osg::ref_ptr<osg::Geometry>
Texture::draw(float x1, float y1, float x2, float y2, Texture::draw(double x1, double y1, double x2, double y2,
float x3, float y3, float x4, float y4, double x3, double y3, double x4, double y4,
double z,
bool smoothInterpolation) const bool smoothInterpolation) const
{ {
osg::Vec2Array* vertices = osg::Vec3dArray* vertices =
static_cast<osg::Vec2Array*>(geometry->getVertexArray()); static_cast<osg::Vec3dArray*>(geometry->getVertexArray());
(*vertices)[0].set(x1, y1); (*vertices)[0].set(x1, y1, z);
(*vertices)[1].set(x2, y2); (*vertices)[1].set(x2, y2, z);
(*vertices)[2].set(x3, y3); (*vertices)[2].set(x3, y3, z);
(*vertices)[3].set(x4, y4); (*vertices)[3].set(x4, y4, z);
osg::DrawArrays* drawarrays = osg::DrawArrays* drawarrays =
static_cast<osg::DrawArrays*>(geometry->getPrimitiveSet(0)); static_cast<osg::DrawArrays*>(geometry->getPrimitiveSet(0));
...@@ -130,11 +139,11 @@ Texture::draw(float x1, float y1, float x2, float y2, ...@@ -130,11 +139,11 @@ Texture::draw(float x1, float y1, float x2, float y2,
if (state == REQUESTED) if (state == REQUESTED)
{ {
drawarrays->set(osg::PrimitiveSet::LINES, 0, 4); drawarrays->set(osg::PrimitiveSet::LINE_LOOP, 0, 4);
(*colors)[0].set(0.0f, 0.0f, 1.0f, 1.0f); (*colors)[0].set(0.0f, 0.0f, 1.0f, 1.0f);
geometry->getOrCreateStateSet()-> geometry->getOrCreateStateSet()->
setTextureAttributeAndModes(id, texture2D, osg::StateAttribute::OFF); setTextureAttributeAndModes(0, texture2D, osg::StateAttribute::OFF);
return geometry; return geometry;
} }
...@@ -154,7 +163,7 @@ Texture::draw(float x1, float y1, float x2, float y2, ...@@ -154,7 +163,7 @@ Texture::draw(float x1, float y1, float x2, float y2,
(*colors)[0].set(1.0f, 1.0f, 1.0f, 1.0f); (*colors)[0].set(1.0f, 1.0f, 1.0f, 1.0f);
geometry->getOrCreateStateSet()-> geometry->getOrCreateStateSet()->
setTextureAttributeAndModes(id, texture2D, osg::StateAttribute::ON); setTextureAttributeAndModes(0, texture2D, osg::StateAttribute::ON);
return geometry; return geometry;
} }
...@@ -51,10 +51,12 @@ public: ...@@ -51,10 +51,12 @@ public:
void sync(const WebImagePtr& image); void sync(const WebImagePtr& image);
osg::ref_ptr<osg::Geometry> draw(float x1, float y1, float x2, float y2, osg::ref_ptr<osg::Geometry> draw(double x1, double y1, double x2, double y2,
double z,
bool smoothInterpolation) const; bool smoothInterpolation) const;
osg::ref_ptr<osg::Geometry> draw(float x1, float y1, float x2, float y2, osg::ref_ptr<osg::Geometry> draw(double x1, double y1, double x2, double y2,
float x3, float y3, float x4, float y4, double x3, double y3, double x4, double y4,
double z,
bool smoothInterpolation) const; bool smoothInterpolation) const;
private: private:
......
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