RangeFinder Class Reference

Inheritance diagram for RangeFinder:

Capability List of all members.

Detailed Description

Instantiation of RangeFinder 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 89 of file RangeFinder.H.

Public Member Functions

 RangeFinder (const std::string &streamname)
 Standard constructor.
 RangeFinder (const ConnectionStrategy &strategy, const std::string &gblName)
 Auto-wiring constructor.
 RangeFinder (const std::string &streamname, const std::string &gblName)
 Like the standard constructor, but explicitly sets the global name.
 ~RangeFinder ()
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.
RangeFinderDataStruct getNextData ()
 Returns a struct containing the next event in the queue.
RangeFinderInfoStruct getNextInfo ()
 Returns a struct containing the next event in the queue.
RangeFinderInfoStruct 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

RangeFinderDataStruct data
 The data structure.
RangeFinderInfoStruct info
 Information-- read if consumer, write if supplier.
RangeFinderInfoStruct requests
 Requests-- read if supplier, write if consumer.

Protected Attributes

COMObject< RangeFinderInfoStruct,
RangeFinderDataStruct > * 
myCOMObject
bool m_queue
bool m_initialize
std::queue< RangeFinderDataStructm_dataVector
std::queue< RangeFinderInfoStructm_infoVector
std::queue< RangeFinderInfoStructm_requestVector


Constructor & Destructor Documentation

RangeFinder ( 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 RangeFinder.cpp.

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

RangeFinder ( 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 RangeFinder.cpp.

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

RangeFinder ( 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 RangeFinder.cpp.

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

~RangeFinder (  ) 

Definition at line 102 of file RangeFinder.cpp.

References RangeFinder::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 RangeFinder.cpp.

References RangeFinder::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, RangeFinder::m_initialize, RangeFinder::m_queue, Capability::m_sourceModule, Capability::m_strategy, Capability::m_streamname, Capability::m_streamRequest, Capability::m_supplier, RangeFinder::myCOMObject, Time::now(), RangeFinder::requests, RangeFinderInfoStruct::source, WURDE::STAT_NULL, RangeFinderInfoStruct::target, and RangeFinderInfoStruct::timestamp.

Referenced by RangeFinder::RangeFinder().

void runUpdate (  )  [virtual]

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

Implements Capability.

Definition at line 367 of file RangeFinder.cpp.

References Capability::m_doPublishData, Capability::m_doPublishInfo, and RangeFinder::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 378 of file RangeFinder.cpp.

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

void setCOMObject ( COMBase object  )  [inline, virtual]

Returns the ID number of the instantiated interface.

Implements Capability.

Definition at line 141 of file RangeFinder.H.

References RangeFinder::myCOMObject.

void disconnect (  )  [inline, virtual]

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

Implements Capability.

Definition at line 142 of file RangeFinder.H.

References RangeFinder::myCOMObject.

void activateSupplier (  )  [virtual]

Sets up the object as a supplier of data.

Implements Capability.

Definition at line 111 of file RangeFinder.cpp.

References RangeFinderInfoStruct::angle_min, WURDE::C_CONSUMER, WURDE::C_SUPPLIER, RangeFinder::data, WURDE::g_fatal(), RangeFinderInfoStruct::half_angle, RangeFinder::info, RangeFinder::m_dataVector, Capability::m_doAutoPing, Capability::m_globalname, Capability::m_haveGlobalname, Capability::m_haveStream, RangeFinder::m_infoVector, RangeFinder::m_initialize, RangeFinder::m_queue, RangeFinder::m_requestVector, Capability::m_streamname, Capability::m_supplier, RangeFinderInfoStruct::max_range, RangeFinder::myCOMObject, RangeFinderInfoStruct::phi_offset, RangeFinderInfoStruct::phi_separation, RangeFinderInfoStruct::psi_offset, RangeFinderInfoStruct::psi_separation, RangeFinderDataStruct::ranges, RangeFinder::requests, RangeFinderInfoStruct::sensor_positions, Writable::setCMode(), RangeFinderInfoStruct::source, RangeFinderDataStruct::source, RangeFinderInfoStruct::theta_offset, RangeFinderInfoStruct::theta_separation, RangeFinderInfoStruct::uniform, RangeFinderInfoStruct::x_offset, RangeFinderInfoStruct::x_separation, RangeFinderInfoStruct::y_offset, RangeFinderInfoStruct::y_separation, RangeFinderInfoStruct::z_offset, and RangeFinderInfoStruct::z_separation.

Referenced by RangeFinder::setStreamName().

void activateConsumer (  )  [virtual]

Sets up the object as a consumer of data.

Implements Capability.

Definition at line 238 of file RangeFinder.cpp.

References RangeFinderInfoStruct::angle_min, WURDE::C_CONSUMER, WURDE::C_SUPPLIER, RangeFinder::data, WURDE::g_fatal(), CommsManager::getName(), RangeFinderInfoStruct::half_angle, RangeFinder::info, RangeFinder::m_dataVector, Capability::m_doAutoPing, Capability::m_globalname, Capability::m_haveGlobalname, Capability::m_haveStream, RangeFinder::m_infoVector, RangeFinder::m_initialize, RangeFinder::m_queue, RangeFinder::m_requestVector, Capability::m_strategy, Capability::m_streamname, Capability::m_supplier, RangeFinderInfoStruct::max_range, RangeFinder::myCOMObject, Capability::myManager, RangeFinderInfoStruct::phi_offset, RangeFinderInfoStruct::phi_separation, RangeFinderInfoStruct::psi_offset, RangeFinderInfoStruct::psi_separation, RANGEFINDER, RangeFinderDataStruct::ranges, RangeFinder::requests, RangeFinderInfoStruct::sensor_positions, Writable::setCMode(), RangeFinderDataStruct::source, RangeFinderInfoStruct::source, WURDE::STRAT_NORMAL, RangeFinderInfoStruct::theta_offset, RangeFinderInfoStruct::theta_separation, RangeFinderInfoStruct::uniform, RangeFinderInfoStruct::x_offset, RangeFinderInfoStruct::x_separation, RangeFinderInfoStruct::y_offset, RangeFinderInfoStruct::y_separation, RangeFinderInfoStruct::z_offset, and RangeFinderInfoStruct::z_separation.

Referenced by RangeFinder::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 145 of file RangeFinder.H.

References RANGEFINDER.

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

Sets the name of the stream we're using.

Implements Capability.

Definition at line 1167 of file RangeFinder.cpp.

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

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

Sets the global name of this object.

Implements Capability.

Definition at line 1195 of file RangeFinder.cpp.

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

bool newData (  )  [virtual]

True if there is new data.

Implements Capability.

Definition at line 410 of file RangeFinder.cpp.

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

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

bool newInfo (  )  [virtual]

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

Implements Capability.

Definition at line 422 of file RangeFinder.cpp.

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

Referenced by main().

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 1218 of file RangeFinder.cpp.

References Capability::m_doAutoPing, and RangeFinder::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 1212 of file RangeFinder.cpp.

References RangeFinder::myCOMObject.

Referenced by main().

bool getQueueMode (  )  [inline]

True if events are being queued, otherwise false.

Definition at line 157 of file RangeFinder.H.

References RangeFinder::m_queue.

void setQueueMode ( const bool &  val  ) 

Turn queue mode on or off.

Definition at line 386 of file RangeFinder.cpp.

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

RangeFinderDataStruct 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 637 of file RangeFinder.cpp.

References RangeFinder::data, RangeFinder::m_dataVector, RangeFinder::m_queue, RangeFinder::myCOMObject, RangeFinderDataStruct::ranges, RangeFinderDataStruct::source, and RangeFinderDataStruct::timestamp.

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

RangeFinderInfoStruct 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 661 of file RangeFinder.cpp.

References RangeFinderInfoStruct::angle_min, WURDE::C_CONSUMER, WURDE::C_SUPPLIER, RangeFinderInfoStruct::half_angle, RangeFinder::info, RangeFinder::m_infoVector, RangeFinder::m_queue, RangeFinder::m_requestVector, Capability::m_supplier, RangeFinderInfoStruct::max_range, RangeFinderInfoStruct::mType, RangeFinder::myCOMObject, RangeFinderInfoStruct::phi_offset, RangeFinderInfoStruct::phi_separation, RangeFinderInfoStruct::psi_offset, RangeFinderInfoStruct::psi_separation, RangeFinder::requests, RangeFinderInfoStruct::sensor_positions, Writable::setCMode(), RangeFinderInfoStruct::source, RangeFinderInfoStruct::target, RangeFinderInfoStruct::theta_offset, RangeFinderInfoStruct::theta_separation, RangeFinderInfoStruct::timestamp, RangeFinderInfoStruct::uniform, RangeFinderInfoStruct::x_offset, RangeFinderInfoStruct::x_separation, RangeFinderInfoStruct::y_offset, RangeFinderInfoStruct::y_separation, RangeFinderInfoStruct::z_offset, and RangeFinderInfoStruct::z_separation.

Referenced by RangeFinder::getNextRequest(), and main().

RangeFinderInfoStruct getNextRequest (  )  [inline]

Convenience function, calls getNextInfo().

Definition at line 179 of file RangeFinder.H.

References RangeFinder::getNextInfo().

void publishData (  )  [virtual]

Informs the object to publish data on the next update.

Implements Capability.

Definition at line 439 of file RangeFinder.cpp.

References RangeFinder::data, RangeFinder::m_dataVector, Capability::m_doPublishData, Capability::m_doTag, Capability::m_doTimestamp, Capability::m_globalname, RangeFinder::m_queue, Capability::m_supplier, Time::now(), RangeFinderDataStruct::ranges, RangeFinderDataStruct::source, and RangeFinderDataStruct::timestamp.

void publishInfo (  )  [virtual]

Informs the object to publish info on the next update.

Implements Capability.

Definition at line 461 of file RangeFinder.cpp.

References RangeFinderInfoStruct::angle_min, WURDE::C_CONSUMER, WURDE::C_SUPPLIER, RangeFinderInfoStruct::half_angle, RangeFinder::info, Capability::m_doPublishInfo, Capability::m_doTag, Capability::m_doTimestamp, Capability::m_globalname, RangeFinder::m_infoVector, RangeFinder::m_queue, RangeFinder::m_requestVector, Capability::m_streamname, Capability::m_supplier, RangeFinderInfoStruct::max_range, WURDE::MESSAGE_INFO, WURDE::MESSAGE_REQUEST, RangeFinderInfoStruct::mType, Time::now(), RangeFinderInfoStruct::phi_offset, RangeFinderInfoStruct::phi_separation, RangeFinderInfoStruct::psi_offset, RangeFinderInfoStruct::psi_separation, RangeFinder::requests, RangeFinderInfoStruct::sensor_positions, Writable::setCMode(), RangeFinderInfoStruct::source, RangeFinderInfoStruct::target, RangeFinderInfoStruct::theta_offset, RangeFinderInfoStruct::theta_separation, RangeFinderInfoStruct::timestamp, RangeFinderInfoStruct::uniform, RangeFinderInfoStruct::x_offset, RangeFinderInfoStruct::x_separation, RangeFinderInfoStruct::y_offset, RangeFinderInfoStruct::y_separation, RangeFinderInfoStruct::z_offset, and RangeFinderInfoStruct::z_separation.

Referenced by initializeLaser(), and main().


Member Data Documentation

RangeFinderDataStruct data

The data structure.

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

Definition at line 126 of file RangeFinder.H.

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

RangeFinderInfoStruct info

Information-- read if consumer, write if supplier.

Definition at line 131 of file RangeFinder.H.

Referenced by RangeFinder::activateConsumer(), RangeFinder::activateSupplier(), RangeFinder::getNextInfo(), RangeFinder::init(), initializeLaser(), main(), and RangeFinder::publishInfo().

RangeFinderInfoStruct requests

Requests-- read if supplier, write if consumer.

Definition at line 136 of file RangeFinder.H.

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

COMObject<RangeFinderInfoStruct, RangeFinderDataStruct>* myCOMObject [protected]

Definition at line 186 of file RangeFinder.H.

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

bool m_queue [protected]

Definition at line 188 of file RangeFinder.H.

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

bool m_initialize [protected]

Definition at line 191 of file RangeFinder.H.

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

std::queue<RangeFinderDataStruct> m_dataVector [protected]

Definition at line 192 of file RangeFinder.H.

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

std::queue<RangeFinderInfoStruct> m_infoVector [protected]

Definition at line 193 of file RangeFinder.H.

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

std::queue<RangeFinderInfoStruct> m_requestVector [protected]

Definition at line 194 of file RangeFinder.H.

Referenced by RangeFinder::activateConsumer(), RangeFinder::activateSupplier(), RangeFinder::getNextInfo(), RangeFinder::newInfo(), RangeFinder::publishInfo(), and RangeFinder::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