NimbRo ROS Soccer Package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Keyframe.h
1 #ifndef KEYFRAME_H_
2 #define KEYFRAME_H_
3 #include "keyframe_player/Vec2f.h"
4 
5 namespace kf_player
6 {
7 
8 enum gainSelectEnum
9 {
10  nonE=0,
11  rollE=1,
12  pitchE=2,
13  yawE=3
14 };
15 
16 class Keyframe
17 {
18 public:
19  Keyframe() : type(TYPE_DEFAULT), t(0.0), x(0.0), v(0.0), a(0.0), effort(0.0), suppLeftLeg(0.0), suppRightLeg(0.0), pGain(0.0), iGain(0.0), dGain(0.0), gainSelect(nonE), roll(0.0), pitch(0.0), yaw(0.0),playingIndex(0) {}
20  Keyframe(double t, double x, double v, double effort, double suppLeftLeg, double suppRightLeg, double pGain, double iGain, double dGain, double limit, gainSelectEnum gainSelect, double roll, double pitch, double yaw) : type(TYPE_DEFAULT), t(t), x(x), v(v), a(0.0), effort(effort), suppLeftLeg(suppLeftLeg), suppRightLeg(suppRightLeg), pGain(pGain), iGain(iGain), dGain(dGain), limit(limit), gainSelect(gainSelect), roll(roll), pitch(pitch), yaw(yaw),playingIndex(0) {}
21  virtual ~Keyframe() {};
22 
23  int type;
24  double t;
25  double x;
26  double v;
27  double a;
28  double effort;
29  double suppLeftLeg;
30  double suppRightLeg;
31  double pGain; double iGain; double dGain; double limit; gainSelectEnum gainSelect; double roll; double pitch;double yaw;
32  int playingIndex;
33 
34  enum types
35  {
36  TYPE_DEFAULT,
37  TYPE_AMAX,
38  TYPE_VMAX,
39  TYPE_UNREACHABLE
40  };
41 
42  void set(double t, double x, double v, double effort, double suppLeftLeg, double suppRightLeg, double pGain, double iGain, double dGain, double limit, gainSelectEnum gainSelect, double roll, double pitch, double yaw);
43  Vec2f location();
44  void setLocation(Vec2f);
45  void relocateBy(Vec2f);
46 
47  inline bool operator<(const Keyframe& k) const {return (t < k.t);}
48  inline bool operator<=(const Keyframe& k) const {return (t <= k.t);}
49  inline bool operator>(const Keyframe& k) const {return (t > k.t);}
50  inline bool operator>=(const Keyframe& v) const {return (t >= v.t);}
51  inline bool operator==(const Keyframe& k) const {return (t == k.t && x == k.x && v == k.v);}
52  inline bool operator!=(const Keyframe& k) const {return (t != k.t || x != k.x || v != k.v);}
53 };
54 
55 QDebug operator<<(QDebug dbg, const Keyframe &k);
56 
57 }
58 #endif /* KEYFRAME_H_ */