Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
37275ad4
Commit
37275ad4
authored
Jan 03, 2011
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added smoothing of Google Earth positions
parent
2d8aacd0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
15 deletions
+31
-15
earth.html
images/earth.html
+21
-12
qgroundcontrol.pri
qgroundcontrol.pri
+10
-2
qgroundcontrol.pro
qgroundcontrol.pro
+0
-1
No files found.
images/earth.html
View file @
37275ad4
...
...
@@ -45,6 +45,8 @@ var planeOrient;
var
planeLoc
;
var
aircraft
=
[];
var
aircraftLocations
=
[];
var
aircraftLastLocations
=
[];
var
attitudes
=
[];
var
locations
=
[];
var
trails
=
[];
...
...
@@ -134,7 +136,8 @@ function createAircraft(id, type, color)
// Write into global structure
aircraft
[
id
]
=
planePlacemark
;
attitudes
[
id
]
=
planeOrient
;
locations
[
id
]
=
planeLoc
;
aircraftLocations
[
id
]
=
planeLoc
;
aircraftLastLocations
[
id
]
=
ge
.
createLocation
(
''
);
//planeColor = color;
createTrail
(
id
,
color
);
...
...
@@ -192,7 +195,7 @@ function addTrailPosition(id, lat, lon, alt)
trails
[
id
].
setAltitudeMode
(
ge
.
ALTITUDE_ABSOLUTE
);
// Add LineString points
trails
[
id
].
getCoordinates
().
pushLatLngAlt
(
lat
,
lon
,
alt
);
trails
[
id
].
getCoordinates
().
pushLatLngAlt
(
lat
,
lon
,
alt
);
// Create a style and set width and color of line
trailPlacemarks
[
id
].
setStyleSelector
(
ge
.
createStyle
(
''
));
...
...
@@ -238,18 +241,18 @@ function setAircraftPositionAttitude(id, lat, lon, alt, roll, pitch, yaw)
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
);
}
planeLoc
.
setLatitude
(
lat
);
planeLoc
.
setLongitude
(
lon
);
planeLoc
.
setAltitude
(
alt
);
//
planeLoc.setLatitude(lat);
//
planeLoc.setLongitude(lon);
//
planeLoc.setAltitude(alt);
}
...
...
@@ -284,18 +287,24 @@ function setCurrentAircraft(id)
function
updateFollowAircraft
()
{
currView
=
ge
.
getView
().
copyAsLookAt
(
ge
.
ALTITUDE_ABSOLUTE
);
// Interpolate
currView
.
setLatitude
(
lastLat
*
0.7
+
currLat
*
0.3
);
currView
.
setLongitude
(
lastLon
*
0.7
+
currLon
*
0.3
);
currView
.
setAltitude
(
lastAlt
*
0.7
+
currAlt
*
0.3
);
// Set new states
// Interpolate between t-1 and t and set new states
lastLat
=
lastLat
*
0.7
+
currLat
*
0.3
;
lastLon
=
lastLon
*
0.7
+
currLon
*
0.3
;
lastAlt
=
lastAlt
*
0.7
+
currAlt
*
0.3
;
currView
.
setLatitude
(
lastLat
);
currView
.
setLongitude
(
lastLon
);
currView
.
setAltitude
(
lastAlt
);
currView
.
setRange
(
currViewRange
);
currView
.
setTilt
(
currFollowTilt
);
currFollowHeading
=
0
;
// 0.9*currFollowHeading+0.1*((Math.atan2(lastLat-currLat, lastLon-currLon)/M_PI)+1.0)*360.0;
currView
.
setHeading
(
currFollowHeading
-
0.0
);
// FIXME Shouldn't update aircraft in here, but works for now
planeLoc
.
setLatitude
(
lastLat
);
planeLoc
.
setLongitude
(
lastLon
);
planeLoc
.
setAltitude
(
lastAlt
);
ge
.
getView
().
setAbstractView
(
currView
);
}
...
...
qgroundcontrol.pri
View file @
37275ad4
...
...
@@ -58,12 +58,18 @@ macx {
debug {
#QMAKE_CXXFLAGS += -finstrument-functions
#LIBS += -lSaturn
CONFIG += console
}
} else {
# x64 Mac OS X Snow Leopard 10.6 and later
CONFIG += x86_64 cocoa
CONFIG -= x86 phonon
message(Building for Mac OS X 64bit/Snow Leopard 10.6 and later)
debug {
#QMAKE_CXXFLAGS += -finstrument-functions
#LIBS += -lSaturn
CONFIG += console
}
}
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5
...
...
@@ -151,12 +157,13 @@ linux-g++ {
debug {
DESTDIR = $$TARGETDIR/debug
CONFIG += debug
CONFIG += debug
console
}
release {
DESTDIR = $$TARGETDIR/release
DEFINES += QT_NO_DEBUG
CONFIG -= console
}
QMAKE_POST_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
...
...
@@ -221,12 +228,13 @@ linux-g++-64 {
debug {
DESTDIR = $$TARGETDIR/debug
CONFIG += debug
CONFIG += debug
console
}
release {
DESTDIR = $$TARGETDIR/release
DEFINES += QT_NO_DEBUG
CONFIG -= console
}
QMAKE_POST_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
...
...
qgroundcontrol.pro
View file @
37275ad4
...
...
@@ -39,7 +39,6 @@ BASEDIR = $$IN_PWD
TARGETDIR
=
$$
OUT_PWD
BUILDDIR
=
$$
TARGETDIR
/
build
LANGUAGE
=
C
++
CONFIG
+=
console
OBJECTS_DIR
=
$$
BUILDDIR
/
obj
MOC_DIR
=
$$
BUILDDIR
/
moc
UI_HEADERS_DIR
=
src
/
ui
/
generated
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment