00001
00002
00003
00004
00005
00006 #include "MSH2004InvKinWalkingEngine.h"
00007 #include "Platform/GTAssert.h"
00008 #include "Tools/Location.h"
00009 #include "Tools/Debugging/Debugging.h"
00010
00011
00012
00013
00014
00015
00016
00017 MSH2004InvKinWalkingEngine::MSH2004InvKinWalkingEngine(
00018 InvKinWalkingEngine *pEngine
00019 )
00020 : WalkingEngine(*pEngine), pEngine(pEngine)
00021 {
00022 }
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
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