Real-Time Java AOCS Framework v1.0 API Specification

RtjAocsFramework.AocsData
Class AocsData

java.lang.Object
  |
  +--RtjAocsFramework.BasicObjects.RootObject
        |
        +--RtjAocsFramework.BasicObjects.AocsObject
              |
              +--RtjAocsFramework.AocsData.AocsData
All Implemented Interfaces:
Configurable, ConsistencyCheckable, DataSink, DataSource, Monitorable, Resettable, Telemeterable

public class AocsData
extends AocsObject
implements ConsistencyCheckable, DataSource, DataSink, Monitorable

Base class from which all AOCS data types are derived. An AOCS data is a data structure to hold a settable number of values that can be treated as a single unit. AOCS data act as data sources and data sinks with respect to each of their elemetary values. Time tags are attached to these elemetary values that define the time when the datum was last set. A metric distance is defined between AOCS data.

Subclasses of AocsData may be used define categories of AOCS data with different semantics (3-vectors, quaternions, sets of 3 Euler angles, etc). Class AocsData defines a generic n-vector (with n settable) in Euclidean space. A particular category of AOCS data is identified by its format. In the current implementation, the format is set equal to the class identifier.

Change Record:

Copyright: see the Copyright Notice.

Version:
1.2
Author:
Alessandro Pasetti (University of Konstanz)

Field Summary
 
Fields inherited from interface RtjAocsFramework.TelemetryManagement.Telemeterable
DEBUG_TM, LONG_TM, NORMAL_TM, NTMFORMATS, SHORT_TM
 
Constructor Summary
AocsData()
          Default constructor (set number of data items before using object!).
AocsData(int numberOfDataItems)
          Constructor that initializes the number of data stored in the datum.
 
Method Summary
 boolean close(AocsData d)
          Returns true if the AOCS datum is close to d.
 double distance(AocsData d)
          Return the distance between this AOCS datum and AOCS datum d.
 boolean doConsistencyCheck()
          Some categories of AOCS data can check their internal consistency.
 AocsObject getAocsObject()
          Return the property owner as an instance of type AocsObject.
 int getEarliestTimeTag()
          Return the earliest of the data item time tags
 byte getFormat()
          The format of an AOCS datum is concides with the identifier of its class
 int getLatestTimeTag()
          Return the most recent of the data item time tags
 double getMonitorablePropertyValue(int i)
          Return the value of the i-th property.
 int getNumberOfInputs()
          Return the number of data items.
 int getNumberOfItems()
          Return the number of data items.
 int getNumberOfMonitorableProperties()
          Return the total number of monitorable properties exposed by the object.
 int getNumberOfOutputs()
          Return the number of data items.
 double getOutput(int i)
          Return the value of the i-th data item.
 RecoveryAction getRecoveryAction()
          Get the recovery action associated to the consistency check.
 int getTelemetryImageLength()
          Return the length (in bits) of the telemetry image of the object.
 int getTimeTag(int i)
          Return the time tag of the i-th data item.
 boolean isConfigured()
          Return false if some configuration data are missing.
 double normalize()
          Normalize the AOCS datum.
 void reset()
          Bring the resettable state of the object to its initial default value.
 void resetConfiguration()
          Clear all configuration information.
 void setClosenessThreshold(double epsilon)
          The closeness threshold determines when two AOCS data are considered 'close'.
 void setInput(double newValue, int i)
          Set the i-th data item and update its time tag.
 void setNormalizationThreshold(double newThreshold)
          The normalization threshold determines when an AOCS datum should be normalized.
 void setNumberOfDataItems(int n)
          Initialization method to set the number of data item.
 void setRecoveryAction(RecoveryAction r)
          Set the recovery action associated to the consistency check.
 double size()
          Return the size of the AOCS datum.
 void writeToTelemetry(TelemetryStream tmStream)
          Direct the object to write its own state to the telemetry stream.
 
Methods inherited from class RtjAocsFramework.BasicObjects.AocsObject
addConfigurationListener, addFailureListener, finalize, getAocsClock, getConfigurationListenerList, getCycle, getDestructionRecoveryAction, getFailureListenerList, getSystemManager, getTelemetryFormat, getTime, removeConfigurationListener, removeFailureListener, reportConfigurationEvent, reportFailure, resetStaticConfiguration, setAocsClock, setDestructionRecoveryAction, setMaxNumberOfConfigurationListeners, setMaxNumberOfFailureListeners, setSystemManager, setTelemetryFormat
 
Methods inherited from class RtjAocsFramework.BasicObjects.RootObject
getClassId, getInstanceId, setClassId
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AocsData

public AocsData()
Default constructor (set number of data items before using object!).


AocsData

public AocsData(int numberOfDataItems)
Constructor that initializes the number of data stored in the datum.

Method Detail

setNumberOfDataItems

public void setNumberOfDataItems(int n)
Initialization method to set the number of data item. This method must be called before the object can be used. It completes the construction of the object by allocating memory for its internal buffers.


getOutput

public double getOutput(int i)
Return the value of the i-th data item.

Specified by:
getOutput in interface DataSource

getNumberOfOutputs

public int getNumberOfOutputs()
Return the number of data items.

Specified by:
getNumberOfOutputs in interface DataSource

getNumberOfInputs

public int getNumberOfInputs()
Return the number of data items.

Specified by:
getNumberOfInputs in interface DataSink

setInput

public void setInput(double newValue,
                     int i)
Set the i-th data item and update its time tag.

Specified by:
setInput in interface DataSink

getNumberOfItems

public int getNumberOfItems()
Return the number of data items. This method is deprecated. Methods getNumberOfInputs and getNumberOfOutputs should be used in its stead.


distance

public double distance(AocsData d)
Return the distance between this AOCS datum and AOCS datum d. The default distance is the Euclidean distance. If d is unassigned, the modulus of the AOCS datum is returned. The two AOCS data between which the distance is computed must be of the same format. If they are not, a configuration error report is generated and a LARGE_DOUBLE value for the distance is returned.


close

public boolean close(AocsData d)
Returns true if the AOCS datum is close to d. Two AOCS data are 'close' if their distance is less than 'closenessThreshold'.

See Also:
setClosenessThreshold(double)

size

public double size()
Return the size of the AOCS datum. The size of an AOCS datum is its distance from the zero-point.


getEarliestTimeTag

public int getEarliestTimeTag()
Return the earliest of the data item time tags


getLatestTimeTag

public int getLatestTimeTag()
Return the most recent of the data item time tags


getTimeTag

public int getTimeTag(int i)
Return the time tag of the i-th data item.


normalize

public double normalize()
Normalize the AOCS datum. Some AOCS data types - vectors, quaternions, and Euler angles - can be normalized. A call to method normalize() causes the normalization to be performed. In the case of a quaternion or unitary vector, for instance, a call to normalize() rescales the elements of the data type to ensure that their quadratic sum evaluates to 1. In the case of Euler angles, method normalize() might instead move all angles to the interval [-180deg, +180deg]. Normalization on instances of class AocsData has no effect and returns 0.

Method normalize() returns a value indicating how far from the normal range the datum was. This return value can be used to perform consistency checks on the data. Thus, for instance, if it was found that the quaternion representing the satellite attitude after integration of the Euler equations had a quadratic sum of, say, 1.1, then it is likely that the integration algorithm is misbehaving and the fact can be reported as an error. A normalization threshold is used to determine whether the AOCS datum should be normalized.

See Also:
setNormalizationThreshold(double)

reset

public void reset()
Description copied from interface: Resettable
Bring the resettable state of the object to its initial default value. A call to method reset on an object A is sometimes propagated to objects that are logically contained in A (relationship of strong aggregation).

Specified by:
reset in interface Resettable
Overrides:
reset in class AocsObject

resetConfiguration

public void resetConfiguration()
Description copied from interface: Configurable
Clear all configuration information.

Calls to resetConfiguration are propagated to objects that are in a relationship of strong aggregation.

Specified by:
resetConfiguration in interface Configurable
Overrides:
resetConfiguration in class AocsObject

isConfigured

public boolean isConfigured()
Description copied from interface: Configurable
Return false if some configuration data are missing.

Typically, a false value indicates that a plug-in component is missing or that the object has not been initialized. This is a negative check only: a return value of true cannot guarantee that the object is correctly configured.

Calls to resetConfiguration on an object A are normally not propagated objects of type AocsObject that are contained or otherwise aggregated to A. The rationale for this policy is that all objects of type AocsObject implement interface configurable and therefore their configuration status should be checked externally (probably through the configuration check service of the system manager).

Specified by:
isConfigured in interface Configurable
Overrides:
isConfigured in class AocsObject

writeToTelemetry

public void writeToTelemetry(TelemetryStream tmStream)
Description copied from interface: Telemeterable
Direct the object to write its own state to the telemetry stream.

Specified by:
writeToTelemetry in interface Telemeterable
Overrides:
writeToTelemetry in class AocsObject

getTelemetryImageLength

public int getTelemetryImageLength()
Description copied from interface: Telemeterable
Return the length (in bits) of the telemetry image of the object. This method is useful to verify that the quantity of data generated by a given object is compatible with the capacity of the telemetry channel.

Specified by:
getTelemetryImageLength in interface Telemeterable
Overrides:
getTelemetryImageLength in class AocsObject

doConsistencyCheck

public boolean doConsistencyCheck()
Some categories of AOCS data can check their internal consistency. The default check returns true (datum is consistent) if method normalize returns a value smaller than normalizationThreshold.

Specified by:
doConsistencyCheck in interface ConsistencyCheckable
Returns:
true if the internal state was found to be consistent, false otherwise
See Also:
normalize(), setNormalizationThreshold(double)

getFormat

public byte getFormat()
The format of an AOCS datum is concides with the identifier of its class


setClosenessThreshold

public void setClosenessThreshold(double epsilon)
The closeness threshold determines when two AOCS data are considered 'close'.

See Also:
close(RtjAocsFramework.AocsData.AocsData)

setNormalizationThreshold

public void setNormalizationThreshold(double newThreshold)
The normalization threshold determines when an AOCS datum should be normalized.

See Also:
normalize()

setRecoveryAction

public void setRecoveryAction(RecoveryAction r)
Description copied from interface: ConsistencyCheckable
Set the recovery action associated to the consistency check.

Specified by:
setRecoveryAction in interface ConsistencyCheckable

getRecoveryAction

public RecoveryAction getRecoveryAction()
Description copied from interface: ConsistencyCheckable
Get the recovery action associated to the consistency check.

Specified by:
getRecoveryAction in interface ConsistencyCheckable

getMonitorablePropertyValue

public double getMonitorablePropertyValue(int i)
Description copied from interface: Monitorable
Return the value of the i-th property. The index i is in the range [0..n-1] where n is the number of the properties exposed by the object. The property value is always assumed to be of type double.

Specified by:
getMonitorablePropertyValue in interface Monitorable

getNumberOfMonitorableProperties

public int getNumberOfMonitorableProperties()
Description copied from interface: Monitorable
Return the total number of monitorable properties exposed by the object.

Specified by:
getNumberOfMonitorableProperties in interface Monitorable

getAocsObject

public AocsObject getAocsObject()
Description copied from interface: Monitorable
Return the property owner as an instance of type AocsObject.

Specified by:
getAocsObject in interface Monitorable

Real-Time Java AOCS Framework v1.0 API Specification

Real-Time Java AOCS Framework project home page

Automatic Control Laboratory, ETH Zuerich
Physikstrasse 3
CH-8092 Zuerich, Switzerland