OpenTracker

An Open Architecture for Reconfigurable Tracking based on XML | Contact

ot::Bird Class Reference

This class is a datatype helper class for the FOBModule class. More...

Collaboration diagram for ot::Bird:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Bird (int number_, const std::string &device_, float scale_, float *anglealign_=NULL)
void convert ()
void convert (const char *buffer)
int parse (const char *buffer, int len, int framesize)
int open ()
int write (const char *data, int count)
int read (char *data, int count)
int close ()
int reset ()
int setGroupMode (const bool value)
int getErrorCode ()
int autoConfig (const int number)
void sleep ()
void setReportMode (const int toBird=-1)
void setScale (const int scale, const int toBird=-1)
void setXYZFrame (const bool useFrame, const int toBird=-1)
void setHemisphere (const FOBModule::Hemisphere hemisphere, const int toBird=-1)
void setAngleAlign (const float *angles, const int toBird=-1)
void setReferenceFrame (const float *angles, const int toBird=-1)
int sendReset ()

Public Attributes

int number
SerialPort port
char buffer [20]
int count
FOBSourcesource
Event event
bool newVal
float scale
float angleAlign [3]

Static Public Attributes

static const float inchesToMeters = 0.0254f

Detailed Description

This class is a datatype helper class for the FOBModule class.

It stores the relevant data for a single bird station and provides buffer storage and conversion routines.

Author:
Thomas Peterseil

Definition at line 70 of file FOBModule.cxx.


Constructor & Destructor Documentation

ot::Bird::Bird ( int  number_,
const std::string &  device_,
float  scale_,
float *  anglealign_ = NULL 
) [inline]

constructor

Definition at line 104 of file FOBModule.cxx.

References angleAlign, count, event, ot::Event::getConfidence(), inchesToMeters, newVal, SerialPort::pathname, port, scale, and source.


Member Function Documentation

int ot::Bird::autoConfig ( const int  number  )  [inline]

Definition at line 919 of file FOBModule.cxx.

References buffer, getErrorCode(), ot::OSUtils::sleep(), and write().

Referenced by ot::FOBModule::initFoB().

int ot::Bird::close (  )  [inline]

closes the serial port associated with the bird.

Returns:
the error value from the serial library.

Definition at line 878 of file FOBModule.cxx.

References closeSerialPort(), and port.

void ot::Bird::convert ( const char *  buffer  )  [inline]

converts data from another buffer and writes it to the local event member.

It assumes that data is in the POSITION/QUATERNION format.

Parameters:
buffer pointer to the char buffer storing the input data.

Definition at line 802 of file FOBModule.cxx.

References event, ot::Event::getOrientation(), ot::Event::getPosition(), scale, and ot::Event::timeStamp().

void ot::Bird::convert (  )  [inline]

converts the buffer data and writes it to the local event member

Definition at line 797 of file FOBModule.cxx.

References buffer.

int ot::Bird::getErrorCode (  )  [inline]

Definition at line 901 of file FOBModule.cxx.

References buffer, count, read(), ot::OSUtils::sleep(), and write().

Referenced by autoConfig(), sendReset(), and setGroupMode().

int ot::Bird::open (  )  [inline]

opens the serial port associated with the bird.

Returns:
the error value from the serial library.

Definition at line 853 of file FOBModule.cxx.

References SerialParams::baudrate, SerialParams::bits, SerialParams::blocking, SerialParams::hwflow, initSerialParams(), openSerialPort(), SerialParams::parity, SerialPort::pathname, SerialParams::pathname, port, SerialParams::sbit, and SerialParams::swflow.

int ot::Bird::parse ( const char *  buffer,
int  len,
int  framesize 
) [inline]

reads data from an input buffer into the internal buffer.

this method looks for the phasing bit and then starts to read in data until the input buffer ends, or it has read a whole frame. If the frame is completed it sets the flag newVal to true.

Parameters:
buffer input buffer
len length of the input buffer
framesize size of the frame for the current mode
Returns:
the number of chars read from the buffer

Definition at line 827 of file FOBModule.cxx.

References buffer, and count.

Referenced by ot::FOBModule::run().

int ot::Bird::read ( char *  data,
int  count 
) [inline]

reads data from the serial port associated with the bird.

Parameters:
data pointer to the char data buffer to read into
count maximal number of chars to read
Returns:
the error value from the serial library.

Definition at line 873 of file FOBModule.cxx.

References port, and readfromSerialPort().

Referenced by getErrorCode(), and ot::FOBModule::run().

int ot::Bird::reset (  )  [inline]

toggles some lines on the serial interface to reset the bird.

Returns:
the error value from the serial library.

Definition at line 883 of file FOBModule.cxx.

References port, setRTSSerialPort(), and ot::OSUtils::sleep().

int ot::Bird::sendReset (  )  [inline]

Definition at line 1074 of file FOBModule.cxx.

References buffer, getErrorCode(), ot::OSUtils::sleep(), and write().

void ot::Bird::setAngleAlign ( const float *  angles,
const int  toBird = -1 
) [inline]

Definition at line 1038 of file FOBModule.cxx.

References buffer, number, ot::MathUtils::Pi, and write().

int ot::Bird::setGroupMode ( const bool  value  )  [inline]

Definition at line 890 of file FOBModule.cxx.

References buffer, getErrorCode(), ot::OSUtils::sleep(), and write().

Referenced by ot::FOBModule::initFoB().

void ot::Bird::setHemisphere ( const FOBModule::Hemisphere  hemisphere,
const int  toBird = -1 
) [inline]

void ot::Bird::setReferenceFrame ( const float *  angles,
const int  toBird = -1 
) [inline]

Definition at line 1056 of file FOBModule.cxx.

References buffer, number, ot::MathUtils::Pi, and write().

void ot::Bird::setReportMode ( const int  toBird = -1  )  [inline]

Definition at line 937 of file FOBModule.cxx.

References buffer, number, and write().

void ot::Bird::setScale ( const int  scale,
const int  toBird = -1 
) [inline]

Definition at line 953 of file FOBModule.cxx.

References buffer, number, and write().

void ot::Bird::setXYZFrame ( const bool  useFrame,
const int  toBird = -1 
) [inline]

Definition at line 975 of file FOBModule.cxx.

References buffer, number, and write().

void ot::Bird::sleep (  )  [inline]

Definition at line 930 of file FOBModule.cxx.

References buffer, ot::OSUtils::sleep(), and write().

int ot::Bird::write ( const char *  data,
int  count 
) [inline]

writes data to the serial port associated with the bird.

Parameters:
data pointer to the char data to write
count number of chars to write
Returns:
the error value from the serial library.

Definition at line 868 of file FOBModule.cxx.

References port, and writetoSerialPort().

Referenced by autoConfig(), getErrorCode(), sendReset(), setAngleAlign(), setGroupMode(), setHemisphere(), setReferenceFrame(), setReportMode(), setScale(), setXYZFrame(), and sleep().


Member Data Documentation

anglealign data

Definition at line 101 of file FOBModule.cxx.

Referenced by Bird().

number of the current position in the buffer

Definition at line 86 of file FOBModule.cxx.

Referenced by Bird(), getErrorCode(), parse(), and ot::FOBModule::run().

the local event buffer event

Definition at line 92 of file FOBModule.cxx.

Referenced by Bird(), and convert().

const float ot::Bird::inchesToMeters = 0.0254f [static]

constant to convert inches to meters

Definition at line 74 of file FOBModule.cxx.

Referenced by Bird().

flag indicating a new value in event

Definition at line 95 of file FOBModule.cxx.

Referenced by Bird().

the bird number

Definition at line 77 of file FOBModule.cxx.

Referenced by setAngleAlign(), setHemisphere(), setReferenceFrame(), setReportMode(), setScale(), and setXYZFrame().

port structure for the serial port data

Definition at line 80 of file FOBModule.cxx.

Referenced by Bird(), close(), open(), read(), reset(), and write().

total range of positions

Definition at line 98 of file FOBModule.cxx.

Referenced by Bird(), and convert().

associated source node

Definition at line 89 of file FOBModule.cxx.

Referenced by Bird().


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

copyright (c) 2006 Graz University of Technology