INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications

NONFRAMEWORK CODE
Driver Interfaces
Drivers
Libraries
Utilities

FRAMEWORK CODE
Interfaces
Components
Libraries
Utilities

Full Software Listings

DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard

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 gbxutilacfr { class Stoppable; }
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                           gbxutilacfr::Stoppable* activity, const std::string& subsysName="", 
00034                           int retryInterval=2, int retryNumber=-1 );
00035     void subscribeWithString( const std::string& proxyString, 
00036                           gbxutilacfr::Stoppable* activity, 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 internalSetState( const orca::PathFollower2dState &state );
00054     void internalSetData( const orca::PathFollower2dData &data );
00055 
00056     bool followingPath() const;
00057 
00058     bool gotData_;
00059     orca::PathFollower2dData pathData_;
00060     orca::PathFollower2dState state_;
00061 
00062     IceUtil::Mutex mutex_;
00063 
00064     // Proxy to the internal consumer interface implementation
00065     orca::PathFollower2dConsumerPrx consumerPrx_;
00066 
00067     // Hang onto this so we can remove from the adapter and control when things get deleted
00068     Ice::ObjectPtr consumerPtr_;
00069 
00070     // Store the proxy of the interface after we subscribed to it. 
00071     gbxiceutilacfr::Store<IceStorm::TopicPrx> topic_;
00072 
00073     // Component context.
00074     orcaice::Context context_;
00075 };
00076 
00077 typedef IceUtil::Handle<ProgressMonitor> ProgressMonitorPtr;
00078 
00079 }
00080 
00081 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5