Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

SimulatorAdvanceFrameControl.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_SimulatorAdvanceFrameControl_h
00003 #define INCLUDED_SimulatorAdvanceFrameControl_h
00004 
00005 #include "Behaviors/Controls/NullControl.h"
00006 #ifdef PLATFORM_APERIOS
00007 #  warning SimulatorAdvanceFrameControl is only useful when running in simulation!
00008 #else
00009 #  include "local/sim/Main.h"
00010 #endif
00011 
00012 //! Requests the next camera frame and sensor data, for use when running in simulation
00013 /*! There are a number of options regarding control of input data and
00014  *  flow of time.  This is only applicable when using a non-realtime
00015  *  source (such as loading logged data from disk) and the simulator's
00016  *  AdvanceOnAccess is 'false' (this is "advance on request" -- the
00017  *  same data may be accessed multiple times until you manually
00018  *  request the next frame) */
00019 class SimulatorAdvanceFrameControl : public NullControl {
00020 
00021 public:
00022   //! default constructor
00023   SimulatorAdvanceFrameControl()
00024     : NullControl("SimulatorAdvanceFrameControl","Requests the next camera frame and sensor data, for use when running in simulation")
00025   {}
00026   //! constructor which allows a custom name
00027   SimulatorAdvanceFrameControl(const std::string& n)
00028     : NullControl(n,"Requests the next camera frame and sensor data, for use when running in simulation")
00029   {}
00030 
00031   //can't do anything if we're running on aperios
00032 #ifndef PLATFORM_APERIOS
00033 
00034   virtual ControlBase * activate(MotionManager::MC_ID disp_id, Socket * gui) {
00035     Main::advanceVision();
00036     Main::advanceSensor();
00037     return NullControl::activate(disp_id,gui);
00038   }
00039 
00040   virtual std::string getName() const {
00041     if(Main::canManuallyAdvance())
00042       return NullControl::getName();
00043     return "[Auto-Advancing]";
00044   }
00045 
00046   virtual std::string getDescription() const {
00047     if(Main::canManuallyAdvance())
00048       return NullControl::getDescription();
00049     return "Cannot manually advance when in realtime mode, or when AdvanceOnAccess is enabled";
00050   }
00051   
00052 #endif
00053 
00054 };
00055 
00056 /*! @file
00057  * @brief Defines SimulatorAdvanceFrameControl, which requests the next camera frame and sensor data, for use when running in simulation
00058  * @author ejt (Creator)
00059  *
00060  * $Author: ejt $
00061  * $Name: tekkotsu-2_4_1 $
00062  * $Revision: 1.1 $
00063  * $State: Exp $
00064  * $Date: 2005/06/23 22:37:28 $
00065  */
00066 #endif

Tekkotsu v2.4.1
Generated Tue Aug 16 16:32:48 2005 by Doxygen 1.4.4