Fawkes API  Fawkes Development Version
NaoJointStiffnessInterface.h
00001 
00002 /***************************************************************************
00003  *  NaoJointStiffnessInterface.h - Fawkes BlackBoard Interface - NaoJointStiffnessInterface
00004  *
00005  *  Templated created:   Thu Oct 12 10:49:19 2006
00006  *  Copyright  2008-2011  Tim Niemueller
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023 
00024 #ifndef __INTERFACES_NAOJOINTSTIFFNESSINTERFACE_H_
00025 #define __INTERFACES_NAOJOINTSTIFFNESSINTERFACE_H_
00026 
00027 #include <interface/interface.h>
00028 #include <interface/message.h>
00029 #include <interface/field_iterator.h>
00030 
00031 namespace fawkes {
00032 
00033 class NaoJointStiffnessInterface : public Interface
00034 {
00035  /// @cond INTERNALS
00036  INTERFACE_MGMT_FRIENDS(NaoJointStiffnessInterface)
00037  /// @endcond
00038  public:
00039   /* constants */
00040 
00041  private:
00042 #pragma pack(push,4)
00043   /** Internal data storage, do NOT modify! */
00044   typedef struct {
00045     int64_t timestamp_sec;  /**< Interface Unix timestamp, seconds */
00046     int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
00047     float head_yaw; /**< Head yaw */
00048     float head_pitch; /**< Head pitch */
00049     float l_shoulder_pitch; /**< Left shoulder pitch */
00050     float l_shoulder_roll; /**< Left shoulder roll */
00051     float l_elbow_yaw; /**< Left elbow yaw */
00052     float l_elbow_roll; /**< Left elbow roll */
00053     float l_wrist_yaw; /**< Left wrist yaw */
00054     float l_hand; /**< Left hand */
00055     float l_hip_yaw_pitch; /**< Left hip yaw pitch */
00056     float l_hip_roll; /**< Left hip roll */
00057     float l_hip_pitch; /**< Left hip pitch */
00058     float l_knee_pitch; /**< Left knee pitch */
00059     float l_ankle_pitch; /**< Left ankle pitch */
00060     float l_ankle_roll; /**< Left ankle roll */
00061     float r_shoulder_pitch; /**< Right shoulder pitch */
00062     float r_shoulder_roll; /**< Right shoulder roll */
00063     float r_elbow_yaw; /**< Right elbow yaw */
00064     float r_elbow_roll; /**< Right elbow roll */
00065     float r_wrist_yaw; /**< Right wrist yaw */
00066     float r_hand; /**< Right hand */
00067     float r_hip_yaw_pitch; /**< Right hip yaw pitch */
00068     float r_hip_roll; /**< Right hip roll */
00069     float r_hip_pitch; /**< Right hip pitch */
00070     float r_knee_pitch; /**< Right knee pitch */
00071     float r_ankle_pitch; /**< Right ankle pitch */
00072     float r_ankle_roll; /**< Right ankle roll */
00073     float minimum; /**< 
00074       Minimum stiffness of all joints. On the RoboCup version of the Nao this
00075       ignores the hand and wrist values.
00076      */
00077   } NaoJointStiffnessInterface_data_t;
00078 #pragma pack(pop)
00079 
00080   NaoJointStiffnessInterface_data_t *data;
00081 
00082  public:
00083   /* messages */
00084   class SetStiffnessMessage : public Message
00085   {
00086    private:
00087 #pragma pack(push,4)
00088     /** Internal data storage, do NOT modify! */
00089     typedef struct {
00090       int64_t timestamp_sec;  /**< Interface Unix timestamp, seconds */
00091       int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
00092       uint32_t servo; /**< 
00093       A concatenated list of SERVO_* constants from the
00094       NaoJointPositionInterface to define the servos that should
00095       execute the movement. The list shall consist of binary or'ed
00096       SERVO_* constants.
00097      */
00098       float value; /**< Servo value to set for servos. */
00099       float time_sec; /**< Time when to reach the stiffness. */
00100     } SetStiffnessMessage_data_t;
00101 #pragma pack(pop)
00102 
00103     SetStiffnessMessage_data_t *data;
00104 
00105    public:
00106     SetStiffnessMessage(const uint32_t ini_servo, const float ini_value, const float ini_time_sec);
00107     SetStiffnessMessage();
00108     ~SetStiffnessMessage();
00109 
00110     SetStiffnessMessage(const SetStiffnessMessage *m);
00111     /* Methods */
00112     uint32_t servo() const;
00113     void set_servo(const uint32_t new_servo);
00114     size_t maxlenof_servo() const;
00115     float value() const;
00116     void set_value(const float new_value);
00117     size_t maxlenof_value() const;
00118     float time_sec() const;
00119     void set_time_sec(const float new_time_sec);
00120     size_t maxlenof_time_sec() const;
00121     virtual Message * clone() const;
00122   };
00123 
00124   class SetBodyStiffnessMessage : public Message
00125   {
00126    private:
00127 #pragma pack(push,4)
00128     /** Internal data storage, do NOT modify! */
00129     typedef struct {
00130       int64_t timestamp_sec;  /**< Interface Unix timestamp, seconds */
00131       int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
00132       float value; /**< Servo value to set for servos. */
00133       float time_sec; /**< Time when to reach the stiffness. */
00134     } SetBodyStiffnessMessage_data_t;
00135 #pragma pack(pop)
00136 
00137     SetBodyStiffnessMessage_data_t *data;
00138 
00139    public:
00140     SetBodyStiffnessMessage(const float ini_value, const float ini_time_sec);
00141     SetBodyStiffnessMessage();
00142     ~SetBodyStiffnessMessage();
00143 
00144     SetBodyStiffnessMessage(const SetBodyStiffnessMessage *m);
00145     /* Methods */
00146     float value() const;
00147     void set_value(const float new_value);
00148     size_t maxlenof_value() const;
00149     float time_sec() const;
00150     void set_time_sec(const float new_time_sec);
00151     size_t maxlenof_time_sec() const;
00152     virtual Message * clone() const;
00153   };
00154 
00155   class SetStiffnessesMessage : public Message
00156   {
00157    private:
00158 #pragma pack(push,4)
00159     /** Internal data storage, do NOT modify! */
00160     typedef struct {
00161       int64_t timestamp_sec;  /**< Interface Unix timestamp, seconds */
00162       int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
00163       float time_sec; /**< Time when to reach the stiffness. */
00164       float head_yaw; /**< Head yaw */
00165       float head_pitch; /**< Head pitch */
00166       float l_shoulder_pitch; /**< Left shoulder pitch */
00167       float l_shoulder_roll; /**< Left shoulder roll */
00168       float l_elbow_yaw; /**< Left elbow yaw */
00169       float l_elbow_roll; /**< Left elbow roll */
00170       float l_wrist_yaw; /**< Left wrist yaw */
00171       float l_hand; /**< Left hand */
00172       float l_hip_yaw_pitch; /**< Left hip yaw pitch */
00173       float l_hip_roll; /**< Left hip roll */
00174       float l_hip_pitch; /**< Left hip pitch */
00175       float l_knee_pitch; /**< Left knee pitch */
00176       float l_ankle_pitch; /**< Left ankle pitch */
00177       float l_ankle_roll; /**< Left ankle roll */
00178       float r_shoulder_pitch; /**< Right shoulder pitch */
00179       float r_shoulder_roll; /**< Right shoulder roll */
00180       float r_elbow_yaw; /**< Right elbow yaw */
00181       float r_wrist_yaw; /**< Right wrist yaw */
00182       float r_hand; /**< Right hand */
00183       float r_hip_yaw_pitch; /**< Right hip yaw pitch */
00184       float r_hip_roll; /**< Right hip roll */
00185       float r_hip_pitch; /**< Right hip pitch */
00186       float r_knee_pitch; /**< Right knee pitch */
00187       float r_ankle_pitch; /**< Right ankle pitch */
00188       float r_ankle_roll; /**< Right ankle roll */
00189       float r_elbow_roll; /**< Right elbow roll */
00190     } SetStiffnessesMessage_data_t;
00191 #pragma pack(pop)
00192 
00193     SetStiffnessesMessage_data_t *data;
00194 
00195    public:
00196     SetStiffnessesMessage(const float ini_time_sec, const float ini_head_yaw, const float ini_head_pitch, const float ini_l_shoulder_pitch, const float ini_l_shoulder_roll, const float ini_l_elbow_yaw, const float ini_l_elbow_roll, const float ini_l_wrist_yaw, const float ini_l_hand, const float ini_l_hip_yaw_pitch, const float ini_l_hip_roll, const float ini_l_hip_pitch, const float ini_l_knee_pitch, const float ini_l_ankle_pitch, const float ini_l_ankle_roll, const float ini_r_shoulder_pitch, const float ini_r_shoulder_roll, const float ini_r_elbow_yaw, const float ini_r_wrist_yaw, const float ini_r_hand, const float ini_r_hip_yaw_pitch, const float ini_r_hip_roll, const float ini_r_hip_pitch, const float ini_r_knee_pitch, const float ini_r_ankle_pitch, const float ini_r_ankle_roll, const float ini_r_elbow_roll);
00197     SetStiffnessesMessage();
00198     ~SetStiffnessesMessage();
00199 
00200     SetStiffnessesMessage(const SetStiffnessesMessage *m);
00201     /* Methods */
00202     float time_sec() const;
00203     void set_time_sec(const float new_time_sec);
00204     size_t maxlenof_time_sec() const;
00205     float head_yaw() const;
00206     void set_head_yaw(const float new_head_yaw);
00207     size_t maxlenof_head_yaw() const;
00208     float head_pitch() const;
00209     void set_head_pitch(const float new_head_pitch);
00210     size_t maxlenof_head_pitch() const;
00211     float l_shoulder_pitch() const;
00212     void set_l_shoulder_pitch(const float new_l_shoulder_pitch);
00213     size_t maxlenof_l_shoulder_pitch() const;
00214     float l_shoulder_roll() const;
00215     void set_l_shoulder_roll(const float new_l_shoulder_roll);
00216     size_t maxlenof_l_shoulder_roll() const;
00217     float l_elbow_yaw() const;
00218     void set_l_elbow_yaw(const float new_l_elbow_yaw);
00219     size_t maxlenof_l_elbow_yaw() const;
00220     float l_elbow_roll() const;
00221     void set_l_elbow_roll(const float new_l_elbow_roll);
00222     size_t maxlenof_l_elbow_roll() const;
00223     float l_wrist_yaw() const;
00224     void set_l_wrist_yaw(const float new_l_wrist_yaw);
00225     size_t maxlenof_l_wrist_yaw() const;
00226     float l_hand() const;
00227     void set_l_hand(const float new_l_hand);
00228     size_t maxlenof_l_hand() const;
00229     float l_hip_yaw_pitch() const;
00230     void set_l_hip_yaw_pitch(const float new_l_hip_yaw_pitch);
00231     size_t maxlenof_l_hip_yaw_pitch() const;
00232     float l_hip_roll() const;
00233     void set_l_hip_roll(const float new_l_hip_roll);
00234     size_t maxlenof_l_hip_roll() const;
00235     float l_hip_pitch() const;
00236     void set_l_hip_pitch(const float new_l_hip_pitch);
00237     size_t maxlenof_l_hip_pitch() const;
00238     float l_knee_pitch() const;
00239     void set_l_knee_pitch(const float new_l_knee_pitch);
00240     size_t maxlenof_l_knee_pitch() const;
00241     float l_ankle_pitch() const;
00242     void set_l_ankle_pitch(const float new_l_ankle_pitch);
00243     size_t maxlenof_l_ankle_pitch() const;
00244     float l_ankle_roll() const;
00245     void set_l_ankle_roll(const float new_l_ankle_roll);
00246     size_t maxlenof_l_ankle_roll() const;
00247     float r_shoulder_pitch() const;
00248     void set_r_shoulder_pitch(const float new_r_shoulder_pitch);
00249     size_t maxlenof_r_shoulder_pitch() const;
00250     float r_shoulder_roll() const;
00251     void set_r_shoulder_roll(const float new_r_shoulder_roll);
00252     size_t maxlenof_r_shoulder_roll() const;
00253     float r_elbow_yaw() const;
00254     void set_r_elbow_yaw(const float new_r_elbow_yaw);
00255     size_t maxlenof_r_elbow_yaw() const;
00256     float r_wrist_yaw() const;
00257     void set_r_wrist_yaw(const float new_r_wrist_yaw);
00258     size_t maxlenof_r_wrist_yaw() const;
00259     float r_hand() const;
00260     void set_r_hand(const float new_r_hand);
00261     size_t maxlenof_r_hand() const;
00262     float r_hip_yaw_pitch() const;
00263     void set_r_hip_yaw_pitch(const float new_r_hip_yaw_pitch);
00264     size_t maxlenof_r_hip_yaw_pitch() const;
00265     float r_hip_roll() const;
00266     void set_r_hip_roll(const float new_r_hip_roll);
00267     size_t maxlenof_r_hip_roll() const;
00268     float r_hip_pitch() const;
00269     void set_r_hip_pitch(const float new_r_hip_pitch);
00270     size_t maxlenof_r_hip_pitch() const;
00271     float r_knee_pitch() const;
00272     void set_r_knee_pitch(const float new_r_knee_pitch);
00273     size_t maxlenof_r_knee_pitch() const;
00274     float r_ankle_pitch() const;
00275     void set_r_ankle_pitch(const float new_r_ankle_pitch);
00276     size_t maxlenof_r_ankle_pitch() const;
00277     float r_ankle_roll() const;
00278     void set_r_ankle_roll(const float new_r_ankle_roll);
00279     size_t maxlenof_r_ankle_roll() const;
00280     float r_elbow_roll() const;
00281     void set_r_elbow_roll(const float new_r_elbow_roll);
00282     size_t maxlenof_r_elbow_roll() const;
00283     virtual Message * clone() const;
00284   };
00285 
00286   virtual bool message_valid(const Message *message) const;
00287  private:
00288   NaoJointStiffnessInterface();
00289   ~NaoJointStiffnessInterface();
00290 
00291  public:
00292   /* Methods */
00293   float head_yaw() const;
00294   void set_head_yaw(const float new_head_yaw);
00295   size_t maxlenof_head_yaw() const;
00296   float head_pitch() const;
00297   void set_head_pitch(const float new_head_pitch);
00298   size_t maxlenof_head_pitch() const;
00299   float l_shoulder_pitch() const;
00300   void set_l_shoulder_pitch(const float new_l_shoulder_pitch);
00301   size_t maxlenof_l_shoulder_pitch() const;
00302   float l_shoulder_roll() const;
00303   void set_l_shoulder_roll(const float new_l_shoulder_roll);
00304   size_t maxlenof_l_shoulder_roll() const;
00305   float l_elbow_yaw() const;
00306   void set_l_elbow_yaw(const float new_l_elbow_yaw);
00307   size_t maxlenof_l_elbow_yaw() const;
00308   float l_elbow_roll() const;
00309   void set_l_elbow_roll(const float new_l_elbow_roll);
00310   size_t maxlenof_l_elbow_roll() const;
00311   float l_wrist_yaw() const;
00312   void set_l_wrist_yaw(const float new_l_wrist_yaw);
00313   size_t maxlenof_l_wrist_yaw() const;
00314   float l_hand() const;
00315   void set_l_hand(const float new_l_hand);
00316   size_t maxlenof_l_hand() const;
00317   float l_hip_yaw_pitch() const;
00318   void set_l_hip_yaw_pitch(const float new_l_hip_yaw_pitch);
00319   size_t maxlenof_l_hip_yaw_pitch() const;
00320   float l_hip_roll() const;
00321   void set_l_hip_roll(const float new_l_hip_roll);
00322   size_t maxlenof_l_hip_roll() const;
00323   float l_hip_pitch() const;
00324   void set_l_hip_pitch(const float new_l_hip_pitch);
00325   size_t maxlenof_l_hip_pitch() const;
00326   float l_knee_pitch() const;
00327   void set_l_knee_pitch(const float new_l_knee_pitch);
00328   size_t maxlenof_l_knee_pitch() const;
00329   float l_ankle_pitch() const;
00330   void set_l_ankle_pitch(const float new_l_ankle_pitch);
00331   size_t maxlenof_l_ankle_pitch() const;
00332   float l_ankle_roll() const;
00333   void set_l_ankle_roll(const float new_l_ankle_roll);
00334   size_t maxlenof_l_ankle_roll() const;
00335   float r_shoulder_pitch() const;
00336   void set_r_shoulder_pitch(const float new_r_shoulder_pitch);
00337   size_t maxlenof_r_shoulder_pitch() const;
00338   float r_shoulder_roll() const;
00339   void set_r_shoulder_roll(const float new_r_shoulder_roll);
00340   size_t maxlenof_r_shoulder_roll() const;
00341   float r_elbow_yaw() const;
00342   void set_r_elbow_yaw(const float new_r_elbow_yaw);
00343   size_t maxlenof_r_elbow_yaw() const;
00344   float r_elbow_roll() const;
00345   void set_r_elbow_roll(const float new_r_elbow_roll);
00346   size_t maxlenof_r_elbow_roll() const;
00347   float r_wrist_yaw() const;
00348   void set_r_wrist_yaw(const float new_r_wrist_yaw);
00349   size_t maxlenof_r_wrist_yaw() const;
00350   float r_hand() const;
00351   void set_r_hand(const float new_r_hand);
00352   size_t maxlenof_r_hand() const;
00353   float r_hip_yaw_pitch() const;
00354   void set_r_hip_yaw_pitch(const float new_r_hip_yaw_pitch);
00355   size_t maxlenof_r_hip_yaw_pitch() const;
00356   float r_hip_roll() const;
00357   void set_r_hip_roll(const float new_r_hip_roll);
00358   size_t maxlenof_r_hip_roll() const;
00359   float r_hip_pitch() const;
00360   void set_r_hip_pitch(const float new_r_hip_pitch);
00361   size_t maxlenof_r_hip_pitch() const;
00362   float r_knee_pitch() const;
00363   void set_r_knee_pitch(const float new_r_knee_pitch);
00364   size_t maxlenof_r_knee_pitch() const;
00365   float r_ankle_pitch() const;
00366   void set_r_ankle_pitch(const float new_r_ankle_pitch);
00367   size_t maxlenof_r_ankle_pitch() const;
00368   float r_ankle_roll() const;
00369   void set_r_ankle_roll(const float new_r_ankle_roll);
00370   size_t maxlenof_r_ankle_roll() const;
00371   float minimum() const;
00372   void set_minimum(const float new_minimum);
00373   size_t maxlenof_minimum() const;
00374   virtual Message * create_message(const char *type) const;
00375 
00376   virtual void copy_values(const Interface *other);
00377   virtual const char * enum_tostring(const char *enumtype, int val) const;
00378 
00379 };
00380 
00381 } // end namespace fawkes
00382 
00383 #endif