Fawkes API  Fawkes Development Version
JacoBimanualInterface.h
1 
2 /***************************************************************************
3  * JacoBimanualInterface.h - Fawkes BlackBoard Interface - JacoBimanualInterface
4  *
5  * Templated created: Thu Oct 12 10:49:19 2006
6  * Copyright 2014 Bahram Maleki-Fard
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_JACOBIMANUALINTERFACE_H_
25 #define __INTERFACES_JACOBIMANUALINTERFACE_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(JacoBimanualInterface)
37  /// @endcond
38  public:
39  /* constants */
40  static const uint32_t ERROR_NONE;
41  static const uint32_t ERROR_UNSPECIFIC;
42  static const uint32_t ERROR_NO_IK;
43  static const uint32_t ERROR_PLANNING;
44 
45  private:
46  /** Internal data storage, do NOT modify! */
47  typedef struct __attribute__((packed)) {
48  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
49  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
50  uint32_t msgid; /**< The ID of the message that is currently being
51  processed, or 0 if no message is being processed. */
52  bool final; /**< True, if the last command has been finished,
53  false if it is still running */
54  uint32_t error_code; /**< Error code, set if
55  final is true. 0 if no error occured, an error code from ERROR_*
56  constants otherwise. */
57  bool constrained; /**< Wheter planning is using constraint-function.
58  This is an OpenRAVE internal constraint function. */
59  } JacoBimanualInterface_data_t;
60 
61  JacoBimanualInterface_data_t *data;
62 
63  public:
64  /* messages */
66  {
67  private:
68  /** Internal data storage, do NOT modify! */
69  typedef struct __attribute__((packed)) {
70  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
71  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
72  float l_x; /**< X-coordinate of left manipulator */
73  float l_y; /**< Y-coordinate of left manipulator */
74  float l_z; /**< Z-coordinate of left manipulator */
75  float l_e1; /**< 1st Euler angle of left manipulator rotation */
76  float l_e2; /**< 2nd Euler angle of left manipulator rotation */
77  float l_e3; /**< 3rd Euler angle of left manipulator rotation */
78  float r_x; /**< X-coordinate of right manipulator */
79  float r_y; /**< Y-coordinate of right manipulator */
80  float r_z; /**< Z-coordinate of right manipulator */
81  float r_e1; /**< 1st Euler angle of right manipulator rotation */
82  float r_e2; /**< 2nd Euler angle of right manipulator rotation */
83  float r_e3; /**< 3rd Euler angle of right manipulator rotation */
84  } CartesianGotoMessage_data_t;
85 
86  CartesianGotoMessage_data_t *data;
87 
88  public:
89  CartesianGotoMessage(const float ini_l_x, const float ini_l_y, const float ini_l_z, const float ini_l_e1, const float ini_l_e2, const float ini_l_e3, const float ini_r_x, const float ini_r_y, const float ini_r_z, const float ini_r_e1, const float ini_r_e2, const float ini_r_e3);
92 
94  /* Methods */
95  float l_x() const;
96  void set_l_x(const float new_l_x);
97  size_t maxlenof_l_x() const;
98  float l_y() const;
99  void set_l_y(const float new_l_y);
100  size_t maxlenof_l_y() const;
101  float l_z() const;
102  void set_l_z(const float new_l_z);
103  size_t maxlenof_l_z() const;
104  float l_e1() const;
105  void set_l_e1(const float new_l_e1);
106  size_t maxlenof_l_e1() const;
107  float l_e2() const;
108  void set_l_e2(const float new_l_e2);
109  size_t maxlenof_l_e2() const;
110  float l_e3() const;
111  void set_l_e3(const float new_l_e3);
112  size_t maxlenof_l_e3() const;
113  float r_x() const;
114  void set_r_x(const float new_r_x);
115  size_t maxlenof_r_x() const;
116  float r_y() const;
117  void set_r_y(const float new_r_y);
118  size_t maxlenof_r_y() const;
119  float r_z() const;
120  void set_r_z(const float new_r_z);
121  size_t maxlenof_r_z() const;
122  float r_e1() const;
123  void set_r_e1(const float new_r_e1);
124  size_t maxlenof_r_e1() const;
125  float r_e2() const;
126  void set_r_e2(const float new_r_e2);
127  size_t maxlenof_r_e2() const;
128  float r_e3() const;
129  void set_r_e3(const float new_r_e3);
130  size_t maxlenof_r_e3() const;
131  virtual Message * clone() const;
132  };
133 
135  {
136  private:
137  /** Internal data storage, do NOT modify! */
138  typedef struct __attribute__((packed)) {
139  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
140  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
141  float l_finger1; /**< Value of finger 1 on left gripper. Range [0,60] */
142  float l_finger2; /**< Value of finger 2 on left gripper. Range [0,60] */
143  float l_finger3; /**< Value of finger 3 on left gripper. Range [0,60] */
144  float r_finger1; /**< Value of finger 1 on right gripper. Range [0,60] */
145  float r_finger2; /**< Value of finger 2 on right gripper. Range [0,60] */
146  float r_finger3; /**< Value of finger 3 on right gripper. Range [0,60] */
147  } MoveGripperMessage_data_t;
148 
149  MoveGripperMessage_data_t *data;
150 
151  public:
152  MoveGripperMessage(const float ini_l_finger1, const float ini_l_finger2, const float ini_l_finger3, const float ini_r_finger1, const float ini_r_finger2, const float ini_r_finger3);
155 
157  /* Methods */
158  float l_finger1() const;
159  void set_l_finger1(const float new_l_finger1);
160  size_t maxlenof_l_finger1() const;
161  float l_finger2() const;
162  void set_l_finger2(const float new_l_finger2);
163  size_t maxlenof_l_finger2() const;
164  float l_finger3() const;
165  void set_l_finger3(const float new_l_finger3);
166  size_t maxlenof_l_finger3() const;
167  float r_finger1() const;
168  void set_r_finger1(const float new_r_finger1);
169  size_t maxlenof_r_finger1() const;
170  float r_finger2() const;
171  void set_r_finger2(const float new_r_finger2);
172  size_t maxlenof_r_finger2() const;
173  float r_finger3() const;
174  void set_r_finger3(const float new_r_finger3);
175  size_t maxlenof_r_finger3() const;
176  virtual Message * clone() const;
177  };
178 
180  {
181  private:
182  /** Internal data storage, do NOT modify! */
183  typedef struct __attribute__((packed)) {
184  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
185  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
186  char params[1024]; /**< Planner parameters */
187  } SetPlannerParamsMessage_data_t;
188 
189  SetPlannerParamsMessage_data_t *data;
190 
191  public:
192  SetPlannerParamsMessage(const char * ini_params);
195 
197  /* Methods */
198  char * params() const;
199  void set_params(const char * new_params);
200  size_t maxlenof_params() const;
201  virtual Message * clone() const;
202  };
203 
205  {
206  private:
207  /** Internal data storage, do NOT modify! */
208  typedef struct __attribute__((packed)) {
209  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
210  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
211  bool constrained; /**< Wheter planning is using constraint-function.
212  This is an OpenRAVE internal constraint function. */
213  } SetConstrainedMessage_data_t;
214 
215  SetConstrainedMessage_data_t *data;
216 
217  public:
218  SetConstrainedMessage(const bool ini_constrained);
221 
223  /* Methods */
224  bool is_constrained() const;
225  void set_constrained(const bool new_constrained);
226  size_t maxlenof_constrained() const;
227  virtual Message * clone() const;
228  };
229 
230  virtual bool message_valid(const Message *message) const;
231  private:
234 
235  public:
236  /* Methods */
237  uint32_t msgid() const;
238  void set_msgid(const uint32_t new_msgid);
239  size_t maxlenof_msgid() const;
240  bool is_final() const;
241  void set_final(const bool new_final);
242  size_t maxlenof_final() const;
243  uint32_t error_code() const;
244  void set_error_code(const uint32_t new_error_code);
245  size_t maxlenof_error_code() const;
246  bool is_constrained() const;
247  void set_constrained(const bool new_constrained);
248  size_t maxlenof_constrained() const;
249  virtual Message * create_message(const char *type) const;
250 
251  virtual void copy_values(const Interface *other);
252  virtual const char * enum_tostring(const char *enumtype, int val) const;
253 
254 };
255 
256 } // end namespace fawkes
257 
258 #endif
static const uint32_t ERROR_NONE
ERROR_NONE constant.
bool is_final() const
Get final value.
MoveGripperMessage Fawkes BlackBoard Interface Message.
void set_final(const bool new_final)
Set final value.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:44
Fawkes library namespace.
size_t maxlenof_error_code() const
Get maximum length of error_code value.
JacoBimanualInterface Fawkes BlackBoard Interface.
size_t maxlenof_constrained() const
Get maximum length of constrained value.
SetPlannerParamsMessage Fawkes BlackBoard Interface Message.
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:79
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
uint32_t error_code() const
Get error_code value.
size_t maxlenof_final() const
Get maximum length of final value.
bool is_constrained() const
Get constrained value.
void set_constrained(const bool new_constrained)
Set constrained value.
static const uint32_t ERROR_NO_IK
ERROR_NO_IK constant.
SetConstrainedMessage Fawkes BlackBoard Interface Message.
const char * type() const
Get type of interface.
Definition: interface.cpp:651
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
uint32_t msgid() const
Get msgid value.
virtual Message * create_message(const char *type) const
Create message based on type name.
static const uint32_t ERROR_UNSPECIFIC
ERROR_UNSPECIFIC constant.
size_t maxlenof_msgid() const
Get maximum length of msgid value.
void set_error_code(const uint32_t new_error_code)
Set error_code value.
virtual void copy_values(const Interface *other)
Copy values from other interface.
CartesianGotoMessage Fawkes BlackBoard Interface Message.
static const uint32_t ERROR_PLANNING
ERROR_PLANNING constant.
void set_msgid(const uint32_t new_msgid)
Set msgid value.