1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/**
* @file MotionSymbols.h
*
* @author <a href="mailto:mellmann@informatik.hu-berlin.de">Heinrich Mellmann</a>
* Definition of class MotionSymbols
*/

#ifndef _MotionSymbols_H_
#define _MotionSymbols_H_

#include <ModuleFramework/Module.h>
#include <XabslEngine/XabslEngine.h>

#include "Tools/Math/Common.h"

// representations
#include "Representations/Motion/Request/HeadMotionRequest.h"
#include "Representations/Motion/Request/MotionRequest.h"
#include "Representations/Motion/MotionStatus.h"
#include <Representations/Infrastructure/JointData.h>
#include <Representations/Infrastructure/FrameInfo.h>
#include "Representations/Modeling/BallModel.h"
#include <Representations/Motion/CollisionPercept.h>

BEGIN_DECLARE_MODULE(MotionSymbols)
  REQUIRE(MotionStatus)
  REQUIRE(FrameInfo)
  REQUIRE(SensorJointData)

  REQUIRE(BallModel)
  REQUIRE(CollisionPercept)

  PROVIDE(HeadMotionRequest)
  PROVIDE(MotionRequest)
END_DECLARE_MODULE(MotionSymbols)

class MotionSymbols: public MotionSymbolsBase
{

public:
  MotionSymbols()
  :
    walkStyle(normal),
    stepControlFoot(none),
    stepControlRequestTime(0),
    stepControlRequestSpeedDirection(0),
    stepControlScale(1.0),
    actionPerformed(-1)
  {
    theInstance = this;
  }

  virtual ~MotionSymbols(){}

  /** registers the symbols at an engine */
  void registerSymbols(xabsl::Engine& engine);

  virtual void execute();

  void updateOutputSymbols();

  enum WalkStyle
  {
    stable,
    normal,
    fast,
    num_of_styles
  };

  static std::string getWalkStyleName(WalkStyle i);

private:
  static MotionSymbols* theInstance;

  // setter and getter
  static void setHeadMotionRequest(int value);
  static int getHeadMotionRequestId();
  static int getHeadMotionStatus();
  static void setCameraId(int value);
  static int getCameraId();

  static void setArmRequestId(int value);
  static int getArmRequestId();

  static void setMotionRequestId(int value);
  static int getMotionRequestId();
  static int getMotionStatusId();
  static double getMotionStatusTime();
  static bool getMotionStatusLeftMovable();
  static bool getMotionStatusRightMovable();

  static void setWalkOffsetRot(double rot);
  static void setWalkSpeedRot(double rot);
  static void setWalkSpeedY(double x);<--- Function 'setWalkSpeedY' argument 1 names different: declaration 'x' definition 'y'.
  static void setWalkSpeedX(double y);<--- Function 'setWalkSpeedX' argument 1 names different: declaration 'y' definition 'x'.
  static void setKickDirection(double alpha);

  static double getWalkOffsetRot();
  static double getWalkSpeedRot();
  static double getWalkSpeedX();
  static double getWalkSpeedY();
  static double getKickDirection();

  static double getPlannedHipRot();

  static double getHeadPitchAngle();
  static double getHeadYawAngle();

  static double getlastComputedCollisionRight();
  static double getlastComputedCollisionLeft();

  static void setHeadPositionX(double rot);
  static double getHeadPositionX();
  static void setHeadPositionY(double rot);
  static double getHeadPositionY();

  // some local members
  struct HeadMotion
  {
    double headYaw;
    double headPitch;
    double time;
    HeadMotion()
      :
      headYaw(0.0),
      headPitch(0.0),
      time(0.0)
      {}
  };


  WalkStyle walkStyle;

  enum StepControlFoot
  {
    left,
    right,
    none
  };

  static std::string getStepControlFootName(StepControlFoot i);

  static bool dribbleG();
  static void dribble(bool v);

  StepControlFoot stepControlFoot;
  double stepControlRequestTime;
  Pose2D stepControlRequestTarget;
  double stepControlRequestSpeedDirection;
  double stepControlScale;
  int actionPerformed;
};//end class MotionSymbols

#endif // _MotionSymbols_H_