Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

aibolib.h

Go to the documentation of this file.
00001 // ***************************************************************************
00002 //                           aibolib.h
00003 //
00004 //    copyright            : (C) 2003-2004 by tbaier
00005 //    email                : tbaier@informatik.uni-hamburg.de
00006 // ***************************************************************************
00007 
00038 #ifndef AIBOLIB_H
00039 #define AIBOLIB_H
00040 
00041 
00042 //std includes
00043 #include <math.h>
00044 
00045 //AIBO includes
00046 #include <OPENR/OObject.h>
00047 #include <OPENR/OSubject.h>
00048 #include <OPENR/OObserver.h>
00049 #include <OPENR/OObserverVector.h>
00050 #include <OPENR/ODataFormats.h>
00051 #include <OPENR/OPENRAPI.h>
00052 #include <OPENR/OSyslog.h>
00053 #include <MCOOP.h>
00054 
00055 #include <Types.h>
00056 
00057 
00058 #include "aiboled.h"
00059 #include "aibosensor.h"
00060 #include "aibocam.h"
00061 //#include "aibojoint.h"
00062 #include "aiboleg.h"
00063 #include "aibohead.h"
00064 #include "aibosound.h"
00065 
00083 class Aibo: public OObject {
00084 
00085  public:
00086   
00088   Aibo();
00090   virtual ~Aibo(){}
00091 
00093   virtual OStatus DoInit   (const OSystemEvent& event) = 0;
00094 
00096   virtual OStatus DoStart  (const OSystemEvent& event) = 0;
00097 
00099   virtual OStatus DoStop   (const OSystemEvent& event) = 0;
00100 
00102   virtual OStatus DoDestroy(const OSystemEvent& event) = 0;
00103 
00107   int MotorPowerOn();
00108 
00112   int MotorPowerOff();
00113 
00114 #ifndef RP
00115 
00119   static unsigned long Aibo::GetCurrentSystemTime();
00120   
00125   static unsigned long Aibo::GetTimeDiff(unsigned long t);
00126 #endif    
00127 
00128  protected:
00130   void WaitReturnKey()const ;
00131   
00136   //OPrimitiveID GetPrimitiveID(const char* primitiveLocator);
00137 
00139   // void OpenAllPrimitives();
00140   
00146   //void CreateCommandVectors();
00147 
00148   //Variables-----------------------------------------------------------
00150   //AiboSensor Sensors;
00151   
00153   //AiboCam Camera;
00154 
00156   //AiboLed Leds;
00157   
00159   //AiboHead Head;
00160  
00162   //AiboLeg Legs;
00163   
00165   //AiboSound Sounds;
00166 };
00167 
00168 
00169 // *******************************
00170 // *                             *
00171 // *******************************
00172 inline int Aibo::MotorPowerOn()
00173 {
00174   if( OPENR::SetMotorPower(opowerON) == oSUCCESS)
00175     return 1;
00176   else
00177     return 0;
00178 };
00179 
00180 
00181 // *******************************
00182 // *                             *
00183 // *******************************
00184 inline int Aibo::MotorPowerOff()
00185 {
00186   if( OPENR::SetMotorPower(opowerOFF) == oSUCCESS)
00187     return 1;
00188   else
00189     return 0;
00190 };
00191 
00192 
00193 #ifndef RP
00194 // *******************************
00195 // *                             *
00196 // *******************************
00197 inline unsigned long Aibo::GetCurrentSystemTime() 
00198 {
00199   SystemTime sysTime;
00200   GetSystemTime(&sysTime);
00201   return (sysTime.seconds * 1000 + sysTime.useconds / 1000);
00202 }
00203 
00204 // *******************************
00205 // *                             *
00206 // *******************************
00207 inline unsigned long Aibo::GetTimeDiff(unsigned long t)
00208 {
00209   return(GetCurrentSystemTime()-t);
00210 };
00211 #endif
00212 
00213 #endif //define AIBOLIB_H


tams Tim Baier AiboLib v0.2.4
Generated Thu Jan 19 11:54:29 2006 by doxygen 1.4.3