00001 /** 00002 * @file Xabsl2BehaviorControl.cpp 00003 * 00004 * Implementation of class Xabsl2BehaviorControl. 00005 * 00006 * @author Uwe Düffert 00007 * @author Jan Hoffmann 00008 * @author Matthias Jüngel 00009 * @author Martin Lötzsch 00010 */ 00011 00012 #include "Xabsl2BehaviorControl.h" 00013 #include "Platform/GTAssert.h" 00014 00015 Xabsl2BehaviorControl::Xabsl2BehaviorControl 00016 (const BehaviorControlInterfaces& interfaces, 00017 SolutionRequest::xabsl2EngineID id 00018 ) : 00019 BehaviorControl(interfaces), 00020 GTXabsl2EngineExecutor(id,SolutionRequest::behaviorControl,robotPose.frameNumber) 00021 { 00022 } 00023 00024 void Xabsl2BehaviorControl::executeIfEngineCouldNotBeCreated() 00025 { 00026 motionRequest.motionType = MotionRequest::specialAction; 00027 motionRequest.specialActionRequest.specialActionType = SpecialActionRequest::demoScratchHead; 00028 } 00029 00030 void Xabsl2BehaviorControl::printGeneratedMainActionToString(char* buf) 00031 { 00032 motionRequest.printOut(buf); 00033 } 00034 00035 bool Xabsl2BehaviorControl::handleMessage(InMessage& message) 00036 { 00037 return GTXabsl2EngineExecutor::handleMessage(message); 00038 } 00039 00040 Xabsl2BehaviorControlAgentInterface::Xabsl2BehaviorControlAgentInterface 00041 (const char* name, 00042 Xabsl2BehaviorControl* behaviorControl, 00043 const BehaviorControlInterfaces& interfaces 00044 ) : 00045 BehaviorControl(interfaces), Xabsl2NamedItem(name), behaviorControl(behaviorControl) 00046 { 00047 ASSERT(behaviorControl != 0); 00048 } 00049 00050 Xabsl2BehaviorControlAgentInterface::~Xabsl2BehaviorControlAgentInterface() 00051 { 00052 if (behaviorControl != 0) delete behaviorControl; 00053 } 00054 00055 void Xabsl2BehaviorControlAgentInterface::execute() 00056 { 00057 ASSERT(behaviorControl != 0); 00058 behaviorControl->setSelectedAgent(n); 00059 behaviorControl->execute(); 00060 } 00061 00062 bool Xabsl2BehaviorControlAgentInterface::handleMessage(InMessage& message) 00063 { 00064 ASSERT(behaviorControl != 0); 00065 return behaviorControl->handleMessage(message); 00066 } 00067
1.3.6