GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > ATT / V1-3-1

Constituent: att_debug     Tag: rad750


Interface   Data Structures   File List   Data Fields   Globals  

ATT.h File Reference

LAT Attitude Processing Package. More...

#include "ATT/ATT_msg.h"
#include "PBS/WCT.h"

Include dependency graph for ATT.h:

This graph shows which files directly or indirectly include this file:


Attitude Processing Control Functions

ATT_ControlATT_get (void)
 Get pointer to attitude processing global handle.
unsigned int ATT_init (ATT_Control *ctl, unsigned int numSecs)
 Initialize global attitude processing handle.
unsigned int ATT_exit (ATT_Control *ctl)
 Shutdown the attitude processing global handle.
unsigned int ATT_reset (ATT_Control *ctl)
 Reset the attitude processing global handle.
unsigned int ATT_update (ATT_Control *ctl, const WCT_time t, const double *Q, const float *W)
 Update attitude history list.
unsigned int ATT_lookup (ATT_Control *ctl, const WCT_time t, double *Q)
 Lookup attitude information in history list.
unsigned int ATT_range (ATT_Control *ctl, WCT_time *tBottom, WCT_time *tTop)
 Get current time range of history list.
unsigned int ATT_xform (ATT_Control *ctl, const WCT_time t, const double *Vl, double *Vj)
 Trasform a vector from LAT coordinates to J2000 coordinates.

Vector Utility Functions

void ATT_vec_cart_to_sphr_rad (const double *Vc, double *Vs)
 Transform a cartesian vector to spherical (ra,dec) coordinates (radians).
void ATT_vec_cart_to_sphr_deg (const double *Vc, double *Vs)
 Transform a cartesian vector to spherical (ra,dec) coordinates (degrees).
double ATT_vec_magnitude (const double *V)
 Get a vector magnitude.
void ATT_vec_normalize (double *V)
 Normallize a vector.

Quaternion Utility Functions

void ATT_quat_multiply (double *Qr, const double *Qa, const double *Qb)
 Multiply two quaternions.
double ATT_quat_magnitude (const double *Q)
 Get a quaternion magnitude.
void ATT_quat_normalize (double *Q)
 Normallize a quaternion.
void ATT_quat_conjugate (double *Qr, const double *Qa)
 Get a quaternion conjugate.

Vector Transform Functions

void ATT_xform_vec_by_quat (double *Ve, const double *Q, const double *Vl)
 Tranform vector coordinates from LAT to J2000.

Typedefs

typedef _ATT_Control ATT_Control

Detailed Description

LAT Attitude Processing Package.

Author:
D.L. Wood
This library contains functions and definitions for manipulating and transforming vectors in LAT instrument body coordinates to vectors in J2000 coordinates. The ultimate goal is to produce a vector in J2000 coordinates (RA, DEC) for any given cartesian vector in LAT local coordinates.

The attitude information is input in the form of an attidude state vector which consists of a:

  1. Timestamp as a 64-bit WCT value
  2. Four element SC-J2000 attitude quaternion
  3. Three element SC angular velocity vector

This information is provided to the LAT from the SC GNC system. The attitude library maintains a short time history of the attitude information to allow for vector transformations at arbitrary times in the recent past. Call the function ATT_update() to inform the attitude processing software of a new message available from the SC.


Typedef Documentation

ATT_Control
 

The type for the global attitude processing control descriptor.


Function Documentation

unsigned int ATT_exit ATT_Control ctl  ) 
 

Shutdown the attitude processing global handle.

This releases any global resources allocated in the call to ATT_init().

Parameters:
ctl A pointer to the ATT global control structure.
Returns:
A ATT MSG code.

ATT_Control * ATT_get void   ) 
 

Get pointer to attitude processing global handle.

This function returns a pointer which may be passed as a parameter to the other functions in this library. The function ATT_init() must be called for this pointer before the other library functions are available.

Returns:
A pointer to the global instance of the attitude processing control structure.

unsigned int ATT_init ATT_Control ctl,
unsigned int  numSecs
 

Initialize global attitude processing handle.

This function initializes the global attitude processing control state.

Parameters:
ctl A pointer to the ATT global control structure.
numSecs (Obsolete) The number of seconds backwards to maintain in the attitude history list. Starting with ATT package version V1-3-0, this parameter value is is ignored. Instead, the length of the attitude history list is obtained from the ATT_DB/att_data CDM database.
Returns:
A ATT MSG code.

unsigned int ATT_lookup ATT_Control ctl,
const WCT_time  t,
double *  Q
 

Lookup attitude information in history list.

This function looks up the information stored for time t in the attitude history list.

Parameters:
ctl A pointer to the ATT global control structure.
t The timestamp for the attitude information.
Q SC-J2000 quaternion for time t is placed here on successful return:
Q[0] = q1 (x)
Q[1] = q2 (y)
Q[2] = q3 (z)
Q[3] = q4 (w)
.
Returns:
An ATT MSG code.

void ATT_quat_conjugate double *  Qr,
const double *  Qa
 

Get a quaternion conjugate.

Returns the conjugate of quaternion Qa in Qr.

Parameters:
Qa Input quaternion.
Qa[0] = q1 (x)
Qa[1] = q2 (y)
Qa[2] = q3 (z)
Qa[3] = q4 (w)
Qr Output conjugate quaternion.
Qr[0] = q1 (x)
Qr[1] = q2 (y)
Qr[2] = q3 (z)
Qr[3] = q4 (w)

double ATT_quat_magnitude const double *  Q  ) 
 

Get a quaternion magnitude.

Returns the magnitude of quaternion Q.

Parameters:
Q Input quaternion.
Q[0] = q1 (x)
Q[1] = q2 (y)
Q[2] = q3 (z)
Q[3] = q4 (w)
Returns:
The magnitude of Q.

void ATT_quat_multiply double *  Qr,
const double *  Qa,
const double *  Qb
 

Multiply two quaternions.

Multilplies the quaternion Qa by quaternion Qb and stores the result in Qr. Qr = Qb x Qa. This operation is not commutative.

Parameters:
Qa Input quaternion.
Qa[0] = q1 (x)
Qa[1] = q2 (y)
Qa[2] = q3 (z)
Qa[3] = q4 (w)
Qb Input quaternion.
Qb[0] = q1 (x)
Qb[1] = q2 (y)
Qb[2] = q3 (z)
Qb[3] = q4 (w)
Qr Output quaternion product.
Qr[0] = q1 (x)
Qr[1] = q2 (y)
Qr[2] = q3 (z)
Qr[3] = q4 (w)

void ATT_quat_normalize double *  Q  ) 
 

Normallize a quaternion.

Modifies quaternion Q so that the result has magnitude '1'. This function works in place.

Parameters:
Q Input quaternion.
Q[0] = q1 (x)
Q[1] = q2 (y)
Q[2] = q3 (z)
Q[3] = q4 (w)

unsigned int ATT_range ATT_Control ctl,
WCT_time *  tBottom,
WCT_time *  tTop
 

Get current time range of history list.

This function looks up current range of times in the attitude history list.

Parameters:
ctl A pointer to the ATT global control structure.
tBottom Stores the bottom (earliest) time from the history list.
tTop Stores the top (latest) time from the history list.
Returns:
An ATT MSG code.

unsigned int ATT_reset ATT_Control ctl  ) 
 

Reset the attitude processing global handle.

This clears the attitude history list current entries and resets the history list to its initial state.

Parameters:
ctl A pointer to the ATT global control structure.
Returns:
A ATT MSG code.

unsigned int ATT_update ATT_Control ctl,
const WCT_time  t,
const double *  Q,
const float *  W
 

Update attitude history list.

This function updates the tail of the attitude history list.

Parameters:
ctl A pointer to the ATT global control structure.
t The timestamp for the attitude information.
Q SC-J2000 quaternion for time t.
Q[0] = q1 (x)
Q[1] = q2 (y)
Q[2] = q3 (z)
Q[3] = q4 (w)
.
W The SC angular velocity vector for time t (units rad/sec).
W[0] = wx
W[1] = wy
W[2] = wz
Returns:
An ATT MSG code.

void ATT_vec_cart_to_sphr_deg const double *  Vc,
double *  Vs
 

Transform a cartesian vector to spherical (ra,dec) coordinates (degrees).

Transforms the vector Vc in (x,y,z) cartesian coordinates into the vector Vs in (ra,dec) spherical coordinates. Vs is returned in degrees.

Parameters:
Vc The input vector in cartisian coordinates.
Vc[0] = x
Vc[1] = y
Vc[2] = z
Vs The output vector in spherical coordinates.
Vs[0] = ra
Vs[1] = dec

void ATT_vec_cart_to_sphr_rad const double *  Vc,
double *  Vs
 

Transform a cartesian vector to spherical (ra,dec) coordinates (radians).

Transforms the vector Vc in (x,y,z) cartesian coordinates into the vector Vs in (ra,dec) spherical coordinates. Vs is returned in radians.

Parameters:
Vc The input vector in cartisian coordinates.
Vc[0] = x
Vc[1] = y
Vc[2] = z
Vs The output vector in spherical coordinates.
Vs[0] = ra
Vs[1] = dec

double ATT_vec_magnitude const double *  V  ) 
 

Get a vector magnitude.

Returns the magnitude of vector V.

Parameters:
V Input vector.
V[0] = x
V[1] = y
V[2] = z
Returns:
The magnitude of V.

void ATT_vec_normalize double *  V  ) 
 

Normallize a vector.

Modifies vector V so that the result has magnitude '1'. This function works in place.

Parameters:
V Input vector.
V[0] = x
V[1] = y
V[2] = z

unsigned int ATT_xform ATT_Control ctl,
const WCT_time  t,
const double *  Vl,
double *  Vj
 

Trasform a vector from LAT coordinates to J2000 coordinates.

This function transforms a vector Vl input in LAT instrument coordiates into a vector Vj in J200 coordinates. The timestamp t is used to lookup the attitude information in the global history list. The SC-J2000 quaternion returned by the lookup is then applied to Vl to produce Vj. The timestamp should correspond to the time at which the transform for Vl should be performed.

Parameters:
ctl A pointer to the ATT global control structure.
t The timestamp for the attitude information.
Vl Input vector in LAT coordinates.
Vl[0] = x
Vl[1] = y
Vl[2] = z
Vj Output vector in J2000 coordinates.
Vj[0] = x
Vj[1] = y
Vj[2] = z
Returns:
An ATT MSG code.

void ATT_xform_vec_by_quat double *  Ve,
const double *  Q,
const double *  Vl
 

Tranform vector coordinates from LAT to J2000.

Performs coordinate transformation on the vector Vl, which is assumed to be a cartiesian vector in LAT instrument local coordinates (SC body coordinates). The information in quaternion Q is used to transform the vector coordinates into J2000 (ECI) coordinates. The resulting vector coordinates are stored in Ve.

Parameters:
Q Input quaternion.
Q[0] = q1 (x)
Q[1] = q2 (y)
Q[2] = q3 (z)
Q[3] = q4 (w)
Vl Input vector in LAT coordinates.
Vl[0] = x
Vl[1] = y
Vl[2] = z
Ve Output vector in J2000 coordinates.
Ve[0] = x
Ve[1] = y
Ve[2] = z


Generated on Wed Jun 13 05:50:43 2007 by  doxygen 1.4.4