Simple Earth Satellite Tracker

The Java source, configuration and content files for this example can be found in the jeospace examples directory examples/graphic/x3d/[swing|swt]/SimpleEarthSatelliteTracker. Both Swing and standalone SWT versions are available.

This page briefly describes the configuration and content files that are used to construct the simulation.

Profile

The Profile is the primary configuration object for the simulation environment. The description of the profile file can be found in the documentation section under Profile. A Jeospace Profile is analogous to the Unix user configuration profile. It contains user preferences and references to the working set(s) of components for the simulation. The simulation Profile object may be instantiated and configured programatically, or it can obtain it's initial configuration from an .xml file. In this example the Profile is configured by the profile.xml file. The file can be arbitrarily named and the initializing program is responsible for reading the file into an XML DOM object which is passed to the constructor of the Profile.

profile.xml


<?xml version="1.0" encoding="UTF-8"?>
<Profile name="Satellite Example">
  <AtlasList>
    <AtlasLocator>
      <URL value="StructureAtlas.xml"/>
    </AtlasLocator>
    <AtlasLocator>
      <URL value="ContentAtlas.xml"/>
    </AtlasLocator>
  </AtlasList>
  <Active name="ISS (ZARYA)">
    <AtlasLocator>
      <URL value="ContentAtlas.xml"/>
    </AtlasLocator>
  </Active>
</Profile>


Atlas

Simulation components are described in Atlases. The description of the atlas file can be found in the documentation section under Atlas. In this example, two Atlases are initially included; StructureAtlas.xml and ContentAtlas.xml.

The Profile object loads the atlas files and initializes an Atlas object with each file. Atlases are loaded in the order in which they appear in the AtlasList, and it is required that any loading dependencies are handled by the AtlasList order. In this example for instance, the structures within which the content will be loaded are defined in StructureAtlas.xml which is loaded first. The content - geometry, etc. - is defined in ContentAtlas.xml which is loaded second.

Content and structure elements can be mixed in an atlas file.

Structures

The Atlas structure components define the types of objects that will be managed in the simulation and describe the physical heirarchical configuration of the simulation components. Three types of structure components are currently supported: Root, World and Satellite. Each of these components instantiate a Java class that provides the simulation behavours and creates a structure within the visualization for adding content and additional structures.

For Atlases with structure components, several rules apply:

These two elements are the identifiers that enable the simulation hierarchy to be constructed - and provide the identifers for adding additional structures and content.

StructureAtlas.xml


<?xml version="1.0"?>

<Atlas name="Earth Satellite Example - Structure Atlas" loadStatus="true" >

  <Root id="ICRS"/>

  <World> 
    <Identification id="Sun" name="Sun" type="Star"/>
    <ReferenceFrame system="ICRS"/>
    <class value="org.jeospace.physics.orbit.Sun"/>
  </World>

  <World> 
    <Identification id="Earth" name="Earth" type="Planet"/>
    <ReferenceFrame system="Sun" frame="Ecliptic"/>
    <class value="org.jeospace.physics.orbit.Earth"/>
  </World>

  <Satellite>
    <Identification id="ISS (ZARYA):25544" name="ISS (ZARYA)" num="25544" type="satellite"/>
    <ReferenceFrame frame="Equatorial" system="Earth"/>
    <OrbitalElements>
      <ecc value="0.0012859"/>
      <incl unit="deg" value="51.6375"/>
      <ascn unit="deg" value="11.8240"/>
      <argp unit="deg" value="37.8696"/>
      <anml unit="deg" value="46.1680"/>
      <mnmo unit="rev" value="15.76256533"/>
      <drgc value="0.89815E-4"/>
      <epoch fmt="tle" value="06272.16662771"/>
    </OrbitalElements>
  </Satellite>

</Atlas>


A ReferenceFrame is an identifier of a coordinate system within the simulation hierarchy. Each component will be parented to the coordinate system identified by its ReferenceFrame descriptor. The Root component element identifies the base coordinate system for the simulation heirarchy and is by default both a reference frame and identification descriptor. Notice in the StructureAtlas.xml example that the Sun is in the Root reference frame (ICRS), the Earth in the Sun's reference frame and the ISS is in the Earth's reference frame.

The Identification element provides naming information about the component. The id attribute of the Identification descriptor is the primary identifier used in the construction of a ReferenceFrame object for the structure component.

Component ReferenceFrame
Root
<ReferenceFrame system="id"/>
World
<ReferenceFrame system="parent_id" frame="Ecliptic|Equatorial|Ellipsoidal"/>
Satellite
<ReferenceFrame system="parent_id" frame="Ecliptic|Equatorial|Ellipsoidal" platform="id"/>

Content

Content, or visualization components, can be included into the simulation through Atlas descriptions. The content of the example have all been described in a single atlas file.

ContentAtlas.xml


<?xml version="1.0"?>

<Atlas name="Earth Satellite Example - Content Atlas" loadStatus="true" >

  <SystemComponent name="Earth"> 
    <ReferenceFrame system="Earth" frame="Ellipsoidal"/>
    <Inline>
      <scale mag="1000" mult="k" unit="m"/>
      <URL value="Earth.x3dv"/>
    </Inline>
  </SystemComponent>

  <PlatformComponent name="ISS (ZARYA):25544" type="marker">
    <ReferenceFrame frame="Equatorial" platform="ISS (ZARYA):25544" system="Earth"/>
    <Sphere sensor="true">
      <scale mag="70.0" mult="k" unit="m"/>
      <ColorCode b="0.0" g="0.0" r="1.0"/>
    </Sphere>
  </PlatformComponent>

  <Viewpoint name="ISS (ZARYA)" displayStatus="true">
    <ReferenceFrame system="Earth" frame="Equatorial" platform="ISS (ZARYA):25544"/>
     <pos>
       <Spherical>
         <lng unit="deg" value="0"/>
         <lat unit="deg" value="90"/>
         <dst mag="10000" mult="k" unit="m"/>
       </Spherical>
     </pos>
     <orient>
       <Attitude>
         <yaw unit="deg" value="180"/>
         <pitch unit="deg" value="-90"/>
         <roll unit="deg" value="0"/>
       </Attitude>
     </orient>
  </Viewpoint>

  <Viewpoint name="Earth - Prime Meridian / Equator" displayStatus="true">
    <ReferenceFrame system="Earth" frame="Ellipsoidal"/>
    <pos name="Prime Meridian / Equator">
      <Ellipsoidal>
        <lng unit="deg" value="0.0" />
        <lat unit="deg" value="0.0" />
        <elv mag="20000" mult="k" unit="m"/>
        <Ellipsoid id="WGS-84"/>
      </Ellipsoidal>
    </pos>
    <orient>
      <Attitude>
        <yaw unit="deg" value="180"/>
        <pitch unit="deg" value="-90"/>
        <roll unit="deg" value="0"/>
      </Attitude>
    </orient>
  </Viewpoint>

</Atlas>


Geometry Components

This content Atlas provides the visual components of the simulation. The primary mechanism for including X3D geometry content into the visualization is by referencing an X3D source file. In the example ContentAtlas.xml, the model of the Earth is included by reference to it's URL. In addition to the file locator for the X3D source - an additional data item - the scale to which the model has been built is required.

Note that in the model file Earth.x3dv, the scale of the geometry is set in thousands of kilometers - which is consistant with the Earth model component description in the atlas. Geometry components must all be given a scale which is transformed within the simulation so that all included objects are scaled consistantly.

Earth.x3dv


#X3D V3.0 utf8
PROFILE Immersive
EXTERNPROTO Spheroid [ ]
"sphere_ifs_5deg.x3dv"

Transform {
    scale 6.378137 6.3567523142 6.378137
    children [
        Shape {
            geometry Spheroid { }
            appearance Appearance {
                material Material {
                    ambientIntensity 0.2,
                    diffuseColor 1 1 1,
                    shininess 0,
                }
                texture ImageTexture {
                    url "land_shallow_topo_2048.jpg"
                }
            }
        }
    ]
}


Also supported are a small set of geometry 'primative' components, Box, Cone and Sphere. These components are simple wrappers around the X3D components of the same name and are primarily used to provide visual markers within the simulation for objects that might not otherwise be visible. In this example, a Sphere component is used to mark the location of the satellite ISS (International Space Station). In relation to the scale of the Earth and the distance of the viewpoint from the satellite, an actual scale model would not be visible - so an oversized simple piece of geometry is used in it's place.

Viewing Components

The predefined set of views of the simulation are also described in the content atlas file. These descriptions place an X3D Viewpoint within the simulation browser in the specified coordinate system (ReferenceFrame) and at the specified coordinate. In this example, one viewpoint is defined in the reference frame of the satellite and one is defined in the reference frame of the planet Earth.

The position coordinate may be described in a number of formats - usually depending upon the convention that is appropriate for the reference frame that the view is in. In this example, the Earth attached viewpoint is in an Ellipsoidal - or Earth surface - reference frame and is described in a convention Earth referenced coordinate, longitude, latitude and elevation - above a reference ellipsoid. Position coordinates may be described in Spherical, Ellipsoidal or Cartesian representations.