uavsim.datatypes
Class Attitude

java.lang.Object
  extended by uavsim.datatypes.Attitude
All Implemented Interfaces:
java.lang.Comparable<Attitude>, I_Unitable<Attitude>

public class Attitude
extends java.lang.Object
implements I_Unitable<Attitude>

Defines attitude in three degrees of freedom for pitch, roll, and yaw.

Author:
Dan Tappan [18.06.11]

Field Summary
(package private)  AttitudePitch _pitch
          the pitch
(package private)  AttitudeRoll _roll
          the roll
(package private)  AttitudeYaw _yaw
          the yaw
static Attitude NEUTRAL
          zzz
 
Constructor Summary
Attitude()
          Creates an attitude object with the defaults defined for each of the degrees of freedom.
Attitude(AttitudePitch pitch)
          Creates an attitude object as defined for its degrees of freedom.
Attitude(AttitudePitch pitch, AttitudeRoll roll)
          Creates an attitude object as defined for its degrees of freedom.
Attitude(AttitudePitch pitch, AttitudeRoll roll, AttitudeYaw yaw)
          Creates an attitude object as defined for its degrees of freedom.
Attitude(AttitudePitch pitch, AttitudeYaw yaw)
          Creates an attitude object as defined for its degrees of freedom.
Attitude(AttitudeRoll roll)
          Creates an attitude object as defined for its degrees of freedom.
Attitude(AttitudeRoll roll, AttitudeYaw yaw)
          Creates an attitude object as defined for its degrees of freedom.
Attitude(AttitudeYaw yaw)
          Creates an attitude object as defined for its degrees of freedom.
 
Method Summary
 Attitude add_(Attitude attitude)
          Adds another unit to this one.
 int compareTo(Attitude attitude)
          always returns 0
 AttitudePitch getPitch()
          Gets the pitch as a mutable object.
 AttitudeRoll getRoll()
          Gets the roll as a mutable object.
 double getValue_()
          Returns the numerical value of this unit.
 AttitudeYaw getYaw()
          Gets the yaw as a mutable object.
 Attitude subtract_(Attitude attitude)
          Subtract another unit from this one.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_pitch

AttitudePitch _pitch
the pitch


_roll

AttitudeRoll _roll
the roll


_yaw

AttitudeYaw _yaw
the yaw


NEUTRAL

public static final Attitude NEUTRAL
zzz

Constructor Detail

Attitude

public Attitude()
Creates an attitude object with the defaults defined for each of the degrees of freedom.


Attitude

public Attitude(AttitudePitch pitch)
Creates an attitude object as defined for its degrees of freedom.

Parameters:
pitch - - the pitch

Attitude

public Attitude(AttitudePitch pitch,
                AttitudeRoll roll)
Creates an attitude object as defined for its degrees of freedom.

Parameters:
pitch - - the pitch
roll - - the roll

Attitude

public Attitude(AttitudePitch pitch,
                AttitudeRoll roll,
                AttitudeYaw yaw)
Creates an attitude object as defined for its degrees of freedom.

Parameters:
pitch - - the pitch
roll - - the roll
yaw - - the yaw

Attitude

public Attitude(AttitudePitch pitch,
                AttitudeYaw yaw)
Creates an attitude object as defined for its degrees of freedom.

Parameters:
pitch - - te pitch
yaw - - the yaw

Attitude

public Attitude(AttitudeRoll roll)
Creates an attitude object as defined for its degrees of freedom.

Parameters:
roll - - the roll

Attitude

public Attitude(AttitudeRoll roll,
                AttitudeYaw yaw)
Creates an attitude object as defined for its degrees of freedom.

Parameters:
roll - - the roll
yaw - - the yaw

Attitude

public Attitude(AttitudeYaw yaw)
Creates an attitude object as defined for its degrees of freedom.

Parameters:
yaw - - the yaw
Method Detail

add_

public Attitude add_(Attitude attitude)
Adds another unit to this one.

Specified by:
add_ in interface I_Unitable<Attitude>
Parameters:
attitude - - the unit
Returns:
the result as a new unit

compareTo

public int compareTo(Attitude attitude)
always returns 0

Specified by:
compareTo in interface java.lang.Comparable<Attitude>

getPitch

public AttitudePitch getPitch()
Gets the pitch as a mutable object.

Returns:
the pitch

getRoll

public AttitudeRoll getRoll()
Gets the roll as a mutable object.

Returns:
the roll

getValue_

public double getValue_()
Returns the numerical value of this unit. The result is always zero.

Specified by:
getValue_ in interface I_Unitable<Attitude>
Returns:
the value

getYaw

public AttitudeYaw getYaw()
Gets the yaw as a mutable object.

Returns:
the yaw

subtract_

public Attitude subtract_(Attitude attitude)
Subtract another unit from this one.

Specified by:
subtract_ in interface I_Unitable<Attitude>
Parameters:
attitude - - the unit
Returns:
the result as a new unit

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object