Fawkes API  Fawkes Development Version
JacoInterface.cpp
1 
2 /***************************************************************************
3  * JacoInterface.cpp - Fawkes BlackBoard Interface - JacoInterface
4  *
5  * Templated created: Thu Oct 12 10:49:19 2006
6  * Copyright 2013 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 #include <interfaces/JacoInterface.h>
25 
26 #include <core/exceptions/software.h>
27 
28 #include <map>
29 #include <string>
30 #include <cstring>
31 #include <cstdlib>
32 
33 namespace fawkes {
34 
35 /** @class JacoInterface <interfaces/JacoInterface.h>
36  * JacoInterface Fawkes BlackBoard Interface.
37  *
38  Interface providing access to a Kinova Jaco arm.
39 
40  * @ingroup FawkesInterfaces
41  */
42 
43 
44 /** ERROR_NONE constant */
45 const uint32_t JacoInterface::ERROR_NONE = 0u;
46 /** ERROR_UNSPECIFIC constant */
47 const uint32_t JacoInterface::ERROR_UNSPECIFIC = 1u;
48 /** ERROR_NO_IK constant */
49 const uint32_t JacoInterface::ERROR_NO_IK = 2u;
50 /** ERROR_PLANNING constant */
51 const uint32_t JacoInterface::ERROR_PLANNING = 4u;
52 
53 /** Constructor */
54 JacoInterface::JacoInterface() : Interface()
55 {
56  data_size = sizeof(JacoInterface_data_t);
57  data_ptr = malloc(data_size);
58  data = (JacoInterface_data_t *)data_ptr;
59  data_ts = (interface_data_ts_t *)data_ptr;
60  memset(data_ptr, 0, data_size);
61  add_fieldinfo(IFT_BOOL, "connected", 1, &data->connected);
62  add_fieldinfo(IFT_BOOL, "initialized", 1, &data->initialized);
63  add_fieldinfo(IFT_FLOAT, "x", 1, &data->x);
64  add_fieldinfo(IFT_FLOAT, "y", 1, &data->y);
65  add_fieldinfo(IFT_FLOAT, "z", 1, &data->z);
66  add_fieldinfo(IFT_FLOAT, "euler1", 1, &data->euler1);
67  add_fieldinfo(IFT_FLOAT, "euler2", 1, &data->euler2);
68  add_fieldinfo(IFT_FLOAT, "euler3", 1, &data->euler3);
69  add_fieldinfo(IFT_FLOAT, "joints", 6, &data->joints);
70  add_fieldinfo(IFT_FLOAT, "finger1", 1, &data->finger1);
71  add_fieldinfo(IFT_FLOAT, "finger2", 1, &data->finger2);
72  add_fieldinfo(IFT_FLOAT, "finger3", 1, &data->finger3);
73  add_fieldinfo(IFT_UINT32, "msgid", 1, &data->msgid);
74  add_fieldinfo(IFT_BOOL, "final", 1, &data->final);
75  add_fieldinfo(IFT_UINT32, "error_code", 1, &data->error_code);
76  add_messageinfo("CalibrateMessage");
77  add_messageinfo("RetractMessage");
78  add_messageinfo("StopMessage");
79  add_messageinfo("CartesianGotoMessage");
80  add_messageinfo("AngularGotoMessage");
81  add_messageinfo("MoveGripperMessage");
82  add_messageinfo("SetPlannerParamsMessage");
83  add_messageinfo("JoystickPushMessage");
84  add_messageinfo("JoystickReleaseMessage");
85  unsigned char tmp_hash[] = {0xff, 0x31, 0x58, 0x1c, 0x31, 0x7a, 0xc5, 0xb4, 0x2a, 0x56, 0x87, 0x5, 0x34, 0xfe, 0x6, 0x93};
86  set_hash(tmp_hash);
87 }
88 
89 /** Destructor */
90 JacoInterface::~JacoInterface()
91 {
92  free(data_ptr);
93 }
94 /* Methods */
95 /** Get connected value.
96  * Is JacoArm connected/ready?
97  * @return connected value
98  */
99 bool
101 {
102  return data->connected;
103 }
104 
105 /** Get maximum length of connected value.
106  * @return length of connected value, can be length of the array or number of
107  * maximum number of characters for a string
108  */
109 size_t
111 {
112  return 1;
113 }
114 
115 /** Set connected value.
116  * Is JacoArm connected/ready?
117  * @param new_connected new connected value
118  */
119 void
120 JacoInterface::set_connected(const bool new_connected)
121 {
122  data->connected = new_connected;
123  data_changed = true;
124 }
125 
126 /** Get initialized value.
127  * Checks if Jaco arm has been initialized once after switched on.
128  * @return initialized value
129  */
130 bool
132 {
133  return data->initialized;
134 }
135 
136 /** Get maximum length of initialized value.
137  * @return length of initialized value, can be length of the array or number of
138  * maximum number of characters for a string
139  */
140 size_t
142 {
143  return 1;
144 }
145 
146 /** Set initialized value.
147  * Checks if Jaco arm has been initialized once after switched on.
148  * @param new_initialized new initialized value
149  */
150 void
151 JacoInterface::set_initialized(const bool new_initialized)
152 {
153  data->initialized = new_initialized;
154  data_changed = true;
155 }
156 
157 /** Get x value.
158  * X-Coordinate of tool translation.
159  * @return x value
160  */
161 float
163 {
164  return data->x;
165 }
166 
167 /** Get maximum length of x value.
168  * @return length of x value, can be length of the array or number of
169  * maximum number of characters for a string
170  */
171 size_t
173 {
174  return 1;
175 }
176 
177 /** Set x value.
178  * X-Coordinate of tool translation.
179  * @param new_x new x value
180  */
181 void
182 JacoInterface::set_x(const float new_x)
183 {
184  data->x = new_x;
185  data_changed = true;
186 }
187 
188 /** Get y value.
189  * Y-Coordinate op tool translation.
190  * @return y value
191  */
192 float
194 {
195  return data->y;
196 }
197 
198 /** Get maximum length of y value.
199  * @return length of y value, can be length of the array or number of
200  * maximum number of characters for a string
201  */
202 size_t
204 {
205  return 1;
206 }
207 
208 /** Set y value.
209  * Y-Coordinate op tool translation.
210  * @param new_y new y value
211  */
212 void
213 JacoInterface::set_y(const float new_y)
214 {
215  data->y = new_y;
216  data_changed = true;
217 }
218 
219 /** Get z value.
220  * Z-Coordinate of tool translation.
221  * @return z value
222  */
223 float
225 {
226  return data->z;
227 }
228 
229 /** Get maximum length of z value.
230  * @return length of z value, can be length of the array or number of
231  * maximum number of characters for a string
232  */
233 size_t
235 {
236  return 1;
237 }
238 
239 /** Set z value.
240  * Z-Coordinate of tool translation.
241  * @param new_z new z value
242  */
243 void
244 JacoInterface::set_z(const float new_z)
245 {
246  data->z = new_z;
247  data_changed = true;
248 }
249 
250 /** Get euler1 value.
251  * 1st Euler angle of tool rotation.
252  * @return euler1 value
253  */
254 float
256 {
257  return data->euler1;
258 }
259 
260 /** Get maximum length of euler1 value.
261  * @return length of euler1 value, can be length of the array or number of
262  * maximum number of characters for a string
263  */
264 size_t
266 {
267  return 1;
268 }
269 
270 /** Set euler1 value.
271  * 1st Euler angle of tool rotation.
272  * @param new_euler1 new euler1 value
273  */
274 void
275 JacoInterface::set_euler1(const float new_euler1)
276 {
277  data->euler1 = new_euler1;
278  data_changed = true;
279 }
280 
281 /** Get euler2 value.
282  * 2nd Euler angle of tool rotation.
283  * @return euler2 value
284  */
285 float
287 {
288  return data->euler2;
289 }
290 
291 /** Get maximum length of euler2 value.
292  * @return length of euler2 value, can be length of the array or number of
293  * maximum number of characters for a string
294  */
295 size_t
297 {
298  return 1;
299 }
300 
301 /** Set euler2 value.
302  * 2nd Euler angle of tool rotation.
303  * @param new_euler2 new euler2 value
304  */
305 void
306 JacoInterface::set_euler2(const float new_euler2)
307 {
308  data->euler2 = new_euler2;
309  data_changed = true;
310 }
311 
312 /** Get euler3 value.
313  * 3rd Euler angle of tool rotation.
314  * @return euler3 value
315  */
316 float
318 {
319  return data->euler3;
320 }
321 
322 /** Get maximum length of euler3 value.
323  * @return length of euler3 value, can be length of the array or number of
324  * maximum number of characters for a string
325  */
326 size_t
328 {
329  return 1;
330 }
331 
332 /** Set euler3 value.
333  * 3rd Euler angle of tool rotation.
334  * @param new_euler3 new euler3 value
335  */
336 void
337 JacoInterface::set_euler3(const float new_euler3)
338 {
339  data->euler3 = new_euler3;
340  data_changed = true;
341 }
342 
343 /** Get joints value.
344  * Angle values of joints
345  * @return joints value
346  */
347 float *
349 {
350  return data->joints;
351 }
352 
353 /** Get joints value at given index.
354  * Angle values of joints
355  * @param index index of value
356  * @return joints value
357  * @exception Exception thrown if index is out of bounds
358  */
359 float
360 JacoInterface::joints(unsigned int index) const
361 {
362  if (index > 6) {
363  throw Exception("Index value %u out of bounds (0..6)", index);
364  }
365  return data->joints[index];
366 }
367 
368 /** Get maximum length of joints value.
369  * @return length of joints value, can be length of the array or number of
370  * maximum number of characters for a string
371  */
372 size_t
374 {
375  return 6;
376 }
377 
378 /** Set joints value.
379  * Angle values of joints
380  * @param new_joints new joints value
381  */
382 void
383 JacoInterface::set_joints(const float * new_joints)
384 {
385  memcpy(data->joints, new_joints, sizeof(float) * 6);
386  data_changed = true;
387 }
388 
389 /** Set joints value at given index.
390  * Angle values of joints
391  * @param new_joints new joints value
392  * @param index index for of the value
393  */
394 void
395 JacoInterface::set_joints(unsigned int index, const float new_joints)
396 {
397  if (index > 6) {
398  throw Exception("Index value %u out of bounds (0..6)", index);
399  }
400  data->joints[index] = new_joints;
401  data_changed = true;
402 }
403 /** Get finger1 value.
404  * Angular value of finger 1.
405  * @return finger1 value
406  */
407 float
409 {
410  return data->finger1;
411 }
412 
413 /** Get maximum length of finger1 value.
414  * @return length of finger1 value, can be length of the array or number of
415  * maximum number of characters for a string
416  */
417 size_t
419 {
420  return 1;
421 }
422 
423 /** Set finger1 value.
424  * Angular value of finger 1.
425  * @param new_finger1 new finger1 value
426  */
427 void
428 JacoInterface::set_finger1(const float new_finger1)
429 {
430  data->finger1 = new_finger1;
431  data_changed = true;
432 }
433 
434 /** Get finger2 value.
435  * Angular value of finger 2.
436  * @return finger2 value
437  */
438 float
440 {
441  return data->finger2;
442 }
443 
444 /** Get maximum length of finger2 value.
445  * @return length of finger2 value, can be length of the array or number of
446  * maximum number of characters for a string
447  */
448 size_t
450 {
451  return 1;
452 }
453 
454 /** Set finger2 value.
455  * Angular value of finger 2.
456  * @param new_finger2 new finger2 value
457  */
458 void
459 JacoInterface::set_finger2(const float new_finger2)
460 {
461  data->finger2 = new_finger2;
462  data_changed = true;
463 }
464 
465 /** Get finger3 value.
466  * Angular value of finger 3.
467  * @return finger3 value
468  */
469 float
471 {
472  return data->finger3;
473 }
474 
475 /** Get maximum length of finger3 value.
476  * @return length of finger3 value, can be length of the array or number of
477  * maximum number of characters for a string
478  */
479 size_t
481 {
482  return 1;
483 }
484 
485 /** Set finger3 value.
486  * Angular value of finger 3.
487  * @param new_finger3 new finger3 value
488  */
489 void
490 JacoInterface::set_finger3(const float new_finger3)
491 {
492  data->finger3 = new_finger3;
493  data_changed = true;
494 }
495 
496 /** Get msgid value.
497  * The ID of the message that is currently being
498  processed, or 0 if no message is being processed.
499  * @return msgid value
500  */
501 uint32_t
503 {
504  return data->msgid;
505 }
506 
507 /** Get maximum length of msgid value.
508  * @return length of msgid value, can be length of the array or number of
509  * maximum number of characters for a string
510  */
511 size_t
513 {
514  return 1;
515 }
516 
517 /** Set msgid value.
518  * The ID of the message that is currently being
519  processed, or 0 if no message is being processed.
520  * @param new_msgid new msgid value
521  */
522 void
523 JacoInterface::set_msgid(const uint32_t new_msgid)
524 {
525  data->msgid = new_msgid;
526  data_changed = true;
527 }
528 
529 /** Get final value.
530  * True, if the last goto command has been finished,
531  false if it is still running
532  * @return final value
533  */
534 bool
536 {
537  return data->final;
538 }
539 
540 /** Get maximum length of final value.
541  * @return length of final value, can be length of the array or number of
542  * maximum number of characters for a string
543  */
544 size_t
546 {
547  return 1;
548 }
549 
550 /** Set final value.
551  * True, if the last goto command has been finished,
552  false if it is still running
553  * @param new_final new final value
554  */
555 void
556 JacoInterface::set_final(const bool new_final)
557 {
558  data->final = new_final;
559  data_changed = true;
560 }
561 
562 /** Get error_code value.
563  * Error code, set if
564  final is true. 0 if no error occured, an error code from ERROR_*
565  constants otherwise.
566  * @return error_code value
567  */
568 uint32_t
570 {
571  return data->error_code;
572 }
573 
574 /** Get maximum length of error_code value.
575  * @return length of error_code value, can be length of the array or number of
576  * maximum number of characters for a string
577  */
578 size_t
580 {
581  return 1;
582 }
583 
584 /** Set error_code value.
585  * Error code, set if
586  final is true. 0 if no error occured, an error code from ERROR_*
587  constants otherwise.
588  * @param new_error_code new error_code value
589  */
590 void
591 JacoInterface::set_error_code(const uint32_t new_error_code)
592 {
593  data->error_code = new_error_code;
594  data_changed = true;
595 }
596 
597 /* =========== message create =========== */
598 Message *
600 {
601  if ( strncmp("CalibrateMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
602  return new CalibrateMessage();
603  } else if ( strncmp("RetractMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
604  return new RetractMessage();
605  } else if ( strncmp("StopMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
606  return new StopMessage();
607  } else if ( strncmp("CartesianGotoMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
608  return new CartesianGotoMessage();
609  } else if ( strncmp("AngularGotoMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
610  return new AngularGotoMessage();
611  } else if ( strncmp("MoveGripperMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
612  return new MoveGripperMessage();
613  } else if ( strncmp("SetPlannerParamsMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
614  return new SetPlannerParamsMessage();
615  } else if ( strncmp("JoystickPushMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
616  return new JoystickPushMessage();
617  } else if ( strncmp("JoystickReleaseMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
618  return new JoystickReleaseMessage();
619  } else {
620  throw UnknownTypeException("The given type '%s' does not match any known "
621  "message type for this interface type.", type);
622  }
623 }
624 
625 
626 /** Copy values from other interface.
627  * @param other other interface to copy values from
628  */
629 void
631 {
632  const JacoInterface *oi = dynamic_cast<const JacoInterface *>(other);
633  if (oi == NULL) {
634  throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)",
635  type(), other->type());
636  }
637  memcpy(data, oi->data, sizeof(JacoInterface_data_t));
638 }
639 
640 const char *
641 JacoInterface::enum_tostring(const char *enumtype, int val) const
642 {
643  throw UnknownTypeException("Unknown enum type %s", enumtype);
644 }
645 
646 /* =========== messages =========== */
647 /** @class JacoInterface::CalibrateMessage <interfaces/JacoInterface.h>
648  * CalibrateMessage Fawkes BlackBoard Interface Message.
649  *
650 
651  */
652 
653 
654 /** Constructor */
656 {
657  data_size = sizeof(CalibrateMessage_data_t);
658  data_ptr = malloc(data_size);
659  memset(data_ptr, 0, data_size);
660  data = (CalibrateMessage_data_t *)data_ptr;
662 }
663 
664 /** Destructor */
666 {
667  free(data_ptr);
668 }
669 
670 /** Copy constructor.
671  * @param m message to copy from
672  */
674 {
675  data_size = m->data_size;
676  data_ptr = malloc(data_size);
677  memcpy(data_ptr, m->data_ptr, data_size);
678  data = (CalibrateMessage_data_t *)data_ptr;
680 }
681 
682 /* Methods */
683 /** Clone this message.
684  * Produces a message of the same type as this message and copies the
685  * data to the new message.
686  * @return clone of this message
687  */
688 Message *
690 {
691  return new JacoInterface::CalibrateMessage(this);
692 }
693 /** @class JacoInterface::RetractMessage <interfaces/JacoInterface.h>
694  * RetractMessage Fawkes BlackBoard Interface Message.
695  *
696 
697  */
698 
699 
700 /** Constructor */
702 {
703  data_size = sizeof(RetractMessage_data_t);
704  data_ptr = malloc(data_size);
705  memset(data_ptr, 0, data_size);
706  data = (RetractMessage_data_t *)data_ptr;
708 }
709 
710 /** Destructor */
712 {
713  free(data_ptr);
714 }
715 
716 /** Copy constructor.
717  * @param m message to copy from
718  */
720 {
721  data_size = m->data_size;
722  data_ptr = malloc(data_size);
723  memcpy(data_ptr, m->data_ptr, data_size);
724  data = (RetractMessage_data_t *)data_ptr;
726 }
727 
728 /* Methods */
729 /** Clone this message.
730  * Produces a message of the same type as this message and copies the
731  * data to the new message.
732  * @return clone of this message
733  */
734 Message *
736 {
737  return new JacoInterface::RetractMessage(this);
738 }
739 /** @class JacoInterface::StopMessage <interfaces/JacoInterface.h>
740  * StopMessage Fawkes BlackBoard Interface Message.
741  *
742 
743  */
744 
745 
746 /** Constructor */
748 {
749  data_size = sizeof(StopMessage_data_t);
750  data_ptr = malloc(data_size);
751  memset(data_ptr, 0, data_size);
752  data = (StopMessage_data_t *)data_ptr;
754 }
755 
756 /** Destructor */
758 {
759  free(data_ptr);
760 }
761 
762 /** Copy constructor.
763  * @param m message to copy from
764  */
766 {
767  data_size = m->data_size;
768  data_ptr = malloc(data_size);
769  memcpy(data_ptr, m->data_ptr, data_size);
770  data = (StopMessage_data_t *)data_ptr;
772 }
773 
774 /* Methods */
775 /** Clone this message.
776  * Produces a message of the same type as this message and copies the
777  * data to the new message.
778  * @return clone of this message
779  */
780 Message *
782 {
783  return new JacoInterface::StopMessage(this);
784 }
785 /** @class JacoInterface::CartesianGotoMessage <interfaces/JacoInterface.h>
786  * CartesianGotoMessage Fawkes BlackBoard Interface Message.
787  *
788 
789  */
790 
791 
792 /** Constructor with initial values.
793  * @param ini_x initial value for x
794  * @param ini_y initial value for y
795  * @param ini_z initial value for z
796  * @param ini_e1 initial value for e1
797  * @param ini_e2 initial value for e2
798  * @param ini_e3 initial value for e3
799  */
800 JacoInterface::CartesianGotoMessage::CartesianGotoMessage(const float ini_x, const float ini_y, const float ini_z, const float ini_e1, const float ini_e2, const float ini_e3) : Message("CartesianGotoMessage")
801 {
802  data_size = sizeof(CartesianGotoMessage_data_t);
803  data_ptr = malloc(data_size);
804  memset(data_ptr, 0, data_size);
805  data = (CartesianGotoMessage_data_t *)data_ptr;
807  data->x = ini_x;
808  data->y = ini_y;
809  data->z = ini_z;
810  data->e1 = ini_e1;
811  data->e2 = ini_e2;
812  data->e3 = ini_e3;
813  add_fieldinfo(IFT_FLOAT, "x", 1, &data->x);
814  add_fieldinfo(IFT_FLOAT, "y", 1, &data->y);
815  add_fieldinfo(IFT_FLOAT, "z", 1, &data->z);
816  add_fieldinfo(IFT_FLOAT, "e1", 1, &data->e1);
817  add_fieldinfo(IFT_FLOAT, "e2", 1, &data->e2);
818  add_fieldinfo(IFT_FLOAT, "e3", 1, &data->e3);
819 }
820 /** Constructor */
822 {
823  data_size = sizeof(CartesianGotoMessage_data_t);
824  data_ptr = malloc(data_size);
825  memset(data_ptr, 0, data_size);
826  data = (CartesianGotoMessage_data_t *)data_ptr;
828  add_fieldinfo(IFT_FLOAT, "x", 1, &data->x);
829  add_fieldinfo(IFT_FLOAT, "y", 1, &data->y);
830  add_fieldinfo(IFT_FLOAT, "z", 1, &data->z);
831  add_fieldinfo(IFT_FLOAT, "e1", 1, &data->e1);
832  add_fieldinfo(IFT_FLOAT, "e2", 1, &data->e2);
833  add_fieldinfo(IFT_FLOAT, "e3", 1, &data->e3);
834 }
835 
836 /** Destructor */
838 {
839  free(data_ptr);
840 }
841 
842 /** Copy constructor.
843  * @param m message to copy from
844  */
846 {
847  data_size = m->data_size;
848  data_ptr = malloc(data_size);
849  memcpy(data_ptr, m->data_ptr, data_size);
850  data = (CartesianGotoMessage_data_t *)data_ptr;
852 }
853 
854 /* Methods */
855 /** Get x value.
856  * X-coordinate of target
857  * @return x value
858  */
859 float
861 {
862  return data->x;
863 }
864 
865 /** Get maximum length of x value.
866  * @return length of x value, can be length of the array or number of
867  * maximum number of characters for a string
868  */
869 size_t
871 {
872  return 1;
873 }
874 
875 /** Set x value.
876  * X-coordinate of target
877  * @param new_x new x value
878  */
879 void
881 {
882  data->x = new_x;
883 }
884 
885 /** Get y value.
886  * Y-coordinate of target
887  * @return y value
888  */
889 float
891 {
892  return data->y;
893 }
894 
895 /** Get maximum length of y value.
896  * @return length of y value, can be length of the array or number of
897  * maximum number of characters for a string
898  */
899 size_t
901 {
902  return 1;
903 }
904 
905 /** Set y value.
906  * Y-coordinate of target
907  * @param new_y new y value
908  */
909 void
911 {
912  data->y = new_y;
913 }
914 
915 /** Get z value.
916  * Z-coordinate of target
917  * @return z value
918  */
919 float
921 {
922  return data->z;
923 }
924 
925 /** Get maximum length of z value.
926  * @return length of z value, can be length of the array or number of
927  * maximum number of characters for a string
928  */
929 size_t
931 {
932  return 1;
933 }
934 
935 /** Set z value.
936  * Z-coordinate of target
937  * @param new_z new z value
938  */
939 void
941 {
942  data->z = new_z;
943 }
944 
945 /** Get e1 value.
946  * 1st Euler angle of target rotation
947  * @return e1 value
948  */
949 float
951 {
952  return data->e1;
953 }
954 
955 /** Get maximum length of e1 value.
956  * @return length of e1 value, can be length of the array or number of
957  * maximum number of characters for a string
958  */
959 size_t
961 {
962  return 1;
963 }
964 
965 /** Set e1 value.
966  * 1st Euler angle of target rotation
967  * @param new_e1 new e1 value
968  */
969 void
971 {
972  data->e1 = new_e1;
973 }
974 
975 /** Get e2 value.
976  * 2nd Euler angle of target rotation
977  * @return e2 value
978  */
979 float
981 {
982  return data->e2;
983 }
984 
985 /** Get maximum length of e2 value.
986  * @return length of e2 value, can be length of the array or number of
987  * maximum number of characters for a string
988  */
989 size_t
991 {
992  return 1;
993 }
994 
995 /** Set e2 value.
996  * 2nd Euler angle of target rotation
997  * @param new_e2 new e2 value
998  */
999 void
1001 {
1002  data->e2 = new_e2;
1003 }
1004 
1005 /** Get e3 value.
1006  * 3rd Euler angle of target rotation
1007  * @return e3 value
1008  */
1009 float
1011 {
1012  return data->e3;
1013 }
1014 
1015 /** Get maximum length of e3 value.
1016  * @return length of e3 value, can be length of the array or number of
1017  * maximum number of characters for a string
1018  */
1019 size_t
1021 {
1022  return 1;
1023 }
1024 
1025 /** Set e3 value.
1026  * 3rd Euler angle of target rotation
1027  * @param new_e3 new e3 value
1028  */
1029 void
1031 {
1032  data->e3 = new_e3;
1033 }
1034 
1035 /** Clone this message.
1036  * Produces a message of the same type as this message and copies the
1037  * data to the new message.
1038  * @return clone of this message
1039  */
1040 Message *
1042 {
1043  return new JacoInterface::CartesianGotoMessage(this);
1044 }
1045 /** @class JacoInterface::AngularGotoMessage <interfaces/JacoInterface.h>
1046  * AngularGotoMessage Fawkes BlackBoard Interface Message.
1047  *
1048 
1049  */
1050 
1051 
1052 /** Constructor with initial values.
1053  * @param ini_j1 initial value for j1
1054  * @param ini_j2 initial value for j2
1055  * @param ini_j3 initial value for j3
1056  * @param ini_j4 initial value for j4
1057  * @param ini_j5 initial value for j5
1058  * @param ini_j6 initial value for j6
1059  */
1060 JacoInterface::AngularGotoMessage::AngularGotoMessage(const float ini_j1, const float ini_j2, const float ini_j3, const float ini_j4, const float ini_j5, const float ini_j6) : Message("AngularGotoMessage")
1061 {
1062  data_size = sizeof(AngularGotoMessage_data_t);
1063  data_ptr = malloc(data_size);
1064  memset(data_ptr, 0, data_size);
1065  data = (AngularGotoMessage_data_t *)data_ptr;
1067  data->j1 = ini_j1;
1068  data->j2 = ini_j2;
1069  data->j3 = ini_j3;
1070  data->j4 = ini_j4;
1071  data->j5 = ini_j5;
1072  data->j6 = ini_j6;
1073  add_fieldinfo(IFT_FLOAT, "j1", 1, &data->j1);
1074  add_fieldinfo(IFT_FLOAT, "j2", 1, &data->j2);
1075  add_fieldinfo(IFT_FLOAT, "j3", 1, &data->j3);
1076  add_fieldinfo(IFT_FLOAT, "j4", 1, &data->j4);
1077  add_fieldinfo(IFT_FLOAT, "j5", 1, &data->j5);
1078  add_fieldinfo(IFT_FLOAT, "j6", 1, &data->j6);
1079 }
1080 /** Constructor */
1082 {
1083  data_size = sizeof(AngularGotoMessage_data_t);
1084  data_ptr = malloc(data_size);
1085  memset(data_ptr, 0, data_size);
1086  data = (AngularGotoMessage_data_t *)data_ptr;
1088  add_fieldinfo(IFT_FLOAT, "j1", 1, &data->j1);
1089  add_fieldinfo(IFT_FLOAT, "j2", 1, &data->j2);
1090  add_fieldinfo(IFT_FLOAT, "j3", 1, &data->j3);
1091  add_fieldinfo(IFT_FLOAT, "j4", 1, &data->j4);
1092  add_fieldinfo(IFT_FLOAT, "j5", 1, &data->j5);
1093  add_fieldinfo(IFT_FLOAT, "j6", 1, &data->j6);
1094 }
1095 
1096 /** Destructor */
1098 {
1099  free(data_ptr);
1100 }
1101 
1102 /** Copy constructor.
1103  * @param m message to copy from
1104  */
1106 {
1107  data_size = m->data_size;
1108  data_ptr = malloc(data_size);
1109  memcpy(data_ptr, m->data_ptr, data_size);
1110  data = (AngularGotoMessage_data_t *)data_ptr;
1112 }
1113 
1114 /* Methods */
1115 /** Get j1 value.
1116  * Angular value of 1st joint
1117  * @return j1 value
1118  */
1119 float
1121 {
1122  return data->j1;
1123 }
1124 
1125 /** Get maximum length of j1 value.
1126  * @return length of j1 value, can be length of the array or number of
1127  * maximum number of characters for a string
1128  */
1129 size_t
1131 {
1132  return 1;
1133 }
1134 
1135 /** Set j1 value.
1136  * Angular value of 1st joint
1137  * @param new_j1 new j1 value
1138  */
1139 void
1141 {
1142  data->j1 = new_j1;
1143 }
1144 
1145 /** Get j2 value.
1146  * Angular value of 2nd joint
1147  * @return j2 value
1148  */
1149 float
1151 {
1152  return data->j2;
1153 }
1154 
1155 /** Get maximum length of j2 value.
1156  * @return length of j2 value, can be length of the array or number of
1157  * maximum number of characters for a string
1158  */
1159 size_t
1161 {
1162  return 1;
1163 }
1164 
1165 /** Set j2 value.
1166  * Angular value of 2nd joint
1167  * @param new_j2 new j2 value
1168  */
1169 void
1171 {
1172  data->j2 = new_j2;
1173 }
1174 
1175 /** Get j3 value.
1176  * Angular value of 3rd joint
1177  * @return j3 value
1178  */
1179 float
1181 {
1182  return data->j3;
1183 }
1184 
1185 /** Get maximum length of j3 value.
1186  * @return length of j3 value, can be length of the array or number of
1187  * maximum number of characters for a string
1188  */
1189 size_t
1191 {
1192  return 1;
1193 }
1194 
1195 /** Set j3 value.
1196  * Angular value of 3rd joint
1197  * @param new_j3 new j3 value
1198  */
1199 void
1201 {
1202  data->j3 = new_j3;
1203 }
1204 
1205 /** Get j4 value.
1206  * Angular value of 4th joint
1207  * @return j4 value
1208  */
1209 float
1211 {
1212  return data->j4;
1213 }
1214 
1215 /** Get maximum length of j4 value.
1216  * @return length of j4 value, can be length of the array or number of
1217  * maximum number of characters for a string
1218  */
1219 size_t
1221 {
1222  return 1;
1223 }
1224 
1225 /** Set j4 value.
1226  * Angular value of 4th joint
1227  * @param new_j4 new j4 value
1228  */
1229 void
1231 {
1232  data->j4 = new_j4;
1233 }
1234 
1235 /** Get j5 value.
1236  * Angular value of 5th joint
1237  * @return j5 value
1238  */
1239 float
1241 {
1242  return data->j5;
1243 }
1244 
1245 /** Get maximum length of j5 value.
1246  * @return length of j5 value, can be length of the array or number of
1247  * maximum number of characters for a string
1248  */
1249 size_t
1251 {
1252  return 1;
1253 }
1254 
1255 /** Set j5 value.
1256  * Angular value of 5th joint
1257  * @param new_j5 new j5 value
1258  */
1259 void
1261 {
1262  data->j5 = new_j5;
1263 }
1264 
1265 /** Get j6 value.
1266  * Angular value of 6th joint
1267  * @return j6 value
1268  */
1269 float
1271 {
1272  return data->j6;
1273 }
1274 
1275 /** Get maximum length of j6 value.
1276  * @return length of j6 value, can be length of the array or number of
1277  * maximum number of characters for a string
1278  */
1279 size_t
1281 {
1282  return 1;
1283 }
1284 
1285 /** Set j6 value.
1286  * Angular value of 6th joint
1287  * @param new_j6 new j6 value
1288  */
1289 void
1291 {
1292  data->j6 = new_j6;
1293 }
1294 
1295 /** Clone this message.
1296  * Produces a message of the same type as this message and copies the
1297  * data to the new message.
1298  * @return clone of this message
1299  */
1300 Message *
1302 {
1303  return new JacoInterface::AngularGotoMessage(this);
1304 }
1305 /** @class JacoInterface::MoveGripperMessage <interfaces/JacoInterface.h>
1306  * MoveGripperMessage Fawkes BlackBoard Interface Message.
1307  *
1308 
1309  */
1310 
1311 
1312 /** Constructor with initial values.
1313  * @param ini_finger1 initial value for finger1
1314  * @param ini_finger2 initial value for finger2
1315  * @param ini_finger3 initial value for finger3
1316  */
1317 JacoInterface::MoveGripperMessage::MoveGripperMessage(const float ini_finger1, const float ini_finger2, const float ini_finger3) : Message("MoveGripperMessage")
1318 {
1319  data_size = sizeof(MoveGripperMessage_data_t);
1320  data_ptr = malloc(data_size);
1321  memset(data_ptr, 0, data_size);
1322  data = (MoveGripperMessage_data_t *)data_ptr;
1324  data->finger1 = ini_finger1;
1325  data->finger2 = ini_finger2;
1326  data->finger3 = ini_finger3;
1327  add_fieldinfo(IFT_FLOAT, "finger1", 1, &data->finger1);
1328  add_fieldinfo(IFT_FLOAT, "finger2", 1, &data->finger2);
1329  add_fieldinfo(IFT_FLOAT, "finger3", 1, &data->finger3);
1330 }
1331 /** Constructor */
1333 {
1334  data_size = sizeof(MoveGripperMessage_data_t);
1335  data_ptr = malloc(data_size);
1336  memset(data_ptr, 0, data_size);
1337  data = (MoveGripperMessage_data_t *)data_ptr;
1339  add_fieldinfo(IFT_FLOAT, "finger1", 1, &data->finger1);
1340  add_fieldinfo(IFT_FLOAT, "finger2", 1, &data->finger2);
1341  add_fieldinfo(IFT_FLOAT, "finger3", 1, &data->finger3);
1342 }
1343 
1344 /** Destructor */
1346 {
1347  free(data_ptr);
1348 }
1349 
1350 /** Copy constructor.
1351  * @param m message to copy from
1352  */
1354 {
1355  data_size = m->data_size;
1356  data_ptr = malloc(data_size);
1357  memcpy(data_ptr, m->data_ptr, data_size);
1358  data = (MoveGripperMessage_data_t *)data_ptr;
1360 }
1361 
1362 /* Methods */
1363 /** Get finger1 value.
1364  * Value of finger 1. Range [0,60]
1365  * @return finger1 value
1366  */
1367 float
1369 {
1370  return data->finger1;
1371 }
1372 
1373 /** Get maximum length of finger1 value.
1374  * @return length of finger1 value, can be length of the array or number of
1375  * maximum number of characters for a string
1376  */
1377 size_t
1379 {
1380  return 1;
1381 }
1382 
1383 /** Set finger1 value.
1384  * Value of finger 1. Range [0,60]
1385  * @param new_finger1 new finger1 value
1386  */
1387 void
1389 {
1390  data->finger1 = new_finger1;
1391 }
1392 
1393 /** Get finger2 value.
1394  * Value of finger 2. Range [0,60]
1395  * @return finger2 value
1396  */
1397 float
1399 {
1400  return data->finger2;
1401 }
1402 
1403 /** Get maximum length of finger2 value.
1404  * @return length of finger2 value, can be length of the array or number of
1405  * maximum number of characters for a string
1406  */
1407 size_t
1409 {
1410  return 1;
1411 }
1412 
1413 /** Set finger2 value.
1414  * Value of finger 2. Range [0,60]
1415  * @param new_finger2 new finger2 value
1416  */
1417 void
1419 {
1420  data->finger2 = new_finger2;
1421 }
1422 
1423 /** Get finger3 value.
1424  * Value of finger 3. Range [0,60]
1425  * @return finger3 value
1426  */
1427 float
1429 {
1430  return data->finger3;
1431 }
1432 
1433 /** Get maximum length of finger3 value.
1434  * @return length of finger3 value, can be length of the array or number of
1435  * maximum number of characters for a string
1436  */
1437 size_t
1439 {
1440  return 1;
1441 }
1442 
1443 /** Set finger3 value.
1444  * Value of finger 3. Range [0,60]
1445  * @param new_finger3 new finger3 value
1446  */
1447 void
1449 {
1450  data->finger3 = new_finger3;
1451 }
1452 
1453 /** Clone this message.
1454  * Produces a message of the same type as this message and copies the
1455  * data to the new message.
1456  * @return clone of this message
1457  */
1458 Message *
1460 {
1461  return new JacoInterface::MoveGripperMessage(this);
1462 }
1463 /** @class JacoInterface::SetPlannerParamsMessage <interfaces/JacoInterface.h>
1464  * SetPlannerParamsMessage Fawkes BlackBoard Interface Message.
1465  *
1466 
1467  */
1468 
1469 
1470 /** Constructor with initial values.
1471  * @param ini_params initial value for params
1472  */
1473 JacoInterface::SetPlannerParamsMessage::SetPlannerParamsMessage(const char * ini_params) : Message("SetPlannerParamsMessage")
1474 {
1475  data_size = sizeof(SetPlannerParamsMessage_data_t);
1476  data_ptr = malloc(data_size);
1477  memset(data_ptr, 0, data_size);
1478  data = (SetPlannerParamsMessage_data_t *)data_ptr;
1480  strncpy(data->params, ini_params, 1024);
1481  add_fieldinfo(IFT_STRING, "params", 1024, data->params);
1482 }
1483 /** Constructor */
1485 {
1486  data_size = sizeof(SetPlannerParamsMessage_data_t);
1487  data_ptr = malloc(data_size);
1488  memset(data_ptr, 0, data_size);
1489  data = (SetPlannerParamsMessage_data_t *)data_ptr;
1491  add_fieldinfo(IFT_STRING, "params", 1024, data->params);
1492 }
1493 
1494 /** Destructor */
1496 {
1497  free(data_ptr);
1498 }
1499 
1500 /** Copy constructor.
1501  * @param m message to copy from
1502  */
1504 {
1505  data_size = m->data_size;
1506  data_ptr = malloc(data_size);
1507  memcpy(data_ptr, m->data_ptr, data_size);
1508  data = (SetPlannerParamsMessage_data_t *)data_ptr;
1510 }
1511 
1512 /* Methods */
1513 /** Get params value.
1514  * Planner parameters
1515  * @return params value
1516  */
1517 char *
1519 {
1520  return data->params;
1521 }
1522 
1523 /** Get maximum length of params value.
1524  * @return length of params value, can be length of the array or number of
1525  * maximum number of characters for a string
1526  */
1527 size_t
1529 {
1530  return 1024;
1531 }
1532 
1533 /** Set params value.
1534  * Planner parameters
1535  * @param new_params new params value
1536  */
1537 void
1539 {
1540  strncpy(data->params, new_params, sizeof(data->params));
1541 }
1542 
1543 /** Clone this message.
1544  * Produces a message of the same type as this message and copies the
1545  * data to the new message.
1546  * @return clone of this message
1547  */
1548 Message *
1550 {
1551  return new JacoInterface::SetPlannerParamsMessage(this);
1552 }
1553 /** @class JacoInterface::JoystickPushMessage <interfaces/JacoInterface.h>
1554  * JoystickPushMessage Fawkes BlackBoard Interface Message.
1555  *
1556 
1557  */
1558 
1559 
1560 /** Constructor with initial values.
1561  * @param ini_button initial value for button
1562  */
1563 JacoInterface::JoystickPushMessage::JoystickPushMessage(const uint32_t ini_button) : Message("JoystickPushMessage")
1564 {
1565  data_size = sizeof(JoystickPushMessage_data_t);
1566  data_ptr = malloc(data_size);
1567  memset(data_ptr, 0, data_size);
1568  data = (JoystickPushMessage_data_t *)data_ptr;
1570  data->button = ini_button;
1571  add_fieldinfo(IFT_UINT32, "button", 1, &data->button);
1572 }
1573 /** Constructor */
1575 {
1576  data_size = sizeof(JoystickPushMessage_data_t);
1577  data_ptr = malloc(data_size);
1578  memset(data_ptr, 0, data_size);
1579  data = (JoystickPushMessage_data_t *)data_ptr;
1581  add_fieldinfo(IFT_UINT32, "button", 1, &data->button);
1582 }
1583 
1584 /** Destructor */
1586 {
1587  free(data_ptr);
1588 }
1589 
1590 /** Copy constructor.
1591  * @param m message to copy from
1592  */
1594 {
1595  data_size = m->data_size;
1596  data_ptr = malloc(data_size);
1597  memcpy(data_ptr, m->data_ptr, data_size);
1598  data = (JoystickPushMessage_data_t *)data_ptr;
1600 }
1601 
1602 /* Methods */
1603 /** Get button value.
1604  * Button ID to push.
1605  * @return button value
1606  */
1607 uint32_t
1609 {
1610  return data->button;
1611 }
1612 
1613 /** Get maximum length of button value.
1614  * @return length of button value, can be length of the array or number of
1615  * maximum number of characters for a string
1616  */
1617 size_t
1619 {
1620  return 1;
1621 }
1622 
1623 /** Set button value.
1624  * Button ID to push.
1625  * @param new_button new button value
1626  */
1627 void
1629 {
1630  data->button = new_button;
1631 }
1632 
1633 /** Clone this message.
1634  * Produces a message of the same type as this message and copies the
1635  * data to the new message.
1636  * @return clone of this message
1637  */
1638 Message *
1640 {
1641  return new JacoInterface::JoystickPushMessage(this);
1642 }
1643 /** @class JacoInterface::JoystickReleaseMessage <interfaces/JacoInterface.h>
1644  * JoystickReleaseMessage Fawkes BlackBoard Interface Message.
1645  *
1646 
1647  */
1648 
1649 
1650 /** Constructor */
1652 {
1653  data_size = sizeof(JoystickReleaseMessage_data_t);
1654  data_ptr = malloc(data_size);
1655  memset(data_ptr, 0, data_size);
1656  data = (JoystickReleaseMessage_data_t *)data_ptr;
1658 }
1659 
1660 /** Destructor */
1662 {
1663  free(data_ptr);
1664 }
1665 
1666 /** Copy constructor.
1667  * @param m message to copy from
1668  */
1670 {
1671  data_size = m->data_size;
1672  data_ptr = malloc(data_size);
1673  memcpy(data_ptr, m->data_ptr, data_size);
1674  data = (JoystickReleaseMessage_data_t *)data_ptr;
1676 }
1677 
1678 /* Methods */
1679 /** Clone this message.
1680  * Produces a message of the same type as this message and copies the
1681  * data to the new message.
1682  * @return clone of this message
1683  */
1684 Message *
1686 {
1687  return new JacoInterface::JoystickReleaseMessage(this);
1688 }
1689 /** Check if message is valid and can be enqueued.
1690  * @param message Message to check
1691  * @return true if the message is valid, false otherwise.
1692  */
1693 bool
1695 {
1696  const CalibrateMessage *m0 = dynamic_cast<const CalibrateMessage *>(message);
1697  if ( m0 != NULL ) {
1698  return true;
1699  }
1700  const RetractMessage *m1 = dynamic_cast<const RetractMessage *>(message);
1701  if ( m1 != NULL ) {
1702  return true;
1703  }
1704  const StopMessage *m2 = dynamic_cast<const StopMessage *>(message);
1705  if ( m2 != NULL ) {
1706  return true;
1707  }
1708  const CartesianGotoMessage *m3 = dynamic_cast<const CartesianGotoMessage *>(message);
1709  if ( m3 != NULL ) {
1710  return true;
1711  }
1712  const AngularGotoMessage *m4 = dynamic_cast<const AngularGotoMessage *>(message);
1713  if ( m4 != NULL ) {
1714  return true;
1715  }
1716  const MoveGripperMessage *m5 = dynamic_cast<const MoveGripperMessage *>(message);
1717  if ( m5 != NULL ) {
1718  return true;
1719  }
1720  const SetPlannerParamsMessage *m6 = dynamic_cast<const SetPlannerParamsMessage *>(message);
1721  if ( m6 != NULL ) {
1722  return true;
1723  }
1724  const JoystickPushMessage *m7 = dynamic_cast<const JoystickPushMessage *>(message);
1725  if ( m7 != NULL ) {
1726  return true;
1727  }
1728  const JoystickReleaseMessage *m8 = dynamic_cast<const JoystickReleaseMessage *>(message);
1729  if ( m8 != NULL ) {
1730  return true;
1731  }
1732  return false;
1733 }
1734 
1735 /// @cond INTERNALS
1736 EXPORT_INTERFACE(JacoInterface)
1737 /// @endcond
1738 
1739 
1740 } // end namespace fawkes
void set_finger1(const float new_finger1)
Set finger1 value.
virtual Message * clone() const
Clone this message.
size_t maxlenof_params() const
Get maximum length of params value.
float z() const
Get z value.
size_t maxlenof_e3() const
Get maximum length of e3 value.
void set_x(const float new_x)
Set x value.
size_t maxlenof_finger3() const
Get maximum length of finger3 value.
size_t maxlenof_connected() const
Get maximum length of connected value.
void * data_ptr
Pointer to memory that contains local data.
Definition: message.h:124
size_t maxlenof_finger1() const
Get maximum length of finger1 value.
void set_y(const float new_y)
Set y value.
size_t maxlenof_e1() const
Get maximum length of e1 value.
size_t maxlenof_joints() const
Get maximum length of joints value.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:44
void set_j1(const float new_j1)
Set j1 value.
float finger2() const
Get finger2 value.
size_t maxlenof_finger3() const
Get maximum length of finger3 value.
size_t maxlenof_z() const
Get maximum length of z value.
void set_e2(const float new_e2)
Set e2 value.
void set_hash(unsigned char *ihash)
Set hash.
Definition: interface.cpp:314
size_t maxlenof_y() const
Get maximum length of y value.
Fawkes library namespace.
SetPlannerParamsMessage Fawkes BlackBoard Interface Message.
void set_j5(const float new_j5)
Set j5 value.
Timestamp data, must be present and first entries for each interface data structs! This leans on time...
Definition: message.h:129
void set_e3(const float new_e3)
Set e3 value.
size_t maxlenof_finger2() const
Get maximum length of finger2 value.
void set_finger1(const float new_finger1)
Set finger1 value.
unsigned int data_size
Minimal data size to hold data storage.
Definition: interface.h:221
float finger2() const
Get finger2 value.
size_t maxlenof_msgid() const
Get maximum length of msgid value.
virtual Message * clone() const
Clone this message.
size_t maxlenof_e2() const
Get maximum length of e2 value.
size_t maxlenof_j5() const
Get maximum length of j5 value.
string field
Definition: types.h:47
virtual Message * create_message(const char *type) const
Create message based on type name.
MoveGripperMessage Fawkes BlackBoard Interface Message.
bool is_final() const
Get final value.
size_t maxlenof_finger2() const
Get maximum length of finger2 value.
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:79
void set_j3(const float new_j3)
Set j3 value.
uint32_t error_code() const
Get error_code value.
virtual Message * clone() const
Clone this message.
static const uint32_t ERROR_NO_IK
ERROR_NO_IK constant.
Definition: JacoInterface.h:42
float finger3() const
Get finger3 value.
size_t maxlenof_error_code() const
Get maximum length of error_code value.
message_data_ts_t * data_ts
data timestamp aliasing pointer
Definition: message.h:133
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0, const interface_enum_map_t *enum_map=0)
Add an entry to the field info list.
Definition: interface.cpp:335
unsigned int data_size
Size of memory needed to hold all data.
Definition: message.h:125
void set_connected(const bool new_connected)
Set connected value.
float euler3() const
Get euler3 value.
static const uint32_t ERROR_NONE
ERROR_NONE constant.
Definition: JacoInterface.h:40
size_t maxlenof_initialized() const
Get maximum length of initialized value.
void add_messageinfo(const char *name)
Add an entry to the message info list.
Definition: interface.cpp:373
virtual Message * clone() const
Clone this message.
bool data_changed
Indicator if data has changed.
Definition: interface.h:222
float euler2() const
Get euler2 value.
float finger1() const
Get finger1 value.
const char * type() const
Get type of interface.
Definition: interface.cpp:651
virtual Message * clone() const
Clone this message.
float x() const
Get x value.
void * data_ptr
Pointer to local memory storage.
Definition: interface.h:220
static const uint32_t ERROR_UNSPECIFIC
ERROR_UNSPECIFIC constant.
Definition: JacoInterface.h:41
float * joints() const
Get joints value.
Base class for exceptions in Fawkes.
Definition: exception.h:36
uint32_t msgid() const
Get msgid value.
void set_j6(const float new_j6)
Set j6 value.
void set_finger2(const float new_finger2)
Set finger2 value.
virtual Message * clone() const
Clone this message.
size_t maxlenof_j2() const
Get maximum length of j2 value.
CalibrateMessage Fawkes BlackBoard Interface Message.
Definition: JacoInterface.h:75
StopMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_j6() const
Get maximum length of j6 value.
size_t maxlenof_z() const
Get maximum length of z value.
void set_z(const float new_z)
Set z value.
void set_j4(const float new_j4)
Set j4 value.
void set_e1(const float new_e1)
Set e1 value.
void set_error_code(const uint32_t new_error_code)
Set error_code value.
size_t maxlenof_j4() const
Get maximum length of j4 value.
virtual Message * clone() const
Clone this message.
void set_initialized(const bool new_initialized)
Set initialized value.
size_t maxlenof_finger1() const
Get maximum length of finger1 value.
size_t maxlenof_x() const
Get maximum length of x value.
float field
Definition: types.h:45
size_t maxlenof_button() const
Get maximum length of button value.
float euler1() const
Get euler1 value.
bool is_initialized() const
Get initialized value.
void set_joints(unsigned int index, const float new_joints)
Set joints value at given index.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
uint32_t button() const
Get button value.
virtual Message * clone() const
Clone this message.
void set_finger3(const float new_finger3)
Set finger3 value.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
size_t maxlenof_euler3() const
Get maximum length of euler3 value.
void set_final(const bool new_final)
Set final value.
char * params() const
Get params value.
JoystickPushMessage Fawkes BlackBoard Interface Message.
void set_euler3(const float new_euler3)
Set euler3 value.
void set_z(const float new_z)
Set z value.
void set_msgid(const uint32_t new_msgid)
Set msgid value.
virtual Message * clone() const
Clone this message.
JacoInterface Fawkes BlackBoard Interface.
Definition: JacoInterface.h:33
void set_j2(const float new_j2)
Set j2 value.
AngularGotoMessage Fawkes BlackBoard Interface Message.
void set_euler1(const float new_euler1)
Set euler1 value.
JoystickReleaseMessage Fawkes BlackBoard Interface Message.
void set_params(const char *new_params)
Set params value.
void set_y(const float new_y)
Set y value.
interface_data_ts_t * data_ts
Pointer to data casted to timestamp struct.
Definition: interface.h:224
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0, const interface_enum_map_t *enum_map=0)
Add an entry to the info list.
Definition: message.cpp:436
size_t maxlenof_final() const
Get maximum length of final value.
boolean field
Definition: types.h:36
size_t maxlenof_x() const
Get maximum length of x value.
bool is_connected() const
Get connected value.
void set_finger3(const float new_finger3)
Set finger3 value.
float finger3() const
Get finger3 value.
CartesianGotoMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_j1() const
Get maximum length of j1 value.
size_t maxlenof_j3() const
Get maximum length of j3 value.
RetractMessage Fawkes BlackBoard Interface Message.
Definition: JacoInterface.h:95
virtual void copy_values(const Interface *other)
Copy values from other interface.
void set_finger2(const float new_finger2)
Set finger2 value.
static const uint32_t ERROR_PLANNING
ERROR_PLANNING constant.
Definition: JacoInterface.h:43
32 bit unsigned integer field
Definition: types.h:42
float y() const
Get y value.
void set_button(const uint32_t new_button)
Set button value.
size_t maxlenof_euler2() const
Get maximum length of euler2 value.
size_t maxlenof_y() const
Get maximum length of y value.
float finger1() const
Get finger1 value.
void set_x(const float new_x)
Set x value.
void set_euler2(const float new_euler2)
Set euler2 value.
size_t maxlenof_euler1() const
Get maximum length of euler1 value.