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
1b6c9a55
Commit
1b6c9a55
authored
Nov 21, 2011
by
LM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Asctec Firefly model, ready to incorporate 3D models
parent
73be7133
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
23 deletions
+56
-23
earth.html
images/earth.html
+47
-14
QGCGoogleEarthView.cc
src/ui/map3D/QGCGoogleEarthView.cc
+9
-9
No files found.
images/earth.html
View file @
1b6c9a55
...
...
@@ -7,7 +7,7 @@
<!-- QGroundControl -->
<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 *** -->
<
!--<script type="text/javascript" src="https://getfirebug.com/firebug-lite-beta.js"></script>--
>
<
script
type=
"text/javascript"
src=
"https://getfirebug.com/firebug-lite-beta.js"
></script
>
<script
type=
"text/javascript"
src=
"https://www.google.com/jsapi?key=ABQIAAAA5Q6wxQ6lxKS8haLVdUJaqhSjosg_0jiTTs2iXtkDVG0n0If1mBRHzhWw5VqBZX-j4NuzoVpU-UaHVg"
></script>
<script
type=
"text/javascript"
>
google
.
load
(
"
earth
"
,
"
1
"
,
{
'
language
'
:
'
en
'
});
...
...
@@ -99,6 +99,12 @@ var clickMode = 0;
var
homePlacemark
=
null
;
// Data / heightmap
var
heightMapPlacemark
=
null
;
var
heightMapModel
=
null
;
function
getGlobal
(
variable
)
{
return
variable
;
...
...
@@ -415,12 +421,18 @@ function createAircraft(id, type, color)
planeModel
.
setLocation
(
planeLoc
);
planeLink
=
ge
.
createLink
(
''
);
planeOrient
=
ge
.
createOrientation
(
''
);
planeModel
.
setOrientation
(
planeOrient
);
planeModel
.
setOrientation
(
planeOrient
);
var
factor
=
1.0
;
//planeLink.setHref('http://www.asl.ethz.ch/people/rudink/senseSoarDummy.dae');
//planeLink.setHref('http://qgroundcontrol.org/_media/users/models/sfly-hex.dae');
planeLink
.
setHref
(
'
http://qgroundcontrol.org/_media/users/models/ascent-park-glider.dae
'
);
planeLink
.
setHref
(
'
http://qgroundcontrol.org/_media/users/models/sfly-hex.dae
'
);
factor
=
1.0
/
1000.0
;
//planeLink.setHref('http://qgroundcontrol.org/_media/users/models/ascent-park-glider.dae');
planeModel
.
setLink
(
planeLink
);
var
scale
=
planeModel
.
getScale
();
scale
.
set
(
scale
.
getX
()
*
factor
,
scale
.
getY
()
*
factor
,
scale
.
getZ
()
*
factor
)
planeModel
.
setScale
(
scale
);
planeModel
.
setAltitudeMode
(
ge
.
ALTITUDE_ABSOLUTE
);
planeLoc
.
setLatitude
(
currLat
);
...
...
@@ -555,6 +567,34 @@ function initCallback(object)
enableEventListener
();
document
.
getElementById
(
'
JScript_initialized
'
).
setAttribute
(
'
value
'
,
'
true
'
);
// Load heightmap
// http://www.inf.ethz.ch/personal/lomeier/data/untex-environment.dae
heightMapPlacemark
=
ge
.
createPlacemark
(
''
);
heightMapPlacemark
.
setName
(
'
aircraft
'
);
heightMapModel
=
ge
.
createModel
(
''
);
ge
.
getFeatures
().
appendChild
(
heightMapPlacemark
);
planeLoc
=
ge
.
createLocation
(
''
);
heightMapModel
.
setLocation
(
planeLoc
);
planeLink
=
ge
.
createLink
(
''
);
planeOrient
=
ge
.
createOrientation
(
''
);
heightMapModel
.
setOrientation
(
planeOrient
);
planeLink
.
setHref
(
'
http://www.inf.ethz.ch/personal/lomeier/data/untex-environment.dae
'
);
heightMapModel
.
setLink
(
planeLink
);
var
scale
=
heightMapModel
.
getScale
();
var
factor
=
1.0
;
//1.0/1000.0;
scale
.
set
(
scale
.
getX
()
*
factor
,
scale
.
getY
()
*
factor
,
scale
.
getZ
()
*
factor
)
heightMapModel
.
setScale
(
scale
);
heightMapModel
.
setAltitudeMode
(
ge
.
ALTITUDE_ABSOLUTE
);
planeLoc
.
setLatitude
(
currLat
);
planeLoc
.
setLongitude
(
currLon
);
planeLoc
.
setAltitude
(
currAlt
);
heightMapPlacemark
.
setGeometry
(
heightMapModel
);
initialized
=
true
;
}
...
...
@@ -678,17 +718,10 @@ function updateFollowAircraft()
if
(
viewMode
!=
3
)
// VIEW_MODE_CHASE_FREE
{
ge
.
getView
().
setAbstractView
(
currView
);
var
camera
=
ge
.
getView
().
copyAsCamera
(
ge
.
ALTITUDE_ABSOLUTE
);
camera
.
setTilt
(
currFollowTilt
);
camera
.
setRoll
(
0
);
camera
.
setHeading
(
currFollowHeading
);
ge
.
getView
().
setAbstractView
(
camera
);
}
else
{
ge
.
getView
().
setAbstractView
(
currView
);
currView
.
setTilt
(
currFollowTilt
);
currView
.
setHeading
(
currFollowHeading
);
}
ge
.
getView
().
setAbstractView
(
currView
);
}
function
failureCallback
(
object
)
...
...
src/ui/map3D/QGCGoogleEarthView.cc
View file @
1b6c9a55
...
...
@@ -54,15 +54,15 @@ QGCGoogleEarthView::QGCGoogleEarthView(QWidget *parent) :
#ifdef _MSC_VER
// Create layout and attach webViewWin
QFile
file
(
"doc.html"
);
if
(
!
file
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Text
))
qDebug
()
<<
__FILE__
<<
__LINE__
<<
"Could not open log file"
;
QTextStream
out
(
&
file
);
out
<<
webViewWin
->
generateDocumentation
();
out
.
flush
();
file
.
flush
();
file
.
close
();
//
QFile file("doc.html");
//
if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
//
qDebug() << __FILE__ << __LINE__ << "Could not open log file";
//
QTextStream out(&file);
//
out << webViewWin->generateDocumentation();
//
out.flush();
//
file.flush();
//
file.close();
#else
...
...
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