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

Modules/WalkingEngine/MSH2004InvKinWalkingEngine.cpp

Go to the documentation of this file.
00001 /**
00002  * MSH2004InvKinWalkingEngine
00003  *
00004  * @author Thomas Kindler <thomas.kindler@gmx.de>
00005  */
00006 #include "MSH2004InvKinWalkingEngine.h"
00007 #include "Platform/GTAssert.h"
00008 #include "Tools/Location.h"
00009 #include "Tools/Debugging/Debugging.h"
00010 
00011 /**
00012  * Construct a new MSH Walking engine
00013  *
00014  * @param  pEngine  InvKinWalkingEngine to use.
00015  *
00016  */
00017 MSH2004InvKinWalkingEngine::MSH2004InvKinWalkingEngine(
00018   InvKinWalkingEngine  *pEngine
00019 )
00020   : WalkingEngine(*pEngine), pEngine(pEngine)
00021 {
00022 }
00023 
00024 
00025 /**
00026  * Calculates the next joint data set. 
00027  *
00028  * @param   jointData      stores calculated frame  
00029  * @param   walkRequest  the current motion request  
00030  * @param   positionInWalkingCycle The position in the walking cycle
00031  *
00032  * @return  true if next set should be calculated by WalkingEngine,
00033  *          false if change to other module can occur 
00034  * 
00035  */
00036 bool MSH2004InvKinWalkingEngine::executeParameterized(
00037         JointData      &jointData,
00038   const WalkRequest  &walkRequest,
00039   double positionInWalkingCycle
00040 )
00041 { 
00042   char *paramType = "";
00043 
00044   if (walkRequest.walkParams.translation.x  > -50 ||
00045       fabs(walkRequest.walkParams.rotation) >   2  ) {
00046     paramType = "fast";
00047     pEngine->setParameters(&forward);
00048   } else {
00049     paramType = "conservative";
00050     pEngine->setParameters(&backward);
00051   }
00052   
00053   INFO( sendWalkingEngineInfo, idText, text,
00054     "walkParams: "
00055     "x = " << walkRequest.walkParams.translation.x << ", " <<
00056     "y = " << walkRequest.walkParams.translation.y << ", " <<
00057     "r = " << walkRequest.walkParams.rotation      << " -> " <<
00058     "using " << paramType << " parameters."
00059   );
00060  
00061   bool   result = pEngine->executeParameterized(jointData, walkRequest, positionInWalkingCycle);
00062   return result;
00063 }
00064 
00065 
00066 bool MSH2004InvKinWalkingEngine::handleMessage(InMessage& message)
00067 {
00068   return pEngine->handleMessage(message);
00069 }
00070 

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