Egomotion Class Reference

Inheritance diagram for Egomotion:

Capability List of all members.

Detailed Description

Instantiation of Egomotion interface.

Please read the documentation for Capabilities for other important functions. Data structures will be placed behind accessor functions in the future.

Definition at line 76 of file Egomotion.H.

Public Member Functions

 Egomotion (const std::string &streamname)
 Standard constructor.
 Egomotion (const ConnectionStrategy &strategy, const std::string &gblName)
 Auto-wiring constructor.
 Egomotion (const std::string &streamname, const std::string &gblName)
 Like the standard constructor, but explicitly sets the global name.
 ~Egomotion ()
void init (const std::string &streamname, const ConnectionStrategy &strategy, const std::string &gblName)
 Initialization function, used by above.
void runUpdate ()
 Does all necessary work to update the data/info provided by the object.
void setManager (CommsManager *myManager_)
 Gives the object a reference to the global CORBAHelper.
void setCOMObject (COMBase *object)
 Returns the ID number of the instantiated interface.
void disconnect ()
 Does all necessary work to clean up the object's connection.
void activateSupplier ()
 Sets up the object as a supplier of data.
void activateConsumer ()
 Sets up the object as a consumer of data.
std::string getInterfaceName ()
 Returns the name of the interface.
void setStreamName (const std::string &name)
 Sets the name of the stream we're using.
void setGlobalName (const std::string &name)
 Sets the global name of this object.
bool newData ()
 True if there is new data.
bool newInfo ()
 True if there is new info/requests (depending on supplier/consumer mode).
void setAutoPing (const bool &val)
 Sets the state of the auto-ping function.
void doPing ()
 Manually tells the object to do a ping.
bool getQueueMode ()
 True if events are being queued, otherwise false.
void setQueueMode (const bool &val)
 Turn queue mode on or off.
EgomotionDataStruct getNextData ()
 Returns a struct containing the next event in the queue.
EgomotionInfoStruct getNextInfo ()
 Returns a struct containing the next event in the queue.
EgomotionInfoStruct getNextRequest ()
 Convenience function, calls getNextInfo().
void publishData ()
 Informs the object to publish data on the next update.
void publishInfo ()
 Informs the object to publish info on the next update.

Public Attributes

EgomotionDataStruct data
 The data structure.
EgomotionInfoStruct info
 Information-- read if consumer, write if supplier.
EgomotionInfoStruct requests
 Requests-- read if supplier, write if consumer.

Protected Attributes

COMObject< EgomotionInfoStruct,
EgomotionDataStruct > * 
myCOMObject
bool m_queue
bool m_initialize
std::queue< EgomotionDataStructm_dataVector
std::queue< EgomotionInfoStructm_infoVector
std::queue< EgomotionInfoStructm_requestVector


Constructor & Destructor Documentation

Egomotion ( const std::string &  streamname  )  [explicit]

Standard constructor.

Automatically generates a (hopefully) unique global name. If two of the same (consumer) binaries are running, it *will* fail. This is the only constructor you should use for suppliers.

Definition at line 37 of file Egomotion.cpp.

References Egomotion::init(), Capability::m_haveGlobalname, and WURDE::STRAT_NORMAL.

Egomotion ( const ConnectionStrategy strategy,
const std::string &  gblName 
)

Auto-wiring constructor.

Submits a request to MCP for a stream to connect to, based on global name. ConnectionStrategy should be auto for now.

Definition at line 44 of file Egomotion.cpp.

References Egomotion::init(), Capability::m_haveGlobalname, Capability::m_haveStream, and WURDE::STRAT_NORMAL.

Egomotion ( const std::string &  streamname,
const std::string &  gblName 
)

Like the standard constructor, but explicitly sets the global name.

Use this when starting multiple instances of the same binary, so that each instance can be assigned a separate name.

Definition at line 58 of file Egomotion.cpp.

References Egomotion::init(), and WURDE::STRAT_NORMAL.

~Egomotion (  ) 

Definition at line 102 of file Egomotion.cpp.

References Egomotion::myCOMObject, and Capability::myManager.


Member Function Documentation

void init ( const std::string &  streamname,
const ConnectionStrategy strategy,
const std::string &  gblName 
)

Initialization function, used by above.

Definition at line 62 of file Egomotion.cpp.

References Egomotion::info, Capability::m_doAutoPing, Capability::m_doPublishData, Capability::m_doPublishInfo, Capability::m_doTag, Capability::m_doTimestamp, Capability::m_globalname, Capability::m_haveGlobalname, Capability::m_haveStream, Egomotion::m_initialize, Egomotion::m_queue, Capability::m_sourceModule, Capability::m_strategy, Capability::m_streamname, Capability::m_streamRequest, Capability::m_supplier, Egomotion::myCOMObject, Time::now(), Egomotion::requests, EgomotionInfoStruct::source, WURDE::STAT_NULL, EgomotionInfoStruct::target, and EgomotionInfoStruct::timestamp.

Referenced by Egomotion::Egomotion().

void runUpdate (  )  [virtual]

Does all necessary work to update the data/info provided by the object.

Implements Capability.

Definition at line 203 of file Egomotion.cpp.

References Capability::m_doPublishData, Capability::m_doPublishInfo, and Egomotion::myCOMObject.

void setManager ( CommsManager myManager_  )  [virtual]

Gives the object a reference to the global CORBAHelper.

This will be changed soon to be less adaptor specific.

Implements Capability.

Definition at line 214 of file Egomotion.cpp.

References Egomotion::myCOMObject, and Capability::myManager.

void setCOMObject ( COMBase object  )  [inline, virtual]

Returns the ID number of the instantiated interface.

Implements Capability.

Definition at line 128 of file Egomotion.H.

References Egomotion::myCOMObject.

void disconnect (  )  [inline, virtual]

Does all necessary work to clean up the object's connection.

Implements Capability.

Definition at line 129 of file Egomotion.H.

References Egomotion::myCOMObject.

void activateSupplier (  )  [virtual]

Sets up the object as a supplier of data.

Implements Capability.

Definition at line 111 of file Egomotion.cpp.

References EgomotionDataStruct::angularAccel, EgomotionDataStruct::angularVelocity, Egomotion::data, WURDE::g_fatal(), Egomotion::info, Egomotion::m_dataVector, Capability::m_doAutoPing, Capability::m_globalname, Capability::m_haveGlobalname, Capability::m_haveStream, Egomotion::m_infoVector, Egomotion::m_initialize, Egomotion::m_queue, Egomotion::m_requestVector, Capability::m_streamname, Capability::m_supplier, Egomotion::myCOMObject, Egomotion::requests, EgomotionInfoStruct::source, EgomotionDataStruct::source, EgomotionDataStruct::transAccel, and EgomotionDataStruct::transVelocity.

Referenced by Egomotion::setStreamName().

void activateConsumer (  )  [virtual]

Sets up the object as a consumer of data.

Implements Capability.

Definition at line 156 of file Egomotion.cpp.

References EgomotionDataStruct::angularAccel, EgomotionDataStruct::angularVelocity, Egomotion::data, EGOMOTION, WURDE::g_fatal(), CommsManager::getName(), Egomotion::info, Egomotion::m_dataVector, Capability::m_doAutoPing, Capability::m_globalname, Capability::m_haveGlobalname, Capability::m_haveStream, Egomotion::m_infoVector, Egomotion::m_initialize, Egomotion::m_queue, Egomotion::m_requestVector, Capability::m_strategy, Capability::m_streamname, Capability::m_supplier, Egomotion::myCOMObject, Capability::myManager, Egomotion::requests, EgomotionDataStruct::source, EgomotionInfoStruct::source, WURDE::STRAT_NORMAL, EgomotionDataStruct::transAccel, and EgomotionDataStruct::transVelocity.

Referenced by Egomotion::setStreamName().

std::string getInterfaceName (  )  [inline, virtual]

Returns the name of the interface.

We're identifying interfaces by strings, rather than an enum, as it saves us from having to autogenerate even more code

Implements Capability.

Definition at line 132 of file Egomotion.H.

References EGOMOTION.

void setStreamName ( const std::string &  name  )  [virtual]

Sets the name of the stream we're using.

Implements Capability.

Definition at line 439 of file Egomotion.cpp.

References Egomotion::activateConsumer(), Egomotion::activateSupplier(), Capability::m_globalname, Capability::m_haveStream, Egomotion::m_initialize, Capability::m_streamname, Capability::m_streamRequest, Capability::m_supplier, Egomotion::myCOMObject, and WURDE::STAT_OKAY.

void setGlobalName ( const std::string &  name  )  [virtual]

Sets the global name of this object.

Implements Capability.

Definition at line 467 of file Egomotion.cpp.

References Capability::m_globalname, Capability::m_haveGlobalname, Capability::m_streamname, Capability::m_supplier, and Egomotion::myCOMObject.

bool newData (  )  [virtual]

True if there is new data.

Implements Capability.

Definition at line 246 of file Egomotion.cpp.

References Egomotion::m_dataVector, Egomotion::m_queue, and Egomotion::myCOMObject.

Referenced by main(), and StereoDataCollector::runOperator().

bool newInfo (  )  [virtual]

True if there is new info/requests (depending on supplier/consumer mode).

Implements Capability.

Definition at line 258 of file Egomotion.cpp.

References Egomotion::m_infoVector, Egomotion::m_queue, Egomotion::m_requestVector, Capability::m_supplier, and Egomotion::myCOMObject.

void setAutoPing ( const bool &  val  )  [virtual]

Sets the state of the auto-ping function.

If true, consumers will automatically send out a blank MESSAGE_PING to the stream source, and suppliers will automatically filter out these requests and send a copy of the last published info and data.

Should consumers be set up to send out this request on a regular basis?

Implements Capability.

Definition at line 490 of file Egomotion.cpp.

References Capability::m_doAutoPing, and Egomotion::myCOMObject.

void doPing (  )  [virtual]

Manually tells the object to do a ping.

If a consumer, sends a ping request to its supplier, if a supplier, sends out a copy of the last published info and data messages.

Implements Capability.

Definition at line 484 of file Egomotion.cpp.

References Egomotion::myCOMObject.

bool getQueueMode (  )  [inline]

True if events are being queued, otherwise false.

Definition at line 144 of file Egomotion.H.

References Egomotion::m_queue.

void setQueueMode ( const bool &  val  ) 

Turn queue mode on or off.

Definition at line 222 of file Egomotion.cpp.

References Egomotion::m_dataVector, Egomotion::m_infoVector, Egomotion::m_queue, Egomotion::m_requestVector, and Egomotion::myCOMObject.

EgomotionDataStruct getNextData (  ) 

Returns a struct containing the next event in the queue.

Also copies the contents of that event into the data struct.

Definition at line 361 of file Egomotion.cpp.

References EgomotionDataStruct::angularAccel, EgomotionDataStruct::angularVelocity, Egomotion::data, EgomotionDataStruct::location, Egomotion::m_dataVector, Egomotion::m_queue, Egomotion::myCOMObject, EgomotionDataStruct::source, EgomotionDataStruct::timestamp, EgomotionDataStruct::transAccel, and EgomotionDataStruct::transVelocity.

Referenced by main(), and StereoDataCollector::runOperator().

EgomotionInfoStruct getNextInfo (  ) 

Returns a struct containing the next event in the queue.

Also copies the contents of that event into the info/requests struct.

Definition at line 392 of file Egomotion.cpp.

References Egomotion::info, Egomotion::m_infoVector, Egomotion::m_queue, Egomotion::m_requestVector, Capability::m_supplier, EgomotionInfoStruct::mType, Egomotion::myCOMObject, Egomotion::requests, EgomotionInfoStruct::source, EgomotionInfoStruct::target, and EgomotionInfoStruct::timestamp.

Referenced by Egomotion::getNextRequest().

EgomotionInfoStruct getNextRequest (  )  [inline]

Convenience function, calls getNextInfo().

Definition at line 166 of file Egomotion.H.

References Egomotion::getNextInfo().

void publishData (  )  [virtual]

Informs the object to publish data on the next update.

Implements Capability.

Definition at line 275 of file Egomotion.cpp.

References EgomotionDataStruct::angularAccel, EgomotionDataStruct::angularVelocity, Egomotion::data, EgomotionDataStruct::location, Egomotion::m_dataVector, Capability::m_doPublishData, Capability::m_doTag, Capability::m_doTimestamp, Capability::m_globalname, Egomotion::m_queue, Capability::m_supplier, Time::now(), EgomotionDataStruct::source, EgomotionDataStruct::timestamp, EgomotionDataStruct::transAccel, and EgomotionDataStruct::transVelocity.

void publishInfo (  )  [virtual]

Informs the object to publish info on the next update.

Implements Capability.

Definition at line 304 of file Egomotion.cpp.

References Egomotion::info, Capability::m_doPublishInfo, Capability::m_doTag, Capability::m_doTimestamp, Capability::m_globalname, Egomotion::m_infoVector, Egomotion::m_queue, Egomotion::m_requestVector, Capability::m_streamname, Capability::m_supplier, WURDE::MESSAGE_INFO, WURDE::MESSAGE_REQUEST, EgomotionInfoStruct::mType, Time::now(), Egomotion::requests, EgomotionInfoStruct::source, EgomotionInfoStruct::target, and EgomotionInfoStruct::timestamp.


Member Data Documentation

EgomotionDataStruct data

The data structure.

Read from this if you're a consumer, write to it if you're a supplier.

Definition at line 113 of file Egomotion.H.

Referenced by Egomotion::activateConsumer(), Egomotion::activateSupplier(), Egomotion::getNextData(), main(), Egomotion::publishData(), StereoDataCollector::queueImage(), and StereoDataCollector::runOperator().

EgomotionInfoStruct info

Information-- read if consumer, write if supplier.

Definition at line 118 of file Egomotion.H.

Referenced by Egomotion::activateConsumer(), Egomotion::activateSupplier(), Egomotion::getNextInfo(), Egomotion::init(), and Egomotion::publishInfo().

EgomotionInfoStruct requests

Requests-- read if supplier, write if consumer.

Definition at line 123 of file Egomotion.H.

Referenced by Egomotion::activateConsumer(), Egomotion::activateSupplier(), Egomotion::getNextInfo(), Egomotion::init(), and Egomotion::publishInfo().

COMObject<EgomotionInfoStruct, EgomotionDataStruct>* myCOMObject [protected]

Definition at line 173 of file Egomotion.H.

Referenced by Egomotion::activateConsumer(), Egomotion::activateSupplier(), Egomotion::disconnect(), Egomotion::doPing(), Egomotion::getNextData(), Egomotion::getNextInfo(), Egomotion::init(), Egomotion::newData(), Egomotion::newInfo(), Egomotion::runUpdate(), Egomotion::setAutoPing(), Egomotion::setCOMObject(), Egomotion::setGlobalName(), Egomotion::setManager(), Egomotion::setQueueMode(), Egomotion::setStreamName(), and Egomotion::~Egomotion().

bool m_queue [protected]

Definition at line 175 of file Egomotion.H.

Referenced by Egomotion::activateConsumer(), Egomotion::activateSupplier(), Egomotion::getNextData(), Egomotion::getNextInfo(), Egomotion::getQueueMode(), Egomotion::init(), Egomotion::newData(), Egomotion::newInfo(), Egomotion::publishData(), Egomotion::publishInfo(), and Egomotion::setQueueMode().

bool m_initialize [protected]

Definition at line 178 of file Egomotion.H.

Referenced by Egomotion::activateConsumer(), Egomotion::activateSupplier(), Egomotion::init(), and Egomotion::setStreamName().

std::queue<EgomotionDataStruct> m_dataVector [protected]

Definition at line 179 of file Egomotion.H.

Referenced by Egomotion::activateConsumer(), Egomotion::activateSupplier(), Egomotion::getNextData(), Egomotion::newData(), Egomotion::publishData(), and Egomotion::setQueueMode().

std::queue<EgomotionInfoStruct> m_infoVector [protected]

Definition at line 180 of file Egomotion.H.

Referenced by Egomotion::activateConsumer(), Egomotion::activateSupplier(), Egomotion::getNextInfo(), Egomotion::newInfo(), Egomotion::publishInfo(), and Egomotion::setQueueMode().

std::queue<EgomotionInfoStruct> m_requestVector [protected]

Definition at line 181 of file Egomotion.H.

Referenced by Egomotion::activateConsumer(), Egomotion::activateSupplier(), Egomotion::getNextInfo(), Egomotion::newInfo(), Egomotion::publishInfo(), and Egomotion::setQueueMode().


The documentation for this class was generated from the following files:
Generated on Thu Feb 1 15:31:55 2007 for WURDE by  doxygen 1.5.1