Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Stavor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Orekit
Stavor
Commits
7e952d6d
Commit
7e952d6d
authored
10 years ago
by
Xavier Gibert
Browse files
Options
Downloads
Patches
Plain Diff
Orbit Hud rotation of Earth with frames
parent
869fe015
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
assets/www/huds/index_orbit.html
+5
-3
5 additions, 3 deletions
assets/www/huds/index_orbit.html
src/cs/si/stavor/model/ModelSimulation.java
+18
-3
18 additions, 3 deletions
src/cs/si/stavor/model/ModelSimulation.java
with
23 additions
and
6 deletions
assets/www/huds/index_orbit.html
+
5
−
3
View file @
7e952d6d
...
...
@@ -300,8 +300,8 @@ function setXYplane(){
function
includeEarth
(){
containerEarth
=
new
THREE
.
Object3D
();
containerEarth
.
rotateX
(
Math
.
PI
/
2
);
containerEarth
.
rotateZ
(
-
23.4
*
Math
.
PI
/
180
);
//
containerEarth.rotateX(Math.PI/2);
//
containerEarth.rotateZ(-23.4 * Math.PI/180);
containerEarth
.
position
.
z
=
0
;
containerEarth
.
name
=
"
EARTH
"
;
scene
.
add
(
containerEarth
);
...
...
@@ -340,7 +340,9 @@ function includeEarth(){
earthMesh
.
name
=
"
EARTH-PLANET
"
;
containerEarth
.
add
(
earthMesh
)
onRenderFcts
.
push
(
function
(
delta
,
now
){
earthMesh
.
rotation
.
y
+=
1
/
32
*
delta
*
accel_time
;
//earthMesh.rotation.y += 1/32 * delta * accel_time;
var
offset_quat
=
new
THREE
.
Quaternion
().
setFromUnitVectors
(
new
THREE
.
Vector3
(
0
,
1
,
0
),
new
THREE
.
Vector3
(
0
,
0
,
1
)
);
earthMesh
.
quaternion
.
multiplyQuaternions
(
value_earth_rotation
,
offset_quat
);
})
//Earth axis
...
...
This diff is collapsed.
Click to expand it.
src/cs/si/stavor/model/ModelSimulation.java
+
18
−
3
View file @
7e952d6d
package
cs.si.stavor.model
;
import
org.apache.commons.math3.geometry.euclidean.threed.Rotation
;
import
org.apache.commons.math3.geometry.euclidean.threed.RotationOrder
;
import
org.apache.commons.math3.geometry.euclidean.threed.Vector3D
;
import
org.orekit.attitudes.Attitude
;
import
org.orekit.bodies.CelestialBodyFactory
;
import
org.orekit.errors.OrekitException
;
import
org.orekit.frames.Frame
;
import
org.orekit.frames.FramesFactory
;
import
org.orekit.orbits.KeplerianOrbit
;
import
org.orekit.propagation.SpacecraftState
;
import
org.orekit.time.AbsoluteDate
;
import
org.orekit.time.TimeScale
;
import
org.orekit.time.TimeScalesFactory
;
import
org.orekit.utils.IERSConventions
;
import
org.xwalk.core.XWalkView
;
import
android.view.View
;
...
...
@@ -59,6 +62,9 @@ public class ModelSimulation {
if
(
sunFrame
==
null
){
sunFrame
=
CelestialBodyFactory
.
getSun
().
getInertiallyOrientedFrame
();
}
if
(
earthFixedFrame
==
null
){
earthFixedFrame
=
CelestialBodyFactory
.
getEarth
().
getBodyOrientedFrame
();
}
if
(
utc
==
null
){
utc
=
TimeScalesFactory
.
getUTC
();
}
...
...
@@ -147,7 +153,7 @@ public class ModelSimulation {
private
AbsoluteDate
tmp_time
;
private
Vector3D
tmp_vel
;
private
TimeScale
utc
;
private
Frame
sunFrame
;
private
Frame
sunFrame
,
earthFixedFrame
;
public
void
updateSimulation
(
SpacecraftState
scs
,
int
sim_progress
){
if
(
selectedBrowser
.
equals
(
Browsers
.
Attitude
)){
ModelState
new_state
=
new
ModelState
();
...
...
@@ -229,8 +235,17 @@ public class ModelSimulation {
}
else
if
(
selectedBrowser
.
equals
(
Browsers
.
Orbit
)){
ModelStateOrbit
new_state
=
new
ModelStateOrbit
();
//TODO
new_state
.
value_earth_rotation
=
new
Quat
();
AbsoluteDate
date
=
scs
.
getAttitude
().
getDate
();
try
{
//Frame fix_frame = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
//Frame fix_frame = FramesFactory.getITRF2008(true);
Rotation
rot
=
scs
.
getFrame
().
getTransformTo
(
earthFixedFrame
,
date
).
getRotation
();
new_state
.
value_earth_rotation
=
new
Quat
(
rot
);
}
catch
(
OrekitException
e
)
{
e
.
printStackTrace
();
}
//XGGDEBUG: correct values
Vector3D
spacecraft
=
scs
.
getPVCoordinates
().
getPosition
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment