|
orca-robotics INTRODUCTION Overview Download and Install Quick Start Documentation Publications REPOSITORY Interfaces Components Libraries Utilities Software Map DEVELOPER Tutorials Examples Dev Guide Dashboard Wiki login/pass: orca/orca PEOPLE Contributors Users Project Download Mailing lists
|
pathfollower2dImpl.h00001 #ifndef ORCA_PATHFOLLOWER2D_IMPL_H 00002 #define ORCA_PATHFOLLOWER2D_IMPL_H 00003 00004 #include <memory> 00005 #include <orca/pathfollower2d.h> 00006 #include <gbxsickacfr/gbxiceutilacfr/store.h> 00007 #include <orcaice/context.h> 00008 #include <orcaice/topichandler.h> 00009 00010 namespace gbxiceutilacfr { class Thread; } 00011 00012 namespace orcaifaceimpl 00013 { 00014 00018 class AbstractPathFollowerCallback { 00019 public: 00020 virtual ~AbstractPathFollowerCallback() {} 00021 00022 virtual void setData( const orca::PathFollower2dData &path, bool activateImmediately )=0; 00023 virtual void activateNow()=0; 00024 virtual int getWaypointIndex() const=0; 00025 virtual bool getAbsoluteActivationTime( orca::Time &activationTime ) const=0; 00026 virtual bool getRelativeActivationTime( double &secondsSinceActivation ) const=0; 00027 virtual void setEnabled( bool enabled )=0; 00028 virtual bool enabled() const=0; 00029 }; 00030 00034 class PathFollower2dImpl : public IceUtil::Shared 00035 { 00036 friend class PathFollower2dI; 00037 00038 public: 00040 PathFollower2dImpl( AbstractPathFollowerCallback &callback, 00041 const std::string &interfaceTag, 00042 const orcaice::Context &context ); 00044 PathFollower2dImpl( AbstractPathFollowerCallback &callback, 00045 const orcaice::Context &context, 00046 const std::string &interfaceName ); 00047 ~PathFollower2dImpl(); 00048 00049 // local functions 00051 void initInterface(); 00052 00055 void initInterface( gbxiceutilacfr::Thread* thread, const std::string& subsysName="", int retryInterval=2 ); 00056 00059 void localSetAndSend( const orca::PathFollower2dData &data ); 00060 00061 // Local calls to the Impl which get translated into remote calls on subscribers 00062 void localSetWaypointIndex( int index ); 00063 void localSetActivationTime( orca::Time absoluteTime, double relativeTime ); 00064 void localSetEnabledState( bool enabledState ); 00065 00066 private: 00067 void init(); 00068 00069 // remote call implementations, mimic (but do not inherit) the orca interface 00070 ::orca::PathFollower2dData internalGetData() const; 00071 IceStorm::TopicPrx internalSubscribe(const orca::PathFollower2dConsumerPrx& subscriber); 00072 00073 gbxiceutilacfr::Store<orca::PathFollower2dData> dataStore_; 00074 00075 typedef orcaice::TopicHandler<orca::PathFollower2dConsumerPrx,orca::PathFollower2dData> PathFollower2dTopicHandler; 00076 std::auto_ptr<PathFollower2dTopicHandler> topicHandler_; 00077 00078 AbstractPathFollowerCallback &callback_; 00079 00080 Ice::ObjectPtr ptr_; 00081 const std::string interfaceName_; 00082 orcaice::Context context_; 00083 }; 00084 typedef IceUtil::Handle<PathFollower2dImpl> PathFollower2dImplPtr; 00085 00086 } 00087 00088 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)
1.4.5