Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Modules/HeadControl/Xabsl2HeadControl.cpp

Go to the documentation of this file.
00001 /**
00002 * @file Xabsl2HeadControl.cpp
00003 * 
00004 * Implementation of class Xabsl2HeadControl.
00005 *
00006 * @author Martin Lötzsch
00007 */
00008 
00009 #include "Xabsl2HeadControl.h"
00010 #include "Platform/GTAssert.h"
00011 
00012 Xabsl2HeadControl::Xabsl2HeadControl
00013 (const HeadControlInterfaces& interfaces,
00014  SolutionRequest::xabsl2EngineID id
00015  ) : 
00016 HeadControl(interfaces), 
00017 GTXabsl2EngineExecutor(id,SolutionRequest::headControl,frameNumber)
00018 {
00019 }
00020 
00021 void Xabsl2HeadControl::executeIfEngineCouldNotBeCreated()
00022 {
00023   headMotionRequest.pan = 1500000;
00024   headMotionRequest.tilt = 1000000;
00025   headMotionRequest.roll = 0;
00026   headMotionRequest.mouth = -700000;
00027 }
00028 
00029 void Xabsl2HeadControl::printGeneratedMainActionToString(char* buf)
00030 {
00031   sprintf(buf, "t1: %2.3f  pan: %2.3f  t2: %2.3f  [rad]",
00032     (double)headMotionRequest.tilt/1000000.0, 
00033     (double)headMotionRequest.pan/1000000.0, 
00034     (double)headMotionRequest.roll/1000000.0);
00035 }
00036 
00037 bool Xabsl2HeadControl::handleMessage(InMessage& message)
00038 {
00039   return GTXabsl2EngineExecutor::handleMessage(message);
00040 }
00041 
00042 Xabsl2HeadControlAgentInterface::Xabsl2HeadControlAgentInterface
00043 (const char* name,
00044  Xabsl2HeadControl* headControl,
00045  const HeadControlInterfaces& interfaces
00046  ) : 
00047 HeadControl(interfaces), Xabsl2NamedItem(name), headControl(headControl)
00048 {
00049   ASSERT(headControl != 0);
00050 }
00051 
00052 Xabsl2HeadControlAgentInterface::~Xabsl2HeadControlAgentInterface()
00053 {
00054   if (headControl != 0) delete headControl;
00055 }
00056 
00057 void Xabsl2HeadControlAgentInterface::execute()
00058 {
00059   ASSERT(headControl != 0);
00060   headControl->setSelectedAgent(n);
00061   headControl->execute();
00062 }
00063 
00064 bool Xabsl2HeadControlAgentInterface::handleMessage(InMessage& message)
00065 {
00066   ASSERT(headControl != 0);
00067   return headControl->handleMessage(message);
00068 }
00069 
00070 /*
00071 * Change log :
00072 * 
00073 * $Log: Xabsl2HeadControl.cpp,v $
00074 * Revision 1.3  2004/05/24 18:19:43  jhoffman
00075 * microrad --> rad
00076 *
00077 * Revision 1.2  2004/05/23 18:58:20  spranger
00078 * added framenumber to HeadControl interface, GTXabsl2EngineExecutor and following
00079 *
00080 * Revision 1.1.1.1  2004/05/22 17:19:23  cvsadm
00081 * created new repository GT2004_WM
00082 *
00083 * Revision 1.3  2004/05/17 18:35:22  loetzsch
00084 * continued support for multiple Xabsl engines in different modules
00085 *
00086 * Revision 1.2  2004/05/14 22:53:07  roefer
00087 * Warnings removed
00088 *
00089 * Revision 1.1  2004/05/14 11:37:08  loetzsch
00090 * support for multiple xabsl2engines in different modules
00091 * preliminary GT2004HeadControl (does not work at all)
00092 *
00093 */
00094 

Generated on Thu Sep 23 19:57:28 2004 for GT2004 by doxygen 1.3.6