IGSTK
Public Member Functions | Protected Member Functions | List of all members
igstk::AscensionCommandInterpreter Class Reference

#include <igstkAscensionCommandInterpreter.h>

Inheritance diagram for igstk::AscensionCommandInterpreter:
Inheritance graph
[legend]
Collaboration diagram for igstk::AscensionCommandInterpreter:
Collaboration graph
[legend]

Public Member Functions

CommunicationType * GetCommunication ()
 Get the communication object. More...
 
void Open ()
 Open communication with the flock. More...
 
void Stop ()
 Stop and restart the system. More...
 
void Run ()
 
void Close ()
 Close communication with the flock. More...
 
void Reset ()
 Do a hardware reset of the flock. More...
 
void SetHemisphere (AscensionHemisphere hemisphere)
 Set the operational hemisphere of the flock. More...
 
void SetFormat (AscensionDataFormat format)
 Set the data format. More...
 
void SetButtonMode (bool mode)
 Set button state reporting on or off. More...
 
void Point ()
 Request a single data record. More...
 
void Stream ()
 Request that the flock starts streaming data records. More...
 
void EndStream ()
 Request that the flock stops streaming data records. More...
 
void EndStreamIfStreaming ()
 Request that the flock stops streaming data records, but only if it is currently streaming. More...
 
void Update ()
 Get the next data record from the flock. More...
 
unsigned int GetBird ()
 Get the bird that the most recent data record is for. More...
 
void GetPosition (float xyz[3])
 Get the position from the most recent data record, if present. More...
 
void GetAngles (float zyx[3])
 Get the angles from the most recent data record, if present. More...
 
void GetMatrix (float a[9])
 Get the rotation matrix from the most recent data record, if present. More...
 
void GetQuaternion (float q[4])
 Get the quaternion from the most recent data record, if present. More...
 
int GetButton ()
 Get the button state for a transducer that has a button attached. More...
 
void MatrixFromAngles (float a[9], const float zyx[3])
 Convenience method to convert angles to a matrix. More...
 
void AnglesFromMatrix (float zyx[3], const float a[9])
 Convenience method to convert a matrix into angles. More...
 
void FBBReset ()
 Pass a reset to the Flock of Birds Bus to reset all the birds. More...
 
void FBBAutoConfig (unsigned int num)
 Configure the flock to work with a certain number of birds. More...
 
void RS232ToFBB (unsigned int bird)
 Direct the next command to a specific bird on the Flock Of Birds Bus. More...
 
void SendCommand (AscensionCommand command)
 Send a command to the Flock of Birds. More...
 
void SendCommandWords (AscensionCommand command, const short *data)
 Send a command to the Flock of Birds along with some 16-bit data. More...
 
void SendCommandBytes (AscensionCommand command, const char *data)
 Send a command to the Flock of Birds along with some 8-bit data. More...
 
int ExamineValue (AscensionParameter parm)
 Examine a parameter value and return the result. More...
 
int ExamineValueWords (AscensionParameter parm, short *data)
 Examine a parameter value and store the result in the supplied array. More...
 
int ExamineValueBytes (AscensionParameter parm, char *data)
 Examine a parameter value and store the result in the supplied array. More...
 
void ChangeValue (AscensionParameter parm, int data)
 Change a parameter to the specified value. More...
 
void ChangeValueWords (AscensionParameter parm, const short *data)
 Change a parameter to values in the supplied array. More...
 
void ChangeValueBytes (AscensionParameter parm, const char *data)
 Change a parameter to values in the supplied array. More...
 
AscensionErrorCode GetError ()
 Get an integer error code for the flock, zero if no error. More...
 
const char * GetErrorMessage ()
 Get a textual description of the last error from the flock. More...
 
void ButtonRead (int *val)
 Read the button state. More...
 
int GetShort (const char *cp)
 Utilitity function to unpack two chars from the flock into a short. More...
 
void PutShort (char *cp, int val)
 Utility function to convert a short into two chars for the flock. More...
 
- Public Member Functions inherited from igstk::Object
virtual const char * GetNameOfClass () const
 
void SetLogger (LoggerType *logger)
 Connect the Logger for this class. More...
 
void RemoveObserver (unsigned long tag) const
 

Protected Member Functions

 AscensionCommandInterpreter ()
 Constructor. More...
 
virtual ~AscensionCommandInterpreter ()
 Destructor. More...
 
virtual void PrintSelf (std::ostream &os, itk::Indent indent) const
 Print object information. More...
 
- Protected Member Functions inherited from igstk::Object
LoggerTypeGetLogger () const
 
 Object (void)
 Constructor is protected in order to enforce the use of the New() operator. More...
 
virtual ~Object (void)
 
void RegisterObservedObject (const ::igstk::Object *object, unsigned long tag)
 Register observed objects in an internal array so that they can be disconnected upon destruction. More...
 
void RemoveFromObservedObjects ()
 Remove observers that this object may have connected to other objects. More...
 

Additional Inherited Members

- Public Types inherited from igstk::Object
typedef Object Self
 General Typedefs. More...
 
typedef ::itk::Object Superclass
 
typedef ::itk::SmartPointer< SelfPointer
 
typedef ::itk::SmartPointer
< const Self
ConstPointer
 
typedef igstk::Logger LoggerType
 
- Static Public Member Functions inherited from igstk::Object
static Pointer New (void)
 

Detailed Description

Definition at line 301 of file igstkAscensionCommandInterpreter.h.

Constructor & Destructor Documentation

igstk::AscensionCommandInterpreter::AscensionCommandInterpreter ( )
protected

Constructor.

virtual igstk::AscensionCommandInterpreter::~AscensionCommandInterpreter ( )
protectedvirtual

Destructor.

Member Function Documentation

CommunicationType* igstk::AscensionCommandInterpreter::GetCommunication ( )

Get the communication object.

void igstk::AscensionCommandInterpreter::Open ( )

Open communication with the flock.

void igstk::AscensionCommandInterpreter::Stop ( )

Stop and restart the system.

void igstk::AscensionCommandInterpreter::Run ( )
void igstk::AscensionCommandInterpreter::Close ( )

Close communication with the flock.

void igstk::AscensionCommandInterpreter::Reset ( )

Do a hardware reset of the flock.

void igstk::AscensionCommandInterpreter::SetHemisphere ( AscensionHemisphere  hemisphere)

Set the operational hemisphere of the flock.

void igstk::AscensionCommandInterpreter::SetFormat ( AscensionDataFormat  format)

Set the data format.

void igstk::AscensionCommandInterpreter::SetButtonMode ( bool  mode)

Set button state reporting on or off.

void igstk::AscensionCommandInterpreter::Point ( )

Request a single data record.

void igstk::AscensionCommandInterpreter::Stream ( )

Request that the flock starts streaming data records.

void igstk::AscensionCommandInterpreter::EndStream ( )

Request that the flock stops streaming data records.

void igstk::AscensionCommandInterpreter::EndStreamIfStreaming ( )

Request that the flock stops streaming data records, but only if it is currently streaming.

void igstk::AscensionCommandInterpreter::Update ( )

Get the next data record from the flock.

This should only be called after a call to Point(), or after streaming has been started.

unsigned int igstk::AscensionCommandInterpreter::GetBird ( )

Get the bird that the most recent data record is for.

It is very important to check this value to make sure that you are getting data for the right bird.

void igstk::AscensionCommandInterpreter::GetPosition ( float  xyz[3])

Get the position from the most recent data record, if present.

The data format must be FB_POSITION_ANGLES, FB_POSITION_MATRIX, FB_POSITION_QUATERNION, or FB_POSITION.

void igstk::AscensionCommandInterpreter::GetAngles ( float  zyx[3])

Get the angles from the most recent data record, if present.

The data format must be FB_POSITION_ANGLES or FB_ANGLES.

void igstk::AscensionCommandInterpreter::GetMatrix ( float  a[9])

Get the rotation matrix from the most recent data record, if present.

The data format must be FB_POSITION_MATRIX or FB_MATRIX. Since FB_POSITION_ANGLES is the native format and is also the most compact, angles should be preferred over matrices for data transfer.

void igstk::AscensionCommandInterpreter::GetQuaternion ( float  q[4])

Get the quaternion from the most recent data record, if present.

The data format must be FB_POSITION_QUATERNION or FB_QUATERNION. Since FB_POSITION_ANGLES is the native format and is also the most compact, angles should be preferred over quaternions for data transfer.

int igstk::AscensionCommandInterpreter::GetButton ( )

Get the button state for a transducer that has a button attached.

This will return zero unless ButtonMode() has been called to turn on button reporting.

void igstk::AscensionCommandInterpreter::MatrixFromAngles ( float  a[9],
const float  zyx[3] 
)

Convenience method to convert angles to a matrix.

void igstk::AscensionCommandInterpreter::AnglesFromMatrix ( float  zyx[3],
const float  a[9] 
)

Convenience method to convert a matrix into angles.

void igstk::AscensionCommandInterpreter::FBBReset ( )

Pass a reset to the Flock of Birds Bus to reset all the birds.

void igstk::AscensionCommandInterpreter::FBBAutoConfig ( unsigned int  num)

Configure the flock to work with a certain number of birds.

void igstk::AscensionCommandInterpreter::RS232ToFBB ( unsigned int  bird)

Direct the next command to a specific bird on the Flock Of Birds Bus.

void igstk::AscensionCommandInterpreter::SendCommand ( AscensionCommand  command)

Send a command to the Flock of Birds.

void igstk::AscensionCommandInterpreter::SendCommandWords ( AscensionCommand  command,
const short *  data 
)

Send a command to the Flock of Birds along with some 16-bit data.

void igstk::AscensionCommandInterpreter::SendCommandBytes ( AscensionCommand  command,
const char *  data 
)

Send a command to the Flock of Birds along with some 8-bit data.

int igstk::AscensionCommandInterpreter::ExamineValue ( AscensionParameter  parm)

Examine a parameter value and return the result.

int igstk::AscensionCommandInterpreter::ExamineValueWords ( AscensionParameter  parm,
short *  data 
)

Examine a parameter value and store the result in the supplied array.

int igstk::AscensionCommandInterpreter::ExamineValueBytes ( AscensionParameter  parm,
char *  data 
)

Examine a parameter value and store the result in the supplied array.

void igstk::AscensionCommandInterpreter::ChangeValue ( AscensionParameter  parm,
int  data 
)

Change a parameter to the specified value.

void igstk::AscensionCommandInterpreter::ChangeValueWords ( AscensionParameter  parm,
const short *  data 
)

Change a parameter to values in the supplied array.

void igstk::AscensionCommandInterpreter::ChangeValueBytes ( AscensionParameter  parm,
const char *  data 
)

Change a parameter to values in the supplied array.

AscensionErrorCode igstk::AscensionCommandInterpreter::GetError ( )

Get an integer error code for the flock, zero if no error.

If the error is FB_TIMEOUT_ERROR, the bird itself probably has an error that has halted the streaming of data. You can check the status of the flock with ExamineValue(fFB_ERROR_CODE).

const char* igstk::AscensionCommandInterpreter::GetErrorMessage ( )

Get a textual description of the last error from the flock.

void igstk::AscensionCommandInterpreter::ButtonRead ( int *  val)

Read the button state.

You should usually use SetButtonMode() and get the button state with the tracking data records.

int igstk::AscensionCommandInterpreter::GetShort ( const char *  cp)

Utilitity function to unpack two chars from the flock into a short.

void igstk::AscensionCommandInterpreter::PutShort ( char *  cp,
int  val 
)

Utility function to convert a short into two chars for the flock.

virtual void igstk::AscensionCommandInterpreter::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
protectedvirtual

Print object information.

Reimplemented from igstk::Object.


The documentation for this class was generated from the following file: