Class SimpleError

java.lang.Object
Localiser.algorithms.locErrors.SimpleError
All Implemented Interfaces:
LocaliserError

public class SimpleError extends Object implements LocaliserError
Simple error class. Stores a perpendicular, parallel and depth error and an angle for the perpindicular error.
The perpendicular error is perpendicular to a track line if one exists. Otherwise it points in the y axis direction. Parallel error is parallel to a track line or if no track line exists it is in the x direction. The direction of the depth error remains the same no matter the track line.
Author:
Jamie Macaulay
  • Constructor Details

    • SimpleError

      public SimpleError(Double[] xyzError)
      /** Create a simple error.
      Parameters:
      xyzError - - an array of the x/perpindicular y/parallel and z error in meters {x y z}
    • SimpleError

      public SimpleError(Double[] xyzError, Double angle)
      Create a simple error.
      Parameters:
      xyzError - - an array of the x/perpindicular y/parallel and z error in meters {x y z}
      angle - the angle of the perpindicular error in RADIANS.
    • SimpleError

      public SimpleError(Double x, Double y, Double z, Double angle)
      Create a simple error.
      Parameters:
      x - - the x/perpendicualar error in meters
      y - - the y/parallel error in meters
      z - - the z error in meters
      angle - - the angle of the perpendicular error in RADIANS
  • Method Details

    • getError

      public double getError(PamVector errorDirection)
      Get a simple error. This is slightly more difficult for simple errors as there is a lack of reference info. An elliptical fit cannot be used bacause a perpindicular and parallel error cannot describe an error ellipse of unknown orientation. Therefore only three inputs are possible here LocaliserError.xdirVec, LocaliserError.ydirVec and LocaliserError.zdirVec. Otherwise NaN will be returned.
      Specified by:
      getError in interface LocaliserError
      Parameters:
      errorDirection - - the direction of the error.
      Returns:
      the value of the error in the direction specified.
    • getJsonErrorString

      public String getJsonErrorString()
      Specified by:
      getJsonErrorString in interface LocaliserError
      Returns:
      Error in a JSON format for writing to database.
    • getErrorDraw

      public LocErrorGraphics getErrorDraw()
      Description copied from interface: LocaliserError
      Functions fro drawing the localisation error
      Specified by:
      getErrorDraw in interface LocaliserError
      Returns:
      a class containing fucntion to draw localisation error with.
    • getErrorDirection

      public PamVector getErrorDirection()
      Description copied from interface: LocaliserError
      Get the real world error direction. e.g. if the error is relative to north this will be [0,1,0] as per the PAMGuard co-ordinate system. If the error is relative to a boat heading then the vector will describe the direction of the boat. Used primarily to geo reference errors.
      Specified by:
      getErrorDirection in interface LocaliserError
      Returns:
      the real world error direction.
    • getStringResult

      public String getStringResult()
      Description copied from interface: LocaliserError
      A description of the loclaisation error.
      Specified by:
      getStringResult in interface LocaliserError
      Returns:
      locisation error.
    • formatErrorValue

      public String formatErrorValue(Double err)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getPerpError

      public Double getPerpError()
    • getParallelError

      public Double getParallelError()
    • setPerpVector

      public void setPerpVector(PamVector errorVector)
    • setPerpAngle

      public void setPerpAngle(double errorAngle)
    • getPerpAngle

      public Double getPerpAngle()
    • getDepthError

      public Double getDepthError()
    • getErrorMagnitude

      public double getErrorMagnitude()
      Specified by:
      getErrorMagnitude in interface LocaliserError
      Returns:
      the total of the magnitude of the error in all directions.