edu.nps.moves.spatial
Class RangeCoordinates

java.lang.Object
  extended by edu.nps.moves.spatial.RangeCoordinates

public class RangeCoordinates
extends java.lang.Object

Represents a local, flat range area with Euclidian coordinates, which is convienient for somewhat small simulated areas. This class assumes a local, flat, coordinate system with an origin at (lat, lon, altitude) and positive X pointing local east, positive Y pointing local north, and positive Z pointing up. Specified in WGS_84 geodesic coordinate system. Altitude is distance above the ellipsoid.

The coordinate system has its origin at the given (lat, lon) and creates a plane tangent and normal to the ellipsoid at that point.

There are several major reference frames that may be useful in various contexts:

Geocentric: Origin at the center of the earth. Positive X out at the intersection of the equator and prime meridian, Y out at 90 deg east lon, and Z up through the north pole. This is the coordinate system used by DIS world coordinates.

Geodetic: The coordinate system uses lat/lon/altitude. This is handy for positioning an object on the earth (or close to it) but not so handy for describing things like velocity.

Local Tangent Surface Euclidian (LTSE): Pick a lat/lon/altitude, and then at that point you can define a single plane normal and tangent to the globe. Positive X points local east, positive Y points local north, and positive Z points local up. This is handy for describing the position of an object in, for example, a range of somewhat small dimensions, perhaps 20KM X 20KM, where we don't want to get sucked into the whole curved earth scene and just want to be simple.

Body Centric/Lococentric/Platform-centric: The origin is at the volumentric center of an entity (in DIS); Positive x points out the long axis, positive Y points to the right, and positive Z points down. This is widely used to describe (roll, pitch, yaw) in aircraft. Note that you need a transform from (for example) the LTSE to body coordinates to define the position of the body axis origin and orientation WRT the LTSE origin. Note that the direction of the Z axis is the opposite of that used by LTSE. The axes are often named (u,v,w) in this frame of reference.

We can also convert between these coordinate systems using standard libraries in the SRM.

See User’s Manual for SRM Orientation, Velocity, & Acceleration Transformations Version 2.0, 18 Nov 2009, available with the sedris Java SDK download.

Author:
DMcG

Constructor Summary
RangeCoordinates(double originLat, double originLon, double heightOffset)
          Constructor for a local flat coordinate system.
 
Method Summary
 void c(double lat, double lon, double alt, double bank, double pitch, double head)
           
 void change(double localX, double localY, double localZ, double bank, double noseUp, double bearing)
           
 void changeVectorToDisCoordFromLocalFlat(Vector3Double localCoordinates)
          Changes a Vector3Double from the local coordinate system (flat, euclidian, orgin given at (lat, lon, alt)) to a global, DIS, earth-centric coordinate system.
 void changeVectorToLocalCoordFromDIS(Vector3Double worldCoordinates)
          Changes the world-coordinates vector3double to the local euclidian flat coordinate system.
 Vector3Double DISCoordFromLocalFlat(double x, double y, double z)
          Transform from local, flat coordinate system to the DIS coordinate system.
 SRM.SRF_LococentricEuclidean3D getPlatformReferenceFrame(Vector3Double rangePositionCoordinates)
           
 Vector3Double localCoordFromDis(double x, double y, double z)
          Given DIS coordinates, convert to the local euclidian plane coordinates.
 Orientation localRollPitchHeadingToDisEuler(Orientation pitchRollHeading, Vector3Double localPosition)
          Converts a roll, pitch, and heading/yaw in the local flat coordinate system to DIS euler angles.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangeCoordinates

public RangeCoordinates(double originLat,
                        double originLon,
                        double heightOffset)
Constructor for a local flat coordinate system. Takes the latitude and longitude (in degrees) for WGS_84 and the height above the ellipsoid and creates a local, flat coordinate system at that point.

Parameters:
originLat - Origin of the flat local coordinate system, in degrees, latitude
originLon - Origin of the flat local coordinate system, in degrees, longitude
heightOffset - altitudeOrigin above ellipsoid surface, in meters
Method Detail

changeVectorToDisCoordFromLocalFlat

public void changeVectorToDisCoordFromLocalFlat(Vector3Double localCoordinates)
Changes a Vector3Double from the local coordinate system (flat, euclidian, orgin given at (lat, lon, alt)) to a global, DIS, earth-centric coordinate system. Overwrites the values currently in Vector3Double passed in.

Parameters:
localCoordinates - Position in local euclidian coordinate system. Values are overwritten to the DIS earth-centric coordinate system on return

DISCoordFromLocalFlat

public Vector3Double DISCoordFromLocalFlat(double x,
                                           double y,
                                           double z)
Transform from local, flat coordinate system to the DIS coordinate system. All units in meters, positive x east, y north, z altitude.

Parameters:
x - x coordinate in local, flat coordinate system
y - y coordinate in meters in local, flat coordinate system
z - z coordinate, altitude, in meters in local flat coordinate system

changeVectorToLocalCoordFromDIS

public void changeVectorToLocalCoordFromDIS(Vector3Double worldCoordinates)
Changes the world-coordinates vector3double to the local euclidian flat coordinate system. Overwrites the values in worldCoordinates.

Parameters:
worldCoordinates -

localCoordFromDis

public Vector3Double localCoordFromDis(double x,
                                       double y,
                                       double z)
Given DIS coordinates, convert to the local euclidian plane coordinates.

Parameters:
x -
y -
z -

localRollPitchHeadingToDisEuler

public Orientation localRollPitchHeadingToDisEuler(Orientation pitchRollHeading,
                                                   Vector3Double localPosition)
Converts a roll, pitch, and heading/yaw in the local flat coordinate system to DIS euler angles. Input orientation is in units of radians. DIS uses euler angles to describe the orientation of an object, using an earth-centered coordinate system, with successive rotations about the original x, y, and z axes. You need to be careful here because there are all sorts of conventions for "euler angles" including the order in which the axes are rotated about.

phi = roll, theta = pitch, psi = yaw/heading

, by one popular convention. All units are in radians.

Note that we also need the postion of the object in the local coordinate system. The DIS euler angles will vary depending on not just the roll/pitch/heading, but also where in the local coordinate frame the object is. Also, the pitch/roll/heading are in the local coordinate system, NOT the coordinate system of the object.

Parameters:
pitchRollHeading -

c

public void c(double lat,
              double lon,
              double alt,
              double bank,
              double pitch,
              double head)

change

public void change(double localX,
                   double localY,
                   double localZ,
                   double bank,
                   double noseUp,
                   double bearing)

main

public static void main(java.lang.String[] args)

getPlatformReferenceFrame

public SRM.SRF_LococentricEuclidean3D getPlatformReferenceFrame(Vector3Double rangePositionCoordinates)