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

# Modules/BehaviorControl/GT2005BehaviorControl/GT2005Symbols/TestSymbols.cpp

Go to the documentation of this file.

    00001 /**
    00002 * @file TestSymbols.cpp
    00003 *
    00004 * Implementation of class TestSymbols.
    00005 *
    00006 * @author Bastian Schmitz
    00007 */
    00008
    00009 #include "TestSymbols.h"
    00010 #include "Tools/Math/Geometry.h"
    00011 #include "Tools/FieldDimensions.h"
    00012
    00013 TestSymbols::TestSymbols(const BehaviorControlInterfaces& interfaces)
    00014 : BehaviorControlInterfaces(interfaces),
    00015 disableCarryBall(false),
    00016 disableKicking(false),
    00017 useSlowCarryBall(false)
    00018 {
    00019 }
    00020
    00021
    00022 void TestSymbols::registerSymbols(Xabsl2Engine& engine)
    00023 {
    00024   engine.registerBooleanInputSymbol("test.disable-carry-ball", &disableCarryBall);
    00025   engine.registerBooleanInputSymbol("test.disable-kicking", &disableKicking);
    00026   engine.registerBooleanInputSymbol("test.use-carry-ball-slow", &useSlowCarryBall);
    00027
    00028   engine.registerDecimalInputFunction(
    00029     "kst.sendRecord",this,
    00030     (double (Xabsl2FunctionProvider::*)())&TestSymbols::sendKickRecord);
    00031   engine.registerDecimalInputFunctionParameter(
    00032     "kst.sendRecord",
    00033     "kst.sendRecord.xr",
    00034     kick.ballXR );
    00035   engine.registerDecimalInputFunctionParameter(
    00036     "kst.sendRecord",
    00037     "kst.sendRecord.yr",
    00038     kick.ballYR );
    00039   //engine.registerDecimalInputFunctionParameter(
    00040   //  "kst.sendRecord",
    00041   //  "kst.sendRecord.tr",
    00042   //  kick.ballTR );
    00043   engine.registerDecimalInputFunctionParameter(
    00044     "kst.sendRecord",
    00045     "kst.sendRecord.xs",
    00046     kick.ballXS );
    00047   engine.registerDecimalInputFunctionParameter(
    00048     "kst.sendRecord",
    00049     "kst.sendRecord.ys",
    00050     kick.ballYS );
    00051   //engine.registerDecimalInputFunctionParameter(
    00052   //  "kst.sendRecord",
    00053   //  "kst.sendRecord.ts",
    00054   //  kick.ballTS );
    00055   engine.registerDecimalInputFunctionParameter(
    00056     "kst.sendRecord",
    00057     "kst.sendRecord.xa",
    00058     kick.ballXA );
    00059   engine.registerDecimalInputFunctionParameter(
    00060     "kst.sendRecord",
    00061     "kst.sendRecord.ya",
    00062     kick.ballYA );
    00063   //engine.registerDecimalInputFunctionParameter(
    00064   //  "kst.sendRecord",
    00065   //  "kst.sendRecord.ta",
    00066   //  kick.tA );
    00067   engine.registerDecimalInputFunctionParameter(
    00068     "kst.sendRecord",
    00069     "kst.sendRecord.id",
    00070     kickID );
    00071   kick.ballTR = SystemCall::getCurrentSystemTime();
    00072   kick.ballTS = SystemCall::getCurrentSystemTime()+100;
    00073   kick.tA = SystemCall::getCurrentSystemTime()+1000;
    00074 }
    00075
    00076 void TestSymbols::update()
    00077 {
    00078   disableCarryBall = false;
    00079   disableKicking = false;
    00080   useSlowCarryBall = false;
    00081   DEBUG_RESPONSE("Behavior:handle-ball-test:disableCarryBall", disableCarryBall = true;);
    00082   DEBUG_RESPONSE("Behavior:handle-ball-test:disableKicking", disableKicking = true;);
    00083   DEBUG_RESPONSE("Behavior:handle-ball-test:useSlowCarryBall", useSlowCarryBall = true;);
    00084 }
    00085
    00086 double TestSymbols::sendKickRecord()
    00087 {
    00088   OUTPUT(idText,text," sendKickRecord ");
    00089   OUTPUT(idKickRecord, bin, SpecialActionRequest::getSpecialActionIDName((SpecialActionRequest::SpecialActionID)(int)kickID) << kick);
    00090 //  INFO(sendKickRecords, idKickRecord, bin, SpecialActionRequest::getSpecialActionIDName(kickID) << kick);
    00091   return 0;
    00092 }