Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

MoCapLogger Class Reference

Provides display and logging of mocap data. More...

#include <MoCapLogger.h>

Inheritance diagram for MoCapLogger:

Detailed Description

Provides display and logging of mocap data.

Send a text message event "mocap" to report next mocap event on the console. From the Tekkotsu HAL, that would be the command 'msg mocap'.

Logged data is tab delimited with fields: time frame posX posY posZ [ori0 ori1 ori2]

Availability of particular frames or orientation data depends on the data source. Orientation data can be either yaw-pitch-roll (in degrees), or the axis component of the quaternion, depending on the state of rotAxis. Default is yaw-pitch-roll.

Definition at line 24 of file MoCapLogger.h.

List of all members.

Public Member Functions

 MoCapLogger ()
 Constructor.
void dump (std::ostream &os, const MoCapEvent &mce)
 Serialize data from mce into os.
virtual void refresh ()
 called when a child has deactivated and this control should refresh its display, or some other event (such as the user pressing the refresh button) has happened to cause a refresh to be needed
virtual void deactivate ()
 called when this control is being popped from the control stack
virtual ControlBasedoSelect ()
 when the user has trigger an "open selection"
virtual void registered ()
 Add listener for mocap log requests.

Protected Member Functions

void gotMoCapGUI (const MoCapEvent &mce)
 refreshes the ControllerGUI display
void gotMoCapConsole (const MoCapEvent &mce)
 forwards to dump(std::cout, mce)... if not for rotAxis, could make dump() static and just call it directly
void gotMoCapFile (const MoCapEvent &mce)
 forwards to dump(file, mce)... if not for rotAxis, could make dump() static and just call it directly
void gotTxtMsgSingle (const TextMsgEvent &txt)
void gotMoCapSingle (const EventBase &event)
 if receives MoCapEvent, dumps to std::cout, otherwise assumes timer and complains about lack of MoCapEvents

Static Protected Member Functions

static void rename (ControlBase *c, std::ostream &sstream)
 convenience function for updating UI elements

Protected Attributes

TimeET lastRefresh
 limits rate of GUI updates
NullControlx
 displays current x position
NullControly
 displays current y position
NullControlz
 displays current z position
NullControlr0
 displays the first rotation component (heading or x)
NullControlr1
 displays the second rotation component (pitch or y)
NullControlr2
 displays the third rotation component (roll or z)
ToggleControlconsoleLog
 lets user control whether to dump to console
StringInputControlfileLog
 lets user control whether to dump to file
ToggleControlrotAxis
 lets user control whether they want yaw-pitch-roll or the rotation axis
std::ofstream file
 the output stream if dumping to file
std::unique_ptr
< EventCallbackAs< MoCapEvent > > 
mocapGUI
 triggers callback to gotMoCapEvent()
std::unique_ptr
< EventCallbackAs< MoCapEvent > > 
mocapConsole
 triggers callback to gotMoCapConsole()
std::unique_ptr
< EventCallbackAs< MoCapEvent > > 
mocapFile
 triggers callback to gotMoCapFile()
EventCallbackAs< TextMsgEventtxtmsgSingle
 triggers callback to gotTxtMsgSingle()
EventCallback mocapSingle
 activates mocapSingle to dump next mocap event, and a timer to report error

Private Member Functions

 MoCapLogger (const MoCapLogger &o)
 Do not call.
MoCapLoggeroperator= (const MoCapLogger &o)
 Do not call.

Constructor & Destructor Documentation

MoCapLogger::MoCapLogger (  ) 

Constructor.

Definition at line 66 of file MoCapLogger.h.

MoCapLogger::MoCapLogger ( const MoCapLogger o  )  [private]

Do not call.


Member Function Documentation

void MoCapLogger::deactivate (  )  [virtual]

called when this control is being popped from the control stack

Reimplemented from ControlBase.

Definition at line 125 of file MoCapLogger.cc.

ControlBase * MoCapLogger::doSelect (  )  [virtual]

when the user has trigger an "open selection"

default is to return the hilighted control

Reimplemented from ControlBase.

Definition at line 130 of file MoCapLogger.cc.

void MoCapLogger::dump ( std::ostream &  os,
const MoCapEvent mce 
)

Serialize data from mce into os.

Only logs frame which have a position component, checks to see if they happen to also have an orientation

Definition at line 76 of file MoCapLogger.cc.

Referenced by gotMoCapConsole(), gotMoCapFile(), and gotMoCapSingle().

void MoCapLogger::gotMoCapConsole ( const MoCapEvent mce  )  [protected]

forwards to dump(std::cout, mce)... if not for rotAxis, could make dump() static and just call it directly

Definition at line 50 of file MoCapLogger.cc.

Referenced by refresh().

void MoCapLogger::gotMoCapFile ( const MoCapEvent mce  )  [protected]

forwards to dump(file, mce)... if not for rotAxis, could make dump() static and just call it directly

Definition at line 54 of file MoCapLogger.cc.

Referenced by refresh().

void MoCapLogger::gotMoCapGUI ( const MoCapEvent mce  )  [protected]

refreshes the ControllerGUI display

This section demonstrates the getPosition/getOrientation interface (with exception handling in case frame is not available in current update) See dump() below for iteration through all provided frames.

Definition at line 14 of file MoCapLogger.cc.

Referenced by refresh().

void MoCapLogger::gotMoCapSingle ( const EventBase event  )  [protected]

if receives MoCapEvent, dumps to std::cout, otherwise assumes timer and complains about lack of MoCapEvents

Definition at line 65 of file MoCapLogger.cc.

void MoCapLogger::gotTxtMsgSingle ( const TextMsgEvent txt  )  [protected]

Definition at line 58 of file MoCapLogger.cc.

MoCapLogger& MoCapLogger::operator= ( const MoCapLogger o  )  [private]

Do not call.

void MoCapLogger::refresh (  )  [virtual]

called when a child has deactivated and this control should refresh its display, or some other event (such as the user pressing the refresh button) has happened to cause a refresh to be needed

Reimplemented from ControlBase.

Definition at line 92 of file MoCapLogger.cc.

Referenced by gotMoCapGUI().

virtual void MoCapLogger::registered (  )  [virtual]

Add listener for mocap log requests.

Can't do this from constructor, due to auto-registration that will run at global initialization, possibly before erouter is available

Reimplemented from ControlBase.

Definition at line 97 of file MoCapLogger.h.

void MoCapLogger::rename ( ControlBase c,
std::ostream &  sstream 
) [static, protected]

convenience function for updating UI elements

Definition at line 5 of file MoCapLogger.cc.

Referenced by gotMoCapGUI().


Member Data Documentation

lets user control whether to dump to console

Definition at line 33 of file MoCapLogger.h.

Referenced by MoCapLogger(), and refresh().

std::ofstream MoCapLogger::file [protected]

the output stream if dumping to file

Definition at line 37 of file MoCapLogger.h.

Referenced by doSelect(), gotMoCapFile(), and refresh().

lets user control whether to dump to file

Definition at line 34 of file MoCapLogger.h.

Referenced by doSelect(), MoCapLogger(), and refresh().

TimeET MoCapLogger::lastRefresh [protected]

limits rate of GUI updates

Definition at line 26 of file MoCapLogger.h.

Referenced by gotMoCapGUI(), and refresh().

std::unique_ptr<EventCallbackAs<MoCapEvent> > MoCapLogger::mocapConsole [protected]

triggers callback to gotMoCapConsole()

Definition at line 49 of file MoCapLogger.h.

Referenced by refresh().

std::unique_ptr<EventCallbackAs<MoCapEvent> > MoCapLogger::mocapFile [protected]

triggers callback to gotMoCapFile()

Definition at line 52 of file MoCapLogger.h.

Referenced by doSelect(), and refresh().

std::unique_ptr<EventCallbackAs<MoCapEvent> > MoCapLogger::mocapGUI [protected]

triggers callback to gotMoCapEvent()

Definition at line 46 of file MoCapLogger.h.

Referenced by deactivate(), doSelect(), and refresh().

activates mocapSingle to dump next mocap event, and a timer to report error

triggers callback to gotMoCapSingle()

Definition at line 61 of file MoCapLogger.h.

Referenced by gotMoCapSingle(), and gotTxtMsgSingle().

displays the first rotation component (heading or x)

Definition at line 30 of file MoCapLogger.h.

Referenced by gotMoCapGUI(), and MoCapLogger().

displays the second rotation component (pitch or y)

Definition at line 31 of file MoCapLogger.h.

Referenced by gotMoCapGUI(), and MoCapLogger().

displays the third rotation component (roll or z)

Definition at line 32 of file MoCapLogger.h.

Referenced by gotMoCapGUI(), and MoCapLogger().

lets user control whether they want yaw-pitch-roll or the rotation axis

Definition at line 35 of file MoCapLogger.h.

Referenced by dump(), gotMoCapGUI(), and MoCapLogger().

triggers callback to gotTxtMsgSingle()

Definition at line 58 of file MoCapLogger.h.

Referenced by registered().

displays current x position

Definition at line 27 of file MoCapLogger.h.

Referenced by gotMoCapGUI(), and MoCapLogger().

displays current y position

Definition at line 28 of file MoCapLogger.h.

Referenced by gotMoCapGUI(), and MoCapLogger().

displays current z position

Definition at line 29 of file MoCapLogger.h.

Referenced by gotMoCapGUI(), and MoCapLogger().


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

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:13 2016 by Doxygen 1.6.3