Skip to content

Commit

Permalink
Merge branch 'experimental' of pixhawk.ethz.ch:qgroundcontrol into ex…
Browse files Browse the repository at this point in the history
…perimental
  • Loading branch information
LorenzMeier committed Dec 29, 2010
2 parents d5f5922 + 1d560d9 commit 0198993
Show file tree
Hide file tree
Showing 4 changed files with 394 additions and 320 deletions.
47 changes: 26 additions & 21 deletions images/earth.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@

var ge = null;
var initialized = false;

var aircraft = new Array();
var currAircraft = 220;
var followEnabled = false;
var followAircraft = false;
var currLat = 47.3769;
var currLon = 8.549444;
var currAlt = 470;
var currFollowHeading = 0.0;

var homeLat = 0;
var homeLon = 0;
Expand All @@ -32,17 +33,11 @@
var currFollowTilt = 40.0;
var currView = null;

var M_PI = 3.14159265;



var planeOrient;
var planeLoc;

var aircraft = [];
var attitudes = [];
var locations = [];
var trails = [];
var trail;
var lineStringPlacemark;
var lineStyle;
Expand All @@ -62,10 +57,7 @@



function setCurrAircraft(id)
{
currAircraft = id;
}


function setGCSHome(lat, lon, alt)
{
Expand Down Expand Up @@ -98,6 +90,13 @@
{
homeGroundLevel = alt;
}






goHome();
}

function createAircraft(id, type, color)
Expand Down Expand Up @@ -205,19 +204,17 @@
currLat = lat;
currLon = lon;
currAlt = alt;
currFollowHeading = ((yaw/M_PI)+1.0)*360.0;
}

// FIXME Currently invalid conversion from right-handed z-down to z-up frame
planeOrient.setRoll(((roll/M_PI)+1.0)*360.0);
planeOrient.setTilt(((pitch/M_PI)+1.0)*360.0);
planeOrient.setHeading(((yaw/M_PI)+1.0)*360.0);
planeOrient.setRoll(roll);
planeOrient.setTilt(pitch);
planeOrient.setHeading(yaw);



planeLoc.setLatitude(lat);
planeLoc.setLongitude(lon);
planeLoc.setAltitude(alt);
planeLoc.setLatitude(lat);
planeLoc.setLongitude(lon);
planeLoc.setAltitude(alt);

}

Expand Down Expand Up @@ -249,16 +246,24 @@
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);
currView.setHeading(currFollowHeading-90.0);
ge.getView().setAbstractView(currView);
}
}

function failureCallback(object)
Expand Down
6 changes: 4 additions & 2 deletions qgroundcontrol.pri
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,9 @@ win32-msvc2008 {
DEFINES += QT_NO_DEBUG
}

# Special settings for debug
#CONFIG += CONSOLE
debug {
CONFIG += console
}

INCLUDEPATH += $$BASEDIR/lib/sdl/msvc/include \
$$BASEDIR/lib/opal/include \
Expand Down Expand Up @@ -379,6 +380,7 @@ win32-g++ {

debug {
#DESTDIR = $$BUILDDIR/debug
CONFIG += console
}

release {
Expand Down
Loading

0 comments on commit 0198993

Please sign in to comment.