GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> ATT / V1-3-2 > att / rhel4-32


Interface   Data Structures   File List   Data Fields   Globals  

ATT_control.c File Reference

Attitude processing control and transform functions. More...

#include <ATT/ATT.h>
#include <PBS/MBA.h>
#include <PBS/WCT.h>
#include <PBS/MTX.h>
#include <PBS/Q.h>
#include <MSG/MSG_pubdefs.h>
#include <CDM/CDM_pubdefs.h>
#include <ATT_DB/ATT_DB_schema.h>
#include <ATT_private.h>
#include <string.h>

Defines

#define ATT_TIME_RNG_LIMIT   (WCT_time)(WCT_K_NSECS_IN_A_MSEC * 1000)

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_xform (ATT_Control *ctl, const WCT_time t, const double *Vl, double *Vj)
 Trasform a vector from LAT coordinates to J2000 coordinates.
unsigned int ATT_range (ATT_Control *ctl, WCT_time *tBottom, WCT_time *tTop)
 Get current time range of history list.

Variables

static ATT_Control attControl
static const ATT_DB_Schema configData


Detailed Description

Attitude processing control and transform functions.

Author:
D.L. Wood

Define Documentation

#define ATT_TIME_RNG_LIMIT   (WCT_time)(WCT_K_NSECS_IN_A_MSEC * 1000)

The number of nanoseconds to allow a transform past the current time.

Referenced by ATT_lookup().


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.

References _ATT_Control::check, _ATT_Control::history_head, _ATT_Control::history_list, and _ATT_Control::history_lock.

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.

References ATT_MSG_PER_SEC, ATT_reset(), _ATT_Control::check, _ATT_Control::config, configData, _ATT_Control::history_list, _ATT_Control::history_lock, and _ATT_Control::max_entries.

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.

References ATT_TIME_RNG_LIMIT, _ATT_Control::check, _ATT_Control::cur_entries, _ATT_Control::history_head, _ATT_Control::history_lock, _ATT_History::node, _ATT_History::Q, and _ATT_History::t.

Referenced by ATT_xform().

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.

References _ATT_Control::check, _ATT_Control::cur_entries, _ATT_Control::history_head, _ATT_Control::history_lock, and _ATT_History::t.

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.

References _ATT_Control::check, _ATT_Control::cur_entries, _ATT_Control::history_head, _ATT_Control::history_list, _ATT_Control::history_lock, and _ATT_Control::max_entries.

Referenced by ATT_init().

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.

References ATT_quat_multiply(), _ATT_Control::check, _ATT_Control::config, _ATT_Control::cur_entries, _ATT_Control::history_head, _ATT_Control::history_list, _ATT_Control::history_lock, _ATT_Control::max_entries, _ATT_History::node, _ATT_History::Q, and _ATT_History::t.

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.

References ATT_lookup(), ATT_xform_vec_by_quat(), and _ATT_Control::check.


Variable Documentation

attControl [static]

The global instance of the attitude processing control structure.

configData [static]

Initial value:

{
        
    
    {
                0.0,    
                0.0,    
                0.0,    
                1.0,    
        },
        
        
        
        10,
}
Default config values if CDM database is not found.

Referenced by ATT_init().


Generated on Fri Sep 30 18:26:03 2011 by  doxygen 1.5.8