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

# Modules/BehaviorControl/CommonXabsl2Symbols/PlayersSymbols.cpp

Go to the documentation of this file.

    00001 /**
    00002 * @file PlayerSymbols.cpp
    00003 *
    00004 * Implementation of class PlayerSymbols.
    00005 *
    00006 * @author Marc Dassler
    00007 */
    00008
    00009 #include "PlayersSymbols.h"
    00010 #include "Representations/WLan/BehaviorTeamMessage.h"
    00011
    00012 PlayersSymbols::PlayersSymbols(const BehaviorControlInterfaces& interfaces)
    00013 : BehaviorControlInterfaces(interfaces)
    00014 {
    00015 }
    00016
    00017
    00018 void PlayersSymbols::registerSymbols(Xabsl2Engine& engine)
    00019 {
    00020
    00021   engine.registerDecimalInputSymbol("players.angle-to-own-detected-player",this,
    00022     (double (Xabsl2FunctionProvider::*)())&PlayersSymbols::getAngleToOwnDetectedPlayer);
    00023
    00024   engine.registerDecimalInputSymbol("players.time-since-detected-own-player",this,
    00025     (double (Xabsl2FunctionProvider::*)())&PlayersSymbols::getTimeSinceDetectedOwnPlayer);
    00026
    00027   engine.registerDecimalInputSymbol("players.free-space-around-robot",this,
    00028     (double (Xabsl2FunctionProvider::*)())&PlayersSymbols::getFreeSpaceAroundRobot);
    00029
    00030   engine.registerDecimalInputSymbol("players.distance-to-opp-player-ahead",this,
    00031     (double (Xabsl2FunctionProvider::*)())&PlayersSymbols::getDistanceToOppInSectorAhead);
    00032
    00033   engine.registerDecimalInputSymbol("players.distance-to-opp-player-behind",this,
    00034     (double (Xabsl2FunctionProvider::*)())&PlayersSymbols::getDistanceToOppInSectorBehind);
    00035
    00036   engine.registerDecimalInputSymbol("players.distance-to-opp-player-left",this,
    00037     (double (Xabsl2FunctionProvider::*)())&PlayersSymbols::getDistanceToOppInSectorLeft);
    00038
    00039   engine.registerDecimalInputSymbol("players.distance-to-opp-player-right",this,
    00040     (double (Xabsl2FunctionProvider::*)())&PlayersSymbols::getDistanceToOppInSectorRight);
    00041
    00042
    00043
    00044 }
    00045
    00046 void PlayersSymbols::update()
    00047 {
    00048 }
    00049
    00050
    00051
    00052 double PlayersSymbols::getAngleToOwnDetectedPlayer()
    00053 {
    00054   return toDegrees(Geometry::angleTo(robotPose,playersModel.positionOfOwnPlayerAhead));
    00055 }
    00056
    00057 double PlayersSymbols::getTimeSinceDetectedOwnPlayer()
    00058 {
    00059   return (double)SystemCall::getTimeSince(playersModel.timeStampToSeenOwnPlayerAhead);
    00060 }
    00061
    00062 double PlayersSymbols::getFreeSpaceAroundRobot()
    00063 {
    00064   return playersModel.freeSpaceAroundRobot;
    00065 }
    00066 double PlayersSymbols::getDistanceToOppInSectorAhead()
    00067 {
    00068   return playersModel.distanceToOppInSectorAhead;
    00069 }
    00070 double PlayersSymbols::getDistanceToOppInSectorBehind()
    00071 {
    00072   return playersModel.distanceToOppInSectorBehind;
    00073 }
    00074 double PlayersSymbols::getDistanceToOppInSectorLeft()
    00075 {
    00076   return playersModel.distanceToOppInSectorLeft;
    00077 }
    00078 double PlayersSymbols::getDistanceToOppInSectorRight()
    00079 {
    00080   return playersModel.distanceToOppInSectorRight;
    00081 }
    00082
    00083