Inheritance diagram for ObstacleAvoiderTransport:
Please read the documentation for Capabilities for other important functions. Data structures will be placed behind accessor functions in the future.
Definition at line 82 of file ObstacleAvoiderTransport.H.
Public Member Functions | |
ObstacleAvoiderTransport (const std::string &streamname) | |
Standard constructor. | |
ObstacleAvoiderTransport (const ConnectionStrategy &strategy, const std::string &gblName) | |
Auto-wiring constructor. | |
ObstacleAvoiderTransport (const std::string &streamname, const std::string &gblName) | |
Like the standard constructor, but explicitly sets the global name. | |
~ObstacleAvoiderTransport () | |
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. | |
ObstacleAvoiderTransportDataStruct | getNextData () |
Returns a struct containing the next event in the queue. | |
ObstacleAvoiderTransportInfoStruct | getNextInfo () |
Returns a struct containing the next event in the queue. | |
ObstacleAvoiderTransportInfoStruct | 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 | |
ObstacleAvoiderTransportDataStruct | data |
The data structure. | |
ObstacleAvoiderTransportInfoStruct | info |
Information-- read if consumer, write if supplier. | |
ObstacleAvoiderTransportInfoStruct | requests |
Requests-- read if supplier, write if consumer. | |
Protected Attributes | |
COMObject< ObstacleAvoiderTransportInfoStruct, ObstacleAvoiderTransportDataStruct > * | myCOMObject |
bool | m_queue |
bool | m_initialize |
std::queue< ObstacleAvoiderTransportDataStruct > | m_dataVector |
std::queue< ObstacleAvoiderTransportInfoStruct > | m_infoVector |
std::queue< ObstacleAvoiderTransportInfoStruct > | m_requestVector |
ObstacleAvoiderTransport | ( | 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 ObstacleAvoiderTransport.cpp.
References ObstacleAvoiderTransport::init(), Capability::m_haveGlobalname, and WURDE::STRAT_NORMAL.
ObstacleAvoiderTransport | ( | 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 ObstacleAvoiderTransport.cpp.
References ObstacleAvoiderTransport::init(), Capability::m_haveGlobalname, Capability::m_haveStream, and WURDE::STRAT_NORMAL.
ObstacleAvoiderTransport | ( | 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 ObstacleAvoiderTransport.cpp.
References ObstacleAvoiderTransport::init(), and WURDE::STRAT_NORMAL.
Definition at line 102 of file ObstacleAvoiderTransport.cpp.
References ObstacleAvoiderTransport::myCOMObject, and Capability::myManager.
void init | ( | const std::string & | streamname, | |
const ConnectionStrategy & | strategy, | |||
const std::string & | gblName | |||
) |
Initialization function, used by above.
Definition at line 62 of file ObstacleAvoiderTransport.cpp.
References ObstacleAvoiderTransport::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, ObstacleAvoiderTransport::m_initialize, ObstacleAvoiderTransport::m_queue, Capability::m_sourceModule, Capability::m_strategy, Capability::m_streamname, Capability::m_streamRequest, Capability::m_supplier, ObstacleAvoiderTransport::myCOMObject, Time::now(), ObstacleAvoiderTransport::requests, ObstacleAvoiderTransportInfoStruct::source, WURDE::STAT_NULL, ObstacleAvoiderTransportInfoStruct::target, and ObstacleAvoiderTransportInfoStruct::timestamp.
Referenced by ObstacleAvoiderTransport::ObstacleAvoiderTransport().
void runUpdate | ( | ) | [virtual] |
Does all necessary work to update the data/info provided by the object.
Implements Capability.
Definition at line 281 of file ObstacleAvoiderTransport.cpp.
References Capability::m_doPublishData, Capability::m_doPublishInfo, and ObstacleAvoiderTransport::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 292 of file ObstacleAvoiderTransport.cpp.
References ObstacleAvoiderTransport::myCOMObject, and Capability::myManager.
void setCOMObject | ( | COMBase * | object | ) | [inline, virtual] |
Returns the ID number of the instantiated interface.
Implements Capability.
Definition at line 134 of file ObstacleAvoiderTransport.H.
References ObstacleAvoiderTransport::myCOMObject.
void disconnect | ( | ) | [inline, virtual] |
Does all necessary work to clean up the object's connection.
Implements Capability.
Definition at line 135 of file ObstacleAvoiderTransport.H.
References ObstacleAvoiderTransport::myCOMObject.
void activateSupplier | ( | ) | [virtual] |
Sets up the object as a supplier of data.
Implements Capability.
Definition at line 111 of file ObstacleAvoiderTransport.cpp.
References ObstacleAvoiderTransportInfoStruct::absolute, ObstacleAvoiderTransportDataStruct::angleToGoal, ObstacleAvoiderTransportInfoStruct::avoidanceRadius, ObstacleAvoiderTransportInfoStruct::brake, WURDE::C_CONSUMER, WURDE::C_SUPPLIER, ObstacleAvoiderTransport::data, ObstacleAvoiderTransportDataStruct::distanceToGoal, WURDE::g_fatal(), ObstacleAvoiderTransportInfoStruct::goalHasLocation, ObstacleAvoiderTransportInfoStruct::goalHasTheta, ObstacleAvoiderTransportInfoStruct::goalPose, ObstacleAvoiderTransport::info, ObstacleAvoiderTransport::m_dataVector, Capability::m_doAutoPing, Capability::m_globalname, Capability::m_haveGlobalname, Capability::m_haveStream, ObstacleAvoiderTransport::m_infoVector, ObstacleAvoiderTransport::m_initialize, ObstacleAvoiderTransport::m_queue, ObstacleAvoiderTransport::m_requestVector, Capability::m_streamname, Capability::m_supplier, ObstacleAvoiderTransportInfoStruct::maxRotationVelocity, ObstacleAvoiderTransportInfoStruct::maxTranslationVelocity, ObstacleAvoiderTransport::myCOMObject, ObstacleAvoiderTransportDataStruct::pathObstructed, ObstacleAvoiderTransport::requests, Writable::setCMode(), ObstacleAvoiderTransportInfoStruct::source, and ObstacleAvoiderTransportDataStruct::source.
Referenced by ObstacleAvoiderTransport::setStreamName().
void activateConsumer | ( | ) | [virtual] |
Sets up the object as a consumer of data.
Implements Capability.
Definition at line 195 of file ObstacleAvoiderTransport.cpp.
References ObstacleAvoiderTransportInfoStruct::absolute, ObstacleAvoiderTransportDataStruct::angleToGoal, ObstacleAvoiderTransportInfoStruct::avoidanceRadius, ObstacleAvoiderTransportInfoStruct::brake, WURDE::C_CONSUMER, WURDE::C_SUPPLIER, ObstacleAvoiderTransport::data, ObstacleAvoiderTransportDataStruct::distanceToGoal, WURDE::g_fatal(), CommsManager::getName(), ObstacleAvoiderTransportInfoStruct::goalHasLocation, ObstacleAvoiderTransportInfoStruct::goalHasTheta, ObstacleAvoiderTransportInfoStruct::goalPose, ObstacleAvoiderTransport::info, ObstacleAvoiderTransport::m_dataVector, Capability::m_doAutoPing, Capability::m_globalname, Capability::m_haveGlobalname, Capability::m_haveStream, ObstacleAvoiderTransport::m_infoVector, ObstacleAvoiderTransport::m_initialize, ObstacleAvoiderTransport::m_queue, ObstacleAvoiderTransport::m_requestVector, Capability::m_strategy, Capability::m_streamname, Capability::m_supplier, ObstacleAvoiderTransportInfoStruct::maxRotationVelocity, ObstacleAvoiderTransportInfoStruct::maxTranslationVelocity, ObstacleAvoiderTransport::myCOMObject, Capability::myManager, OBSTACLEAVOIDERTRANSPORT, ObstacleAvoiderTransportDataStruct::pathObstructed, ObstacleAvoiderTransport::requests, Writable::setCMode(), ObstacleAvoiderTransportDataStruct::source, ObstacleAvoiderTransportInfoStruct::source, and WURDE::STRAT_NORMAL.
Referenced by ObstacleAvoiderTransport::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 138 of file ObstacleAvoiderTransport.H.
References OBSTACLEAVOIDERTRANSPORT.
void setStreamName | ( | const std::string & | name | ) | [virtual] |
Sets the name of the stream we're using.
Implements Capability.
Definition at line 783 of file ObstacleAvoiderTransport.cpp.
References ObstacleAvoiderTransport::activateConsumer(), ObstacleAvoiderTransport::activateSupplier(), Capability::m_globalname, Capability::m_haveStream, ObstacleAvoiderTransport::m_initialize, Capability::m_streamname, Capability::m_streamRequest, Capability::m_supplier, ObstacleAvoiderTransport::myCOMObject, and WURDE::STAT_OKAY.
void setGlobalName | ( | const std::string & | name | ) | [virtual] |
Sets the global name of this object.
Implements Capability.
Definition at line 811 of file ObstacleAvoiderTransport.cpp.
References Capability::m_globalname, Capability::m_haveGlobalname, Capability::m_streamname, Capability::m_supplier, and ObstacleAvoiderTransport::myCOMObject.
bool newData | ( | ) | [virtual] |
True if there is new data.
Implements Capability.
Definition at line 324 of file ObstacleAvoiderTransport.cpp.
References ObstacleAvoiderTransport::m_dataVector, ObstacleAvoiderTransport::m_queue, and ObstacleAvoiderTransport::myCOMObject.
bool newInfo | ( | ) | [virtual] |
True if there is new info/requests (depending on supplier/consumer mode).
Implements Capability.
Definition at line 336 of file ObstacleAvoiderTransport.cpp.
References ObstacleAvoiderTransport::m_infoVector, ObstacleAvoiderTransport::m_queue, ObstacleAvoiderTransport::m_requestVector, Capability::m_supplier, and ObstacleAvoiderTransport::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 834 of file ObstacleAvoiderTransport.cpp.
References Capability::m_doAutoPing, and ObstacleAvoiderTransport::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 828 of file ObstacleAvoiderTransport.cpp.
References ObstacleAvoiderTransport::myCOMObject.
bool getQueueMode | ( | ) | [inline] |
True if events are being queued, otherwise false.
Definition at line 150 of file ObstacleAvoiderTransport.H.
References ObstacleAvoiderTransport::m_queue.
void setQueueMode | ( | const bool & | val | ) |
Turn queue mode on or off.
Definition at line 300 of file ObstacleAvoiderTransport.cpp.
References ObstacleAvoiderTransport::m_dataVector, ObstacleAvoiderTransport::m_infoVector, ObstacleAvoiderTransport::m_queue, ObstacleAvoiderTransport::m_requestVector, and ObstacleAvoiderTransport::myCOMObject.
ObstacleAvoiderTransportDataStruct 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 492 of file ObstacleAvoiderTransport.cpp.
References ObstacleAvoiderTransportDataStruct::angleToGoal, ObstacleAvoiderTransport::data, ObstacleAvoiderTransportDataStruct::distanceToGoal, ObstacleAvoiderTransport::m_dataVector, ObstacleAvoiderTransport::m_queue, ObstacleAvoiderTransport::myCOMObject, ObstacleAvoiderTransportDataStruct::pathObstructed, ObstacleAvoiderTransportDataStruct::source, and ObstacleAvoiderTransportDataStruct::timestamp.
ObstacleAvoiderTransportInfoStruct 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 520 of file ObstacleAvoiderTransport.cpp.
References ObstacleAvoiderTransportInfoStruct::absolute, ObstacleAvoiderTransportInfoStruct::avoidanceRadius, ObstacleAvoiderTransportInfoStruct::brake, WURDE::C_CONSUMER, WURDE::C_SUPPLIER, ObstacleAvoiderTransportInfoStruct::goalHasLocation, ObstacleAvoiderTransportInfoStruct::goalHasTheta, ObstacleAvoiderTransportInfoStruct::goalPose, ObstacleAvoiderTransport::info, ObstacleAvoiderTransport::m_infoVector, ObstacleAvoiderTransport::m_queue, ObstacleAvoiderTransport::m_requestVector, Capability::m_supplier, ObstacleAvoiderTransportInfoStruct::maxRotationVelocity, ObstacleAvoiderTransportInfoStruct::maxTranslationVelocity, ObstacleAvoiderTransportInfoStruct::mType, ObstacleAvoiderTransport::myCOMObject, ObstacleAvoiderTransport::requests, Writable::setCMode(), ObstacleAvoiderTransportInfoStruct::source, ObstacleAvoiderTransportInfoStruct::target, and ObstacleAvoiderTransportInfoStruct::timestamp.
Referenced by ObstacleAvoiderTransport::getNextRequest(), and main().
ObstacleAvoiderTransportInfoStruct getNextRequest | ( | ) | [inline] |
Convenience function, calls getNextInfo().
Definition at line 172 of file ObstacleAvoiderTransport.H.
References ObstacleAvoiderTransport::getNextInfo().
Referenced by main().
void publishData | ( | ) | [virtual] |
Informs the object to publish data on the next update.
Implements Capability.
Definition at line 353 of file ObstacleAvoiderTransport.cpp.
References ObstacleAvoiderTransportDataStruct::angleToGoal, ObstacleAvoiderTransport::data, ObstacleAvoiderTransportDataStruct::distanceToGoal, ObstacleAvoiderTransport::m_dataVector, Capability::m_doPublishData, Capability::m_doTag, Capability::m_doTimestamp, Capability::m_globalname, ObstacleAvoiderTransport::m_queue, Capability::m_supplier, Time::now(), ObstacleAvoiderTransportDataStruct::pathObstructed, ObstacleAvoiderTransportDataStruct::source, and ObstacleAvoiderTransportDataStruct::timestamp.
Referenced by main().
void publishInfo | ( | ) | [virtual] |
Informs the object to publish info on the next update.
Implements Capability.
Definition at line 379 of file ObstacleAvoiderTransport.cpp.
References ObstacleAvoiderTransportInfoStruct::absolute, ObstacleAvoiderTransportInfoStruct::avoidanceRadius, ObstacleAvoiderTransportInfoStruct::brake, WURDE::C_CONSUMER, WURDE::C_SUPPLIER, ObstacleAvoiderTransportInfoStruct::goalHasLocation, ObstacleAvoiderTransportInfoStruct::goalHasTheta, ObstacleAvoiderTransportInfoStruct::goalPose, ObstacleAvoiderTransport::info, Capability::m_doPublishInfo, Capability::m_doTag, Capability::m_doTimestamp, Capability::m_globalname, ObstacleAvoiderTransport::m_infoVector, ObstacleAvoiderTransport::m_queue, ObstacleAvoiderTransport::m_requestVector, Capability::m_streamname, Capability::m_supplier, ObstacleAvoiderTransportInfoStruct::maxRotationVelocity, ObstacleAvoiderTransportInfoStruct::maxTranslationVelocity, WURDE::MESSAGE_INFO, WURDE::MESSAGE_REQUEST, ObstacleAvoiderTransportInfoStruct::mType, Time::now(), ObstacleAvoiderTransport::requests, Writable::setCMode(), ObstacleAvoiderTransportInfoStruct::source, ObstacleAvoiderTransportInfoStruct::target, and ObstacleAvoiderTransportInfoStruct::timestamp.
The data structure.
Read from this if you're a consumer, write to it if you're a supplier.
Definition at line 119 of file ObstacleAvoiderTransport.H.
Referenced by ObstacleAvoiderTransport::activateConsumer(), ObstacleAvoiderTransport::activateSupplier(), ObstacleAvoiderTransport::getNextData(), main(), and ObstacleAvoiderTransport::publishData().
Information-- read if consumer, write if supplier.
Definition at line 124 of file ObstacleAvoiderTransport.H.
Referenced by ObstacleAvoiderTransport::activateConsumer(), ObstacleAvoiderTransport::activateSupplier(), ObstacleAvoiderTransport::getNextInfo(), ObstacleAvoiderTransport::init(), main(), and ObstacleAvoiderTransport::publishInfo().
Requests-- read if supplier, write if consumer.
Definition at line 129 of file ObstacleAvoiderTransport.H.
Referenced by ObstacleAvoiderTransport::activateConsumer(), ObstacleAvoiderTransport::activateSupplier(), ObstacleAvoiderTransport::getNextInfo(), ObstacleAvoiderTransport::init(), main(), ObstacleAvoider::moveToPoint(), ObstacleAvoider::moveToPose(), ObstacleAvoider::moveToRelativePoint(), ObstacleAvoider::moveToRelativePose(), ObstacleAvoiderTransport::publishInfo(), ObstacleAvoider::rotateFixedAngle(), ObstacleAvoider::rotateToAngle(), ObstacleAvoider::rotateToRelativeAngle(), ObstacleAvoider::setAvoidanceRadius(), ObstacleAvoider::stop(), and ObstacleAvoider::translateFixedDistance().
COMObject<ObstacleAvoiderTransportInfoStruct, ObstacleAvoiderTransportDataStruct>* myCOMObject [protected] |
Definition at line 179 of file ObstacleAvoiderTransport.H.
Referenced by ObstacleAvoiderTransport::activateConsumer(), ObstacleAvoiderTransport::activateSupplier(), ObstacleAvoiderTransport::disconnect(), ObstacleAvoiderTransport::doPing(), ObstacleAvoiderTransport::getNextData(), ObstacleAvoiderTransport::getNextInfo(), ObstacleAvoiderTransport::init(), ObstacleAvoiderTransport::newData(), ObstacleAvoiderTransport::newInfo(), ObstacleAvoiderTransport::runUpdate(), ObstacleAvoiderTransport::setAutoPing(), ObstacleAvoiderTransport::setCOMObject(), ObstacleAvoiderTransport::setGlobalName(), ObstacleAvoiderTransport::setManager(), ObstacleAvoiderTransport::setQueueMode(), ObstacleAvoiderTransport::setStreamName(), and ObstacleAvoiderTransport::~ObstacleAvoiderTransport().
bool m_queue [protected] |
Definition at line 181 of file ObstacleAvoiderTransport.H.
Referenced by ObstacleAvoiderTransport::activateConsumer(), ObstacleAvoiderTransport::activateSupplier(), ObstacleAvoiderTransport::getNextData(), ObstacleAvoiderTransport::getNextInfo(), ObstacleAvoiderTransport::getQueueMode(), ObstacleAvoiderTransport::init(), ObstacleAvoiderTransport::newData(), ObstacleAvoiderTransport::newInfo(), ObstacleAvoiderTransport::publishData(), ObstacleAvoiderTransport::publishInfo(), and ObstacleAvoiderTransport::setQueueMode().
bool m_initialize [protected] |
Definition at line 184 of file ObstacleAvoiderTransport.H.
Referenced by ObstacleAvoiderTransport::activateConsumer(), ObstacleAvoiderTransport::activateSupplier(), ObstacleAvoiderTransport::init(), and ObstacleAvoiderTransport::setStreamName().
std::queue<ObstacleAvoiderTransportDataStruct> m_dataVector [protected] |
Definition at line 185 of file ObstacleAvoiderTransport.H.
Referenced by ObstacleAvoiderTransport::activateConsumer(), ObstacleAvoiderTransport::activateSupplier(), ObstacleAvoiderTransport::getNextData(), ObstacleAvoiderTransport::newData(), ObstacleAvoiderTransport::publishData(), and ObstacleAvoiderTransport::setQueueMode().
std::queue<ObstacleAvoiderTransportInfoStruct> m_infoVector [protected] |
Definition at line 186 of file ObstacleAvoiderTransport.H.
Referenced by ObstacleAvoiderTransport::activateConsumer(), ObstacleAvoiderTransport::activateSupplier(), ObstacleAvoiderTransport::getNextInfo(), ObstacleAvoiderTransport::newInfo(), ObstacleAvoiderTransport::publishInfo(), and ObstacleAvoiderTransport::setQueueMode().
std::queue<ObstacleAvoiderTransportInfoStruct> m_requestVector [protected] |
Definition at line 187 of file ObstacleAvoiderTransport.H.
Referenced by ObstacleAvoiderTransport::activateConsumer(), ObstacleAvoiderTransport::activateSupplier(), ObstacleAvoiderTransport::getNextInfo(), ObstacleAvoiderTransport::newInfo(), ObstacleAvoiderTransport::publishInfo(), and ObstacleAvoiderTransport::setQueueMode().