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
/**
* @file ArmMotionRequest.h
*
* @author <a href="mailto:guido.schillaci@informatik.hu-berlin.de">Guido Schillaci</a>
* @author <a href="mailto:scheunem@informatik.hu-berlin.de">Marcus Scheunemann</a>
* Declaration of class ArmMotionRequest
*/

#ifndef _ArmMotionRequest_h_
#define _ArmMotionRequest_h_

#include "Tools/DataStructures/Printable.h"
#include "Tools/DataStructures/Serializer.h"
//#include "Tools/DataStructures/Streamable.h"
//#include "PlatformInterface/PlatformInterchangeable.h"

#include "Tools/Math/Vector2.h"
#include "Tools/Math/Vector3.h"
#include "Representations/Infrastructure/CameraInfo.h"

#include "Messages/Representations.pb.h"

/**
 * @class ArmMotionRequest
 * This describes the ArmMotionRequest
 */
class ArmMotionRequest : public naoth::Printable
{
public:
  
//  enum Coordinate
//  {
//    Hip,
//    LFoot,
//    RFoot,
//    numOfCoordinate
//  };


  /** ids for all motion types */
  enum ArmMotionID
  {
    hold,
    set_left_shoulder_position,
    set_left_shoulder_stiffness,
    set_left_elbow_position,
    set_left_elbow_stiffness,
    set_right_shoulder_position,
    set_right_shoulder_stiffness,
    set_right_elbow_position,
    set_right_elbow_stiffness,
    set_left_arm_joint_position,
    set_left_arm_joint_stiffness,
    set_right_arm_joint_position,
    set_right_arm_joint_stiffness,
    set_both_arms_joint_position,
    set_both_arms_joint_stiffness,

    arms_none,
    arms_back,
    arms_down,
    arms_synchronised_with_walk,
      
    numOfArmMotion
  };

  /** constructor */
  ArmMotionRequest() <--- Member variable 'ArmMotionRequest::stiffness' is not initialized in the constructor.<--- Member variable 'ArmMotionRequest::max_velocity_deg_in_sec' is not initialized in the constructor.
    : 
    id(arms_none) 
  { }
  
  virtual ~ArmMotionRequest() { }

  void reset() { }


  /** id of the motion to be executed */
  ArmMotionID id;

//  // id of the camera to use
//  naoth::CameraInfo::CameraID cameraID;

  // LEFT ARM
  // describes the target angle-position: x=Pitch, y=roll
  Vector2<double> lShoulderPosition;
  // describes the target stiffness: x=Pitch, y=roll
  Vector2<double> lShoulderStiffness;
  // describes the target angle-position: x=yaw, y=roll
  Vector2<double> lElbowPosition;
  // describes the target stiffness: x=yaw, y=roll
  Vector2<double> lElbowStiffness;

  // RIGHT ARM
  // describes the target angle-position: x=Pitch, y=roll
  Vector2<double> rShoulderPosition;
  // describes the target stiffness: x=Pitch, y=roll
  Vector2<double> rShoulderStiffness;
  // describes the target angle-position: x=yaw, y=roll
  Vector2<double> rElbowPosition;
  // describes the target stiffness: x=yaw, y=roll
  Vector2<double> rElbowStiffness;

  double stiffness;

  double max_velocity_deg_in_sec;

  /** return the name of the motion id */
  static std::string getName(ArmMotionID id);

  /** return the head motion id reprented by the name */
  static ArmMotionID getId(const std::string& name);

  virtual void print(std::ostream& stream) const;

};

namespace naoth
{
  template<>
  class Serializer<ArmMotionRequest>
  {
  public:
    static void serialize(const ArmMotionRequest& representation, std::ostream& stream);
    static void serialize(const ArmMotionRequest& representation, naothmessages::ArmMotionRequest* msg);
    static void deserialize(std::istream& stream, ArmMotionRequest& representation);
    static void deserialize(const naothmessages::ArmMotionRequest* msg, ArmMotionRequest& representation);
  };
}

#endif // _ArmMotionRequest_h_