Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

SimulatorAdvanceFrameControl.cc

Go to the documentation of this file.
00001 #ifndef PLATFORM_APERIOS    
00002 
00003 #include "Behaviors/Controls/NullControl.h"
00004 #include "Shared/ProjectInterface.h"
00005 
00006 //! Requests the next camera frame and sensor data, for use when running in simulation
00007 /*! Note that this won't increment the simulator time if triggered while paused... */
00008 class SimulatorAdvanceFrameControl : public NullControl {
00009 public:
00010   //! default constructor
00011   SimulatorAdvanceFrameControl()
00012     : NullControl("Advance Frame","Requests the next camera frame and sensor data, for use when running in simulation")
00013   {}
00014   //! constructor which allows a custom name
00015   SimulatorAdvanceFrameControl(const std::string& n)
00016     : NullControl(n,"Requests the next camera frame and sensor data, for use when running in simulation")
00017   {}
00018   
00019   virtual ControlBase * activate(MC_ID disp_id, Socket * gui) {
00020     ProjectInterface::sendCommand("advance");
00021     return NullControl::activate(disp_id,gui);
00022   }
00023   
00024   virtual std::string getName() const {
00025     if(canManuallyAdvance())
00026       return NullControl::getName();
00027     return "[Auto-Advancing]";
00028   }
00029   
00030   virtual std::string getDescription() const {
00031     if(canManuallyAdvance())
00032       return NullControl::getDescription();
00033     return "Cannot manually advance when in realtime mode, or when AdvanceOnAccess is enabled";
00034   }
00035   
00036 protected:
00037   //! ideally, this should return true only when the simulator is paused or the data source is frozen...
00038   bool canManuallyAdvance() const { return true; }
00039 };
00040 
00041 REGISTER_CONTROL(SimulatorAdvanceFrameControl,"Vision Pipeline");
00042 
00043 #endif
00044 
00045 /*! @file
00046  * @brief Defines SimulatorAdvanceFrameControl, which requests the next camera frame and sensor data, for use when running in simulation
00047  * @author ejt (Creator)
00048  */

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:51 2016 by Doxygen 1.6.3