Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
NaoJointStiffnessInterface.h
1 
2 /***************************************************************************
3  * NaoJointStiffnessInterface.h - Fawkes BlackBoard Interface - NaoJointStiffnessInterface
4  *
5  * Templated created: Thu Oct 12 10:49:19 2006
6  * Copyright 2008-2011 Tim Niemueller
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __INTERFACES_NAOJOINTSTIFFNESSINTERFACE_H_
25 #define __INTERFACES_NAOJOINTSTIFFNESSINTERFACE_H_
26 
27 #include <interface/interface.h>
28 #include <interface/message.h>
29 #include <interface/field_iterator.h>
30 
31 namespace fawkes {
32 
34 {
35  /// @cond INTERNALS
36  INTERFACE_MGMT_FRIENDS(NaoJointStiffnessInterface)
37  /// @endcond
38  public:
39  /* constants */
40 
41  private:
42 #pragma pack(push,4)
43  /** Internal data storage, do NOT modify! */
44  typedef struct {
45  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
46  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
47  float head_yaw; /**< Head yaw */
48  float head_pitch; /**< Head pitch */
49  float l_shoulder_pitch; /**< Left shoulder pitch */
50  float l_shoulder_roll; /**< Left shoulder roll */
51  float l_elbow_yaw; /**< Left elbow yaw */
52  float l_elbow_roll; /**< Left elbow roll */
53  float l_wrist_yaw; /**< Left wrist yaw */
54  float l_hand; /**< Left hand */
55  float l_hip_yaw_pitch; /**< Left hip yaw pitch */
56  float l_hip_roll; /**< Left hip roll */
57  float l_hip_pitch; /**< Left hip pitch */
58  float l_knee_pitch; /**< Left knee pitch */
59  float l_ankle_pitch; /**< Left ankle pitch */
60  float l_ankle_roll; /**< Left ankle roll */
61  float r_shoulder_pitch; /**< Right shoulder pitch */
62  float r_shoulder_roll; /**< Right shoulder roll */
63  float r_elbow_yaw; /**< Right elbow yaw */
64  float r_elbow_roll; /**< Right elbow roll */
65  float r_wrist_yaw; /**< Right wrist yaw */
66  float r_hand; /**< Right hand */
67  float r_hip_yaw_pitch; /**< Right hip yaw pitch */
68  float r_hip_roll; /**< Right hip roll */
69  float r_hip_pitch; /**< Right hip pitch */
70  float r_knee_pitch; /**< Right knee pitch */
71  float r_ankle_pitch; /**< Right ankle pitch */
72  float r_ankle_roll; /**< Right ankle roll */
73  float minimum; /**<
74  Minimum stiffness of all joints. On the RoboCup version of the Nao this
75  ignores the hand and wrist values.
76  */
77  } NaoJointStiffnessInterface_data_t;
78 #pragma pack(pop)
79 
80  NaoJointStiffnessInterface_data_t *data;
81 
82  public:
83  /* messages */
85  {
86  private:
87 #pragma pack(push,4)
88  /** Internal data storage, do NOT modify! */
89  typedef struct {
90  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
91  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
92  uint32_t servo; /**<
93  A concatenated list of SERVO_* constants from the
94  NaoJointPositionInterface to define the servos that should
95  execute the movement. The list shall consist of binary or'ed
96  SERVO_* constants.
97  */
98  float value; /**< Servo value to set for servos. */
99  float time_sec; /**< Time when to reach the stiffness. */
100  } SetStiffnessMessage_data_t;
101 #pragma pack(pop)
102 
103  SetStiffnessMessage_data_t *data;
104 
105  public:
106  SetStiffnessMessage(const uint32_t ini_servo, const float ini_value, const float ini_time_sec);
109 
111  /* Methods */
112  uint32_t servo() const;
113  void set_servo(const uint32_t new_servo);
114  size_t maxlenof_servo() const;
115  float value() const;
116  void set_value(const float new_value);
117  size_t maxlenof_value() const;
118  float time_sec() const;
119  void set_time_sec(const float new_time_sec);
120  size_t maxlenof_time_sec() const;
121  virtual Message * clone() const;
122  };
123 
125  {
126  private:
127 #pragma pack(push,4)
128  /** Internal data storage, do NOT modify! */
129  typedef struct {
130  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
131  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
132  float value; /**< Servo value to set for servos. */
133  float time_sec; /**< Time when to reach the stiffness. */
134  } SetBodyStiffnessMessage_data_t;
135 #pragma pack(pop)
136 
137  SetBodyStiffnessMessage_data_t *data;
138 
139  public:
140  SetBodyStiffnessMessage(const float ini_value, const float ini_time_sec);
143 
145  /* Methods */
146  float value() const;
147  void set_value(const float new_value);
148  size_t maxlenof_value() const;
149  float time_sec() const;
150  void set_time_sec(const float new_time_sec);
151  size_t maxlenof_time_sec() const;
152  virtual Message * clone() const;
153  };
154 
156  {
157  private:
158 #pragma pack(push,4)
159  /** Internal data storage, do NOT modify! */
160  typedef struct {
161  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
162  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
163  float time_sec; /**< Time when to reach the stiffness. */
164  float head_yaw; /**< Head yaw */
165  float head_pitch; /**< Head pitch */
166  float l_shoulder_pitch; /**< Left shoulder pitch */
167  float l_shoulder_roll; /**< Left shoulder roll */
168  float l_elbow_yaw; /**< Left elbow yaw */
169  float l_elbow_roll; /**< Left elbow roll */
170  float l_wrist_yaw; /**< Left wrist yaw */
171  float l_hand; /**< Left hand */
172  float l_hip_yaw_pitch; /**< Left hip yaw pitch */
173  float l_hip_roll; /**< Left hip roll */
174  float l_hip_pitch; /**< Left hip pitch */
175  float l_knee_pitch; /**< Left knee pitch */
176  float l_ankle_pitch; /**< Left ankle pitch */
177  float l_ankle_roll; /**< Left ankle roll */
178  float r_shoulder_pitch; /**< Right shoulder pitch */
179  float r_shoulder_roll; /**< Right shoulder roll */
180  float r_elbow_yaw; /**< Right elbow yaw */
181  float r_wrist_yaw; /**< Right wrist yaw */
182  float r_hand; /**< Right hand */
183  float r_hip_yaw_pitch; /**< Right hip yaw pitch */
184  float r_hip_roll; /**< Right hip roll */
185  float r_hip_pitch; /**< Right hip pitch */
186  float r_knee_pitch; /**< Right knee pitch */
187  float r_ankle_pitch; /**< Right ankle pitch */
188  float r_ankle_roll; /**< Right ankle roll */
189  float r_elbow_roll; /**< Right elbow roll */
190  } SetStiffnessesMessage_data_t;
191 #pragma pack(pop)
192 
193  SetStiffnessesMessage_data_t *data;
194 
195  public:
196  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);
199 
201  /* Methods */
202  float time_sec() const;
203  void set_time_sec(const float new_time_sec);
204  size_t maxlenof_time_sec() const;
205  float head_yaw() const;
206  void set_head_yaw(const float new_head_yaw);
207  size_t maxlenof_head_yaw() const;
208  float head_pitch() const;
209  void set_head_pitch(const float new_head_pitch);
210  size_t maxlenof_head_pitch() const;
211  float l_shoulder_pitch() const;
212  void set_l_shoulder_pitch(const float new_l_shoulder_pitch);
213  size_t maxlenof_l_shoulder_pitch() const;
214  float l_shoulder_roll() const;
215  void set_l_shoulder_roll(const float new_l_shoulder_roll);
216  size_t maxlenof_l_shoulder_roll() const;
217  float l_elbow_yaw() const;
218  void set_l_elbow_yaw(const float new_l_elbow_yaw);
219  size_t maxlenof_l_elbow_yaw() const;
220  float l_elbow_roll() const;
221  void set_l_elbow_roll(const float new_l_elbow_roll);
222  size_t maxlenof_l_elbow_roll() const;
223  float l_wrist_yaw() const;
224  void set_l_wrist_yaw(const float new_l_wrist_yaw);
225  size_t maxlenof_l_wrist_yaw() const;
226  float l_hand() const;
227  void set_l_hand(const float new_l_hand);
228  size_t maxlenof_l_hand() const;
229  float l_hip_yaw_pitch() const;
230  void set_l_hip_yaw_pitch(const float new_l_hip_yaw_pitch);
231  size_t maxlenof_l_hip_yaw_pitch() const;
232  float l_hip_roll() const;
233  void set_l_hip_roll(const float new_l_hip_roll);
234  size_t maxlenof_l_hip_roll() const;
235  float l_hip_pitch() const;
236  void set_l_hip_pitch(const float new_l_hip_pitch);
237  size_t maxlenof_l_hip_pitch() const;
238  float l_knee_pitch() const;
239  void set_l_knee_pitch(const float new_l_knee_pitch);
240  size_t maxlenof_l_knee_pitch() const;
241  float l_ankle_pitch() const;
242  void set_l_ankle_pitch(const float new_l_ankle_pitch);
243  size_t maxlenof_l_ankle_pitch() const;
244  float l_ankle_roll() const;
245  void set_l_ankle_roll(const float new_l_ankle_roll);
246  size_t maxlenof_l_ankle_roll() const;
247  float r_shoulder_pitch() const;
248  void set_r_shoulder_pitch(const float new_r_shoulder_pitch);
249  size_t maxlenof_r_shoulder_pitch() const;
250  float r_shoulder_roll() const;
251  void set_r_shoulder_roll(const float new_r_shoulder_roll);
252  size_t maxlenof_r_shoulder_roll() const;
253  float r_elbow_yaw() const;
254  void set_r_elbow_yaw(const float new_r_elbow_yaw);
255  size_t maxlenof_r_elbow_yaw() const;
256  float r_wrist_yaw() const;
257  void set_r_wrist_yaw(const float new_r_wrist_yaw);
258  size_t maxlenof_r_wrist_yaw() const;
259  float r_hand() const;
260  void set_r_hand(const float new_r_hand);
261  size_t maxlenof_r_hand() const;
262  float r_hip_yaw_pitch() const;
263  void set_r_hip_yaw_pitch(const float new_r_hip_yaw_pitch);
264  size_t maxlenof_r_hip_yaw_pitch() const;
265  float r_hip_roll() const;
266  void set_r_hip_roll(const float new_r_hip_roll);
267  size_t maxlenof_r_hip_roll() const;
268  float r_hip_pitch() const;
269  void set_r_hip_pitch(const float new_r_hip_pitch);
270  size_t maxlenof_r_hip_pitch() const;
271  float r_knee_pitch() const;
272  void set_r_knee_pitch(const float new_r_knee_pitch);
273  size_t maxlenof_r_knee_pitch() const;
274  float r_ankle_pitch() const;
275  void set_r_ankle_pitch(const float new_r_ankle_pitch);
276  size_t maxlenof_r_ankle_pitch() const;
277  float r_ankle_roll() const;
278  void set_r_ankle_roll(const float new_r_ankle_roll);
279  size_t maxlenof_r_ankle_roll() const;
280  float r_elbow_roll() const;
281  void set_r_elbow_roll(const float new_r_elbow_roll);
282  size_t maxlenof_r_elbow_roll() const;
283  virtual Message * clone() const;
284  };
285 
286  virtual bool message_valid(const Message *message) const;
287  private:
290 
291  public:
292  /* Methods */
293  float head_yaw() const;
294  void set_head_yaw(const float new_head_yaw);
295  size_t maxlenof_head_yaw() const;
296  float head_pitch() const;
297  void set_head_pitch(const float new_head_pitch);
298  size_t maxlenof_head_pitch() const;
299  float l_shoulder_pitch() const;
300  void set_l_shoulder_pitch(const float new_l_shoulder_pitch);
301  size_t maxlenof_l_shoulder_pitch() const;
302  float l_shoulder_roll() const;
303  void set_l_shoulder_roll(const float new_l_shoulder_roll);
304  size_t maxlenof_l_shoulder_roll() const;
305  float l_elbow_yaw() const;
306  void set_l_elbow_yaw(const float new_l_elbow_yaw);
307  size_t maxlenof_l_elbow_yaw() const;
308  float l_elbow_roll() const;
309  void set_l_elbow_roll(const float new_l_elbow_roll);
310  size_t maxlenof_l_elbow_roll() const;
311  float l_wrist_yaw() const;
312  void set_l_wrist_yaw(const float new_l_wrist_yaw);
313  size_t maxlenof_l_wrist_yaw() const;
314  float l_hand() const;
315  void set_l_hand(const float new_l_hand);
316  size_t maxlenof_l_hand() const;
317  float l_hip_yaw_pitch() const;
318  void set_l_hip_yaw_pitch(const float new_l_hip_yaw_pitch);
319  size_t maxlenof_l_hip_yaw_pitch() const;
320  float l_hip_roll() const;
321  void set_l_hip_roll(const float new_l_hip_roll);
322  size_t maxlenof_l_hip_roll() const;
323  float l_hip_pitch() const;
324  void set_l_hip_pitch(const float new_l_hip_pitch);
325  size_t maxlenof_l_hip_pitch() const;
326  float l_knee_pitch() const;
327  void set_l_knee_pitch(const float new_l_knee_pitch);
328  size_t maxlenof_l_knee_pitch() const;
329  float l_ankle_pitch() const;
330  void set_l_ankle_pitch(const float new_l_ankle_pitch);
331  size_t maxlenof_l_ankle_pitch() const;
332  float l_ankle_roll() const;
333  void set_l_ankle_roll(const float new_l_ankle_roll);
334  size_t maxlenof_l_ankle_roll() const;
335  float r_shoulder_pitch() const;
336  void set_r_shoulder_pitch(const float new_r_shoulder_pitch);
337  size_t maxlenof_r_shoulder_pitch() const;
338  float r_shoulder_roll() const;
339  void set_r_shoulder_roll(const float new_r_shoulder_roll);
340  size_t maxlenof_r_shoulder_roll() const;
341  float r_elbow_yaw() const;
342  void set_r_elbow_yaw(const float new_r_elbow_yaw);
343  size_t maxlenof_r_elbow_yaw() const;
344  float r_elbow_roll() const;
345  void set_r_elbow_roll(const float new_r_elbow_roll);
346  size_t maxlenof_r_elbow_roll() const;
347  float r_wrist_yaw() const;
348  void set_r_wrist_yaw(const float new_r_wrist_yaw);
349  size_t maxlenof_r_wrist_yaw() const;
350  float r_hand() const;
351  void set_r_hand(const float new_r_hand);
352  size_t maxlenof_r_hand() const;
353  float r_hip_yaw_pitch() const;
354  void set_r_hip_yaw_pitch(const float new_r_hip_yaw_pitch);
355  size_t maxlenof_r_hip_yaw_pitch() const;
356  float r_hip_roll() const;
357  void set_r_hip_roll(const float new_r_hip_roll);
358  size_t maxlenof_r_hip_roll() const;
359  float r_hip_pitch() const;
360  void set_r_hip_pitch(const float new_r_hip_pitch);
361  size_t maxlenof_r_hip_pitch() const;
362  float r_knee_pitch() const;
363  void set_r_knee_pitch(const float new_r_knee_pitch);
364  size_t maxlenof_r_knee_pitch() const;
365  float r_ankle_pitch() const;
366  void set_r_ankle_pitch(const float new_r_ankle_pitch);
367  size_t maxlenof_r_ankle_pitch() const;
368  float r_ankle_roll() const;
369  void set_r_ankle_roll(const float new_r_ankle_roll);
370  size_t maxlenof_r_ankle_roll() const;
371  float minimum() const;
372  void set_minimum(const float new_minimum);
373  size_t maxlenof_minimum() const;
374  virtual Message * create_message(const char *type) const;
375 
376  virtual void copy_values(const Interface *other);
377  virtual const char * enum_tostring(const char *enumtype, int val) const;
378 
379 };
380 
381 } // end namespace fawkes
382 
383 #endif