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

# Modules/BehaviorControl/CommonXabsl2Symbols/MotionRequestSymbols.cpp

Go to the documentation of this file.

    00001 /**
    00002 * @file MotionRequestSymbols.cpp
    00003 *
    00004 * Declaration of class MotionRequestSymbols.
    00005 *
    00006 * @author Max Risler
    00007 */
    00008
    00009 #include "MotionRequestSymbols.h"
    00010 #include "Tools/Math/Geometry.h"
    00011 #include "Tools/StringFunctions.h"
    00012
    00013 MotionRequestSymbols::MotionRequestSymbols(const BehaviorControlInterfaces& interfaces)
    00014 : BehaviorControlInterfaces(interfaces)
    00015 {
    00016 }
    00017
    00018 void MotionRequestSymbols::registerSymbols(Xabsl2Engine &engine)
    00019 {
    00020   char s[256];
    00021   int i;
    00022
    00023
    00024   // "executed-motion-request.motion-type"
    00025   engine.registerEnumeratedInputSymbol("executed-motion-request.motion-type",(const int*)&(motionInfo.executedMotionRequest.motionType));
    00026   for (i=0;i<MotionRequest::numOfMotion;i++)
    00027   {
    00028     getXmlString(s,MotionRequest::getMotionName((MotionRequest::MotionID)i));
    00029     engine.registerEnumeratedInputSymbolEnumElement("executed-motion-request.motion-type",s,i);
    00030   }
    00031
    00032   // "executed-motion-request.walk-type"
    00033   engine.registerEnumeratedInputSymbol("executed-motion-request.walk-type",(const int*)&(motionInfo.executedMotionRequest.walkRequest.walkType));
    00034   for (i=0;i<WalkRequest::numOfWalkType;i++)
    00035   {
    00036     getXmlString(s,WalkRequest::getWalkTypeName((WalkRequest::WalkType)i));
    00037     engine.registerEnumeratedInputSymbolEnumElement("executed-motion-request.walk-type",s,i);
    00038   }
    00039
    00040   // "executed-motion-request.special-action-type"
    00041   engine.registerDecimalInputSymbol("executed-motion-request.special-action-type",this,
    00042     (double (Xabsl2FunctionProvider::*)())&MotionRequestSymbols::getExecutedSpecialActionType);
    00043
    00044   engine.registerDecimalInputSymbol("executed-motion-request.position-in-walk-cycle",this,
    00045     (double (Xabsl2FunctionProvider::*)())&MotionRequestSymbols::getPositionInWalkCycle);
    00046   engine.registerDecimalInputSymbol("executed-motion-request.speed-x",this,
    00047     (double (Xabsl2FunctionProvider::*)())&MotionRequestSymbols::getSpeedX);
    00048   engine.registerDecimalInputSymbol("executed-motion-request.speed-y",this,
    00049     (double (Xabsl2FunctionProvider::*)())&MotionRequestSymbols::getSpeedY);
    00050 }
    00051
    00052 double MotionRequestSymbols::getExecutedSpecialActionType()
    00053 {
    00054   return (double)motionInfo.executedMotionRequest.specialActionRequest.specialActionType;
    00055 }
    00056
    00057 double MotionRequestSymbols::getSpeedX()
    00058 {
    00059   return (double)motionInfo.executedMotionRequest.walkRequest.walkParams.translation.x;
    00060 }
    00061 double MotionRequestSymbols::getSpeedY()
    00062 {
    00063   return (double)motionInfo.executedMotionRequest.walkRequest.walkParams.translation.y;
    00064 }
    00065 double MotionRequestSymbols::getPositionInWalkCycle()
    00066 {
    00067   return motionInfo.positionInWalkCycle;
    00068 }
    00069