ot::Bird Class Reference
This class is a datatype helper class for the FOBModule class. More...Collaboration diagram for ot::Bird:

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 |
| FOBSource * | source |
| 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.
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] |
Definition at line 995 of file FOBModule.cxx.
References buffer, ot::FOBModule::FORWARD, ot::FOBModule::LEFT, ot::FOBModule::LOWER, number, ot::FOBModule::REAR, ot::FOBModule::RIGHT, ot::FOBModule::UPPER, and write().
| 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] |
| void ot::Bird::setScale | ( | const int | scale, | |
| const int | toBird = -1 | |||
| ) | [inline] |
| void ot::Bird::setXYZFrame | ( | const bool | useFrame, | |
| const int | toBird = -1 | |||
| ) | [inline] |
| void ot::Bird::sleep | ( | ) | [inline] |
| 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
| float ot::Bird::angleAlign[3] |
| char ot::Bird::buffer[20] |
data buffer for incoming data
Definition at line 83 of file FOBModule.cxx.
Referenced by autoConfig(), convert(), getErrorCode(), parse(), ot::FOBModule::run(), sendReset(), setAngleAlign(), setGroupMode(), setHemisphere(), setReferenceFrame(), setReportMode(), setScale(), setXYZFrame(), and sleep().
| int ot::Bird::count |
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().
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().
| bool ot::Bird::newVal |
flag indicating a new value in event
Definition at line 95 of file FOBModule.cxx.
Referenced by Bird().
| int ot::Bird::number |
the bird number
Definition at line 77 of file FOBModule.cxx.
Referenced by setAngleAlign(), setHemisphere(), setReferenceFrame(), setReportMode(), setScale(), and setXYZFrame().
| float ot::Bird::scale |
The documentation for this class was generated from the following file: