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 defnition of Ice runtime 00005 #include <Ice/Ice.h> 00006 #include <IceStorm/IceStorm.h> 00007 00008 // include provided interfaces 00009 #include <orca/pathfollower2d.h> 00010 00011 // utilities 00012 #include <gbxsickacfr/gbxiceutilacfr/store.h> 00013 #include <orcaice/context.h> 00014 00015 namespace gbxsickacfr { namespace gbxiceutilacfr { class Thread; } } 00016 00017 namespace orcaifaceimpl 00018 { 00019 00020 class PathFollowerCallback { 00021 public: 00022 virtual ~PathFollowerCallback() {} 00023 00024 virtual void setData( const orca::PathFollower2dData &path, bool activateImmediately )=0; 00025 virtual void activateNow()=0; 00026 virtual int getWaypointIndex() const=0; 00027 virtual bool getAbsoluteActivationTime( orca::Time &activationTime ) const=0; 00028 virtual bool getRelativeActivationTime( double &secondsSinceActivation ) const=0; 00029 virtual void setEnabled( bool enabled )=0; 00030 virtual bool enabled() const=0; 00031 }; 00032 00036 class PathFollower2dImpl : public IceUtil::Shared 00037 { 00038 friend class PathFollower2dI; 00039 00040 public: 00042 PathFollower2dImpl( PathFollowerCallback &callback, 00043 const std::string &interfaceTag, 00044 const orcaice::Context &context ); 00046 PathFollower2dImpl( PathFollowerCallback &callback, 00047 const orcaice::Context &context, 00048 const std::string &interfaceName ); 00049 ~PathFollower2dImpl(); 00050 00051 // local functions 00053 void initInterface(); 00054 00057 void initInterface( gbxsickacfr::gbxiceutilacfr::Thread* thread, const std::string& subsysName="", int retryInterval=2 ); 00058 00061 void localSetAndSend( const orca::PathFollower2dData &data ); 00062 00063 // Local calls to the Impl which get translated into remote calls on subscribers 00064 void localSetWaypointIndex( int index ); 00065 void localSetActivationTime( orca::Time absoluteTime, double relativeTime ); 00066 void localSetEnabledState( bool enabledState ); 00067 00068 private: 00069 // remote call implementations, mimic (but do not inherit) the orca interface 00070 ::orca::PathFollower2dData internalGetData() const; 00071 void internalSubscribe(const ::orca::PathFollower2dConsumerPrx&); 00072 void internalUnsubscribe(const ::orca::PathFollower2dConsumerPrx& ); 00073 00074 gbxsickacfr::gbxiceutilacfr::Store<orca::PathFollower2dData> dataStore_; 00075 00076 orca::PathFollower2dConsumerPrx consumerPrx_; 00077 IceStorm::TopicPrx topicPrx_; 00078 00079 // Hang onto this so we can remove from the adapter and control when things get deleted 00080 Ice::ObjectPtr ptr_; 00081 00082 const std::string interfaceName_; 00083 const std::string topicName_; 00084 00085 PathFollowerCallback &callback_; 00086 00087 orcaice::Context context_; 00088 }; 00089 typedef IceUtil::Handle<PathFollower2dImpl> PathFollower2dImplPtr; 00090 00091 } 00092 00093 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)