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

aibomoves.h

Go to the documentation of this file.
00001 // ***************************************************************************
00002 //                           aibomoves.h
00003 //
00004 //    copyright            : (C) 2003 by tbaier
00005 //    email                : tbaier@informatik.uni-hamburg.de
00006 // ***************************************************************************
00007 
00008 #ifndef AIBOMOVES_H
00009 #define AIBOMOVES_H
00010 
00011 #include "aibojoint.h"
00012 #include <OPENR/OObject.h>
00013 #include <OPENR/OSubject.h>
00014 
00016 enum MOVE_STATUS{
00017   MOVING_IDLE,  
00018   MOVING_CONT,  
00019   MOVING_FINISH 
00020 };
00021 
00023 class AiboMoves {
00024  public:
00025  
00027   AiboMoves(AiboJoint *joints);
00028 
00030   virtual ~AiboMoves(){};
00031 
00035   void SetJoints(AiboJoint *joints);
00036   
00039   void OpenJointPrimitives();
00040 
00044   void InitJoints(OSubject *subject);
00045 
00049   int GetMoveCount();
00050   
00052   void ResetMoveCounter();
00053 
00057   //  MOVE_STATUS GetStatus();
00058   
00065   MOVE_STATUS Movement(OSubject *subject, const double *angles, int numMoves);
00066 
00070   virtual MOVE_STATUS MoveToSleeping(OSubject* subject) = 0;
00071 
00075   virtual MOVE_STATUS MoveToBroadbase(OSubject* subject) = 0;
00076 
00081   void MakeHandstand(OSubject* subject);
00082   
00083  protected:
00084 
00086   double *Delta;
00087  
00089   int MoveCounter;
00090 
00092   AiboJoint *Joints;
00093 
00094 };
00095 
00096 
00097 // ******************************************
00098 // **                                      **
00099 // ******************************************
00100 inline int AiboMoves::GetMoveCount()
00101 {
00102   return MoveCounter;
00103 };
00104 
00105 
00106 // ******************************************
00107 // **                                      **
00108 // ******************************************
00109 inline void AiboMoves::ResetMoveCounter()
00110 { OSYSDEBUG(("AiboMoves::ResetMoveCounter()\n"));
00111   MoveCounter = -1;
00112 };
00113 
00114 
00115 // ******************************************
00116 // **                                      **
00117 // ******************************************
00118 inline void AiboMoves::OpenJointPrimitives()
00119 {
00120  Joints->OpenPrimitives();      
00121 };
00122 
00123 
00124 // ******************************************
00125 // **                                      **
00126 // ******************************************
00127 inline void AiboMoves::InitJoints(OSubject *subject)
00128 {
00129   Joints->NewCommandVectorData();
00130         
00131   if (subject->IsReady()){
00132     OSYSDEBUG(("---Joints ready to set\n"));
00133     Joints->RefreshCommandVectors();
00134     subject->SetData(Joints->Region[0]);
00135     subject->NotifyObservers();
00136 
00137     Joints->SetState(J_START);
00138   }
00139 
00140   Joints->SetJointGain();
00141  };
00142 
00143 #endif //AIBOMOVES_H


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