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

SourceForge.net Logo
Project
Download
Mailing lists

 

         

progressmonitor.h

00001 #ifndef GOALPLANNER_PROGRESSMONITOR_H
00002 #define GOALPLANNER_PROGRESSMONITOR_H
00003 
00004 #include <orca/pathfollower2d.h>
00005 #include <IceUtil/IceUtil.h>
00006 #include <orcaice/context.h>
00007 #include <gbxsickacfr/gbxiceutilacfr/store.h>
00008 
00009 namespace gbxiceutilacfr { class Thread; }
00010 
00011 namespace goalplanner {
00012 
00013 //
00014 // @brief Keeps track of our current path and how far along we are.
00015 //
00016 // We have to recreate the functionality of orcaiface::ConsumerImpl here
00017 // because PathFollower2dConsumer has non-standard methods.
00018 //
00019 // @author Alex Brooks
00020 //
00021 class ProgressMonitor : public IceUtil::Shared
00022 {
00023 
00024 public: 
00025     friend class PathFollower2dConsumerI;
00026 
00027     // constructor using interfaceTag (may throw ConfigFileException)
00028     ProgressMonitor( const orcaice::Context& context );
00029     ~ProgressMonitor();
00030 
00031     // copied from orcaiface::ConsumerImpl
00032     void subscribeWithTag( const std::string& interfaceTag, 
00033                           gbxiceutilacfr::Thread*  thread, const std::string& subsysName="", 
00034                           int retryInterval=2, int retryNumber=-1 );
00035     void subscribeWithString( const std::string& proxyString, 
00036                           gbxiceutilacfr::Thread*  thread, const std::string& subsysName="", 
00037                           int retryInterval=2, int retryNumber=-1 );
00038     void unsubscribe();
00039 
00040     //
00041     // Functions called locally
00042     //
00043 
00044     // If we're currently following a path (ie both activated and enabled), 
00045     // returns true and sets currentWp to the waypoint we're currently seeking.
00046     // Otherwise, returns false.
00047     bool getCurrentWp( orca::Waypoint2d &currentWp );
00048     // return val same as getCurrentWp
00049     bool getCurrentPath( orca::PathFollower2dData &pathData, int &wpIndex );
00050 
00051 private: 
00052 
00053     void internalSetWaypointIndex( int index );
00054     void internalSetActivationTime( const orca::Time &absoluteTime, double relativeTime );
00055     void internalSetData( const orca::PathFollower2dData &data );
00056     void internalSetEnabledState( bool enabledState );
00057 
00058     bool followingPath() const;
00059 
00060     bool gotData_;
00061     orca::PathFollower2dData pathData_;
00062     bool isEnabled_;
00063     int wpIndex_;
00064 
00065     IceUtil::Mutex mutex_;
00066 
00067     // Proxy to the internal consumer interface implementation
00068     orca::PathFollower2dConsumerPrx consumerPrx_;
00069 
00070     // Hang onto this so we can remove from the adapter and control when things get deleted
00071     Ice::ObjectPtr consumerPtr_;
00072 
00073     // Store the proxy of the interface after we subscribed to it. 
00074     gbxiceutilacfr::Store<IceStorm::TopicPrx> topic_;
00075 
00076     // Component context.
00077     orcaice::Context context_;
00078 };
00079 
00080 typedef IceUtil::Handle<ProgressMonitor> ProgressMonitorPtr;
00081 
00082 }
00083 
00084 #endif
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5