Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * KatanaInterface.cpp - Fawkes BlackBoard Interface - KatanaInterface 00004 * 00005 * Templated created: Thu Oct 12 10:49:19 2006 00006 * Copyright 2009 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 #include <interfaces/KatanaInterface.h> 00025 00026 #include <core/exceptions/software.h> 00027 00028 #include <cstring> 00029 #include <cstdlib> 00030 00031 namespace fawkes { 00032 00033 /** @class KatanaInterface <interfaces/KatanaInterface.h> 00034 * KatanaInterface Fawkes BlackBoard Interface. 00035 * 00036 Interface to access component providing access to a Neuronics 00037 Katana arm. 00038 00039 * @ingroup FawkesInterfaces 00040 */ 00041 00042 00043 /** SENSOR_IR_RIGHT_INNER_MIDDLE constant */ 00044 const uint32_t KatanaInterface::SENSOR_IR_RIGHT_INNER_MIDDLE = 0u; 00045 /** SENSOR_IR_RIGHT_INNER_FRONT constant */ 00046 const uint32_t KatanaInterface::SENSOR_IR_RIGHT_INNER_FRONT = 1u; 00047 /** SENSOR_RESERVED_2 constant */ 00048 const uint32_t KatanaInterface::SENSOR_RESERVED_2 = 2u; 00049 /** SENSOR_COND_BOTH constant */ 00050 const uint32_t KatanaInterface::SENSOR_COND_BOTH = 3u; 00051 /** SENSOR_IR_RIGHT_OUTER_FRONT constant */ 00052 const uint32_t KatanaInterface::SENSOR_IR_RIGHT_OUTER_FRONT = 4u; 00053 /** SENSOR_IR_RIGHT_BOTTOM_FRONT constant */ 00054 const uint32_t KatanaInterface::SENSOR_IR_RIGHT_BOTTOM_FRONT = 5u; 00055 /** SENSOR_FORCE_RIGHT_REAR constant */ 00056 const uint32_t KatanaInterface::SENSOR_FORCE_RIGHT_REAR = 6u; 00057 /** SENSOR_FORCE_RIGHT_FRONT constant */ 00058 const uint32_t KatanaInterface::SENSOR_FORCE_RIGHT_FRONT = 7u; 00059 /** SENSOR_IR_LEFT_INNER_MIDDLE constant */ 00060 const uint32_t KatanaInterface::SENSOR_IR_LEFT_INNER_MIDDLE = 8u; 00061 /** SENSOR_IR_LEFT_INNER_FRONT constant */ 00062 const uint32_t KatanaInterface::SENSOR_IR_LEFT_INNER_FRONT = 9u; 00063 /** SENSOR_RESERVED_10 constant */ 00064 const uint32_t KatanaInterface::SENSOR_RESERVED_10 = 10u; 00065 /** SENSOR_IR_CENTER_GRIPPER constant */ 00066 const uint32_t KatanaInterface::SENSOR_IR_CENTER_GRIPPER = 11u; 00067 /** SENSOR_IR_LEFT_OUTER_FRONT constant */ 00068 const uint32_t KatanaInterface::SENSOR_IR_LEFT_OUTER_FRONT = 12u; 00069 /** SENSOR_IR_LEFT_BOTTOM_FRONT constant */ 00070 const uint32_t KatanaInterface::SENSOR_IR_LEFT_BOTTOM_FRONT = 13u; 00071 /** SENSOR_FORCE_LEFT_REAR constant */ 00072 const uint32_t KatanaInterface::SENSOR_FORCE_LEFT_REAR = 14u; 00073 /** SENSOR_FORCE_LEFT_FRONT constant */ 00074 const uint32_t KatanaInterface::SENSOR_FORCE_LEFT_FRONT = 15u; 00075 /** ERROR_NONE constant */ 00076 const uint32_t KatanaInterface::ERROR_NONE = 0u; 00077 /** ERROR_UNSPECIFIC constant */ 00078 const uint32_t KatanaInterface::ERROR_UNSPECIFIC = 1u; 00079 /** ERROR_CMD_START_FAILED constant */ 00080 const uint32_t KatanaInterface::ERROR_CMD_START_FAILED = 2u; 00081 /** ERROR_NO_SOLUTION constant */ 00082 const uint32_t KatanaInterface::ERROR_NO_SOLUTION = 4u; 00083 /** ERROR_COMMUNICATION constant */ 00084 const uint32_t KatanaInterface::ERROR_COMMUNICATION = 8u; 00085 /** ERROR_MOTOR_CRASHED constant */ 00086 const uint32_t KatanaInterface::ERROR_MOTOR_CRASHED = 16u; 00087 00088 /** Constructor */ 00089 KatanaInterface::KatanaInterface() : Interface() 00090 { 00091 data_size = sizeof(KatanaInterface_data_t); 00092 data_ptr = malloc(data_size); 00093 data = (KatanaInterface_data_t *)data_ptr; 00094 data_ts = (interface_data_ts_t *)data_ptr; 00095 memset(data_ptr, 0, data_size); 00096 add_fieldinfo(IFT_BYTE, "sensor_value", 16, &data->sensor_value); 00097 add_fieldinfo(IFT_FLOAT, "x", 1, &data->x); 00098 add_fieldinfo(IFT_FLOAT, "y", 1, &data->y); 00099 add_fieldinfo(IFT_FLOAT, "z", 1, &data->z); 00100 add_fieldinfo(IFT_FLOAT, "phi", 1, &data->phi); 00101 add_fieldinfo(IFT_FLOAT, "theta", 1, &data->theta); 00102 add_fieldinfo(IFT_FLOAT, "psi", 1, &data->psi); 00103 add_fieldinfo(IFT_INT32, "encoders", 6, &data->encoders); 00104 add_fieldinfo(IFT_FLOAT, "angles", 6, &data->angles); 00105 add_fieldinfo(IFT_UINT32, "msgid", 1, &data->msgid); 00106 add_fieldinfo(IFT_BOOL, "final", 1, &data->final); 00107 add_fieldinfo(IFT_UINT32, "error_code", 1, &data->error_code); 00108 add_fieldinfo(IFT_BOOL, "enabled", 1, &data->enabled); 00109 add_fieldinfo(IFT_BOOL, "calibrated", 1, &data->calibrated); 00110 add_fieldinfo(IFT_BYTE, "max_velocity", 1, &data->max_velocity); 00111 add_fieldinfo(IFT_BYTE, "num_motors", 1, &data->num_motors); 00112 add_messageinfo("StopMessage"); 00113 add_messageinfo("FlushMessage"); 00114 add_messageinfo("ParkMessage"); 00115 add_messageinfo("LinearGotoMessage"); 00116 add_messageinfo("LinearGotoKniMessage"); 00117 add_messageinfo("ObjectGotoMessage"); 00118 add_messageinfo("CalibrateMessage"); 00119 add_messageinfo("OpenGripperMessage"); 00120 add_messageinfo("CloseGripperMessage"); 00121 add_messageinfo("SetEnabledMessage"); 00122 add_messageinfo("SetMaxVelocityMessage"); 00123 add_messageinfo("SetPlannerParamsMessage"); 00124 add_messageinfo("SetMotorEncoderMessage"); 00125 add_messageinfo("MoveMotorEncoderMessage"); 00126 add_messageinfo("SetMotorAngleMessage"); 00127 add_messageinfo("MoveMotorAngleMessage"); 00128 unsigned char tmp_hash[] = {0x63, 0x62, 0xb0, 0x97, 0x9, 0x8f, 0x58, 0x40, 0x61, 0xdc, 0x9a, 0xcc, 0xa, 0x97, 0xf8, 0xcd}; 00129 set_hash(tmp_hash); 00130 } 00131 00132 /** Destructor */ 00133 KatanaInterface::~KatanaInterface() 00134 { 00135 free(data_ptr); 00136 } 00137 /* Methods */ 00138 /** Get sensor_value value. 00139 * Sensor 00140 values. Use SENSOR_* indexes for accessing the values. 00141 * @return sensor_value value 00142 */ 00143 uint8_t * 00144 KatanaInterface::sensor_value() const 00145 { 00146 return data->sensor_value; 00147 } 00148 00149 /** Get sensor_value value at given index. 00150 * Sensor 00151 values. Use SENSOR_* indexes for accessing the values. 00152 * @param index index of value 00153 * @return sensor_value value 00154 * @exception Exception thrown if index is out of bounds 00155 */ 00156 uint8_t 00157 KatanaInterface::sensor_value(unsigned int index) const 00158 { 00159 if (index > 16) { 00160 throw Exception("Index value %u out of bounds (0..16)", index); 00161 } 00162 return data->sensor_value[index]; 00163 } 00164 00165 /** Get maximum length of sensor_value value. 00166 * @return length of sensor_value value, can be length of the array or number of 00167 * maximum number of characters for a string 00168 */ 00169 size_t 00170 KatanaInterface::maxlenof_sensor_value() const 00171 { 00172 return 16; 00173 } 00174 00175 /** Set sensor_value value. 00176 * Sensor 00177 values. Use SENSOR_* indexes for accessing the values. 00178 * @param new_sensor_value new sensor_value value 00179 */ 00180 void 00181 KatanaInterface::set_sensor_value(const uint8_t * new_sensor_value) 00182 { 00183 memcpy(data->sensor_value, new_sensor_value, sizeof(uint8_t) * 16); 00184 data_changed = true; 00185 } 00186 00187 /** Set sensor_value value at given index. 00188 * Sensor 00189 values. Use SENSOR_* indexes for accessing the values. 00190 * @param new_sensor_value new sensor_value value 00191 * @param index index for of the value 00192 */ 00193 void 00194 KatanaInterface::set_sensor_value(unsigned int index, const uint8_t new_sensor_value) 00195 { 00196 if (index > 16) { 00197 throw Exception("Index value %u out of bounds (0..16)", index); 00198 } 00199 data->sensor_value[index] = new_sensor_value; 00200 data_changed = true; 00201 } 00202 /** Get x value. 00203 * DEPRECATED! X-Coordinate for tool position 00204 compared to base coordinate system. 00205 * @return x value 00206 */ 00207 float 00208 KatanaInterface::x() const 00209 { 00210 return data->x; 00211 } 00212 00213 /** Get maximum length of x value. 00214 * @return length of x value, can be length of the array or number of 00215 * maximum number of characters for a string 00216 */ 00217 size_t 00218 KatanaInterface::maxlenof_x() const 00219 { 00220 return 1; 00221 } 00222 00223 /** Set x value. 00224 * DEPRECATED! X-Coordinate for tool position 00225 compared to base coordinate system. 00226 * @param new_x new x value 00227 */ 00228 void 00229 KatanaInterface::set_x(const float new_x) 00230 { 00231 data->x = new_x; 00232 data_changed = true; 00233 } 00234 00235 /** Get y value. 00236 * DEPRECATED! Y-Coordinate for tool position 00237 compared to base coordinate system. 00238 * @return y value 00239 */ 00240 float 00241 KatanaInterface::y() const 00242 { 00243 return data->y; 00244 } 00245 00246 /** Get maximum length of y value. 00247 * @return length of y value, can be length of the array or number of 00248 * maximum number of characters for a string 00249 */ 00250 size_t 00251 KatanaInterface::maxlenof_y() const 00252 { 00253 return 1; 00254 } 00255 00256 /** Set y value. 00257 * DEPRECATED! Y-Coordinate for tool position 00258 compared to base coordinate system. 00259 * @param new_y new y value 00260 */ 00261 void 00262 KatanaInterface::set_y(const float new_y) 00263 { 00264 data->y = new_y; 00265 data_changed = true; 00266 } 00267 00268 /** Get z value. 00269 * DEPRECATED! Z-Coordinate for tool position 00270 compared to base coordinate system. 00271 * @return z value 00272 */ 00273 float 00274 KatanaInterface::z() const 00275 { 00276 return data->z; 00277 } 00278 00279 /** Get maximum length of z value. 00280 * @return length of z value, can be length of the array or number of 00281 * maximum number of characters for a string 00282 */ 00283 size_t 00284 KatanaInterface::maxlenof_z() const 00285 { 00286 return 1; 00287 } 00288 00289 /** Set z value. 00290 * DEPRECATED! Z-Coordinate for tool position 00291 compared to base coordinate system. 00292 * @param new_z new z value 00293 */ 00294 void 00295 KatanaInterface::set_z(const float new_z) 00296 { 00297 data->z = new_z; 00298 data_changed = true; 00299 } 00300 00301 /** Get phi value. 00302 * DEPRECATED! Euler angle Phi of tool orientation. 00303 * @return phi value 00304 */ 00305 float 00306 KatanaInterface::phi() const 00307 { 00308 return data->phi; 00309 } 00310 00311 /** Get maximum length of phi value. 00312 * @return length of phi value, can be length of the array or number of 00313 * maximum number of characters for a string 00314 */ 00315 size_t 00316 KatanaInterface::maxlenof_phi() const 00317 { 00318 return 1; 00319 } 00320 00321 /** Set phi value. 00322 * DEPRECATED! Euler angle Phi of tool orientation. 00323 * @param new_phi new phi value 00324 */ 00325 void 00326 KatanaInterface::set_phi(const float new_phi) 00327 { 00328 data->phi = new_phi; 00329 data_changed = true; 00330 } 00331 00332 /** Get theta value. 00333 * DEPRECATED! Euler angle Theta of tool orientation. 00334 * @return theta value 00335 */ 00336 float 00337 KatanaInterface::theta() const 00338 { 00339 return data->theta; 00340 } 00341 00342 /** Get maximum length of theta value. 00343 * @return length of theta value, can be length of the array or number of 00344 * maximum number of characters for a string 00345 */ 00346 size_t 00347 KatanaInterface::maxlenof_theta() const 00348 { 00349 return 1; 00350 } 00351 00352 /** Set theta value. 00353 * DEPRECATED! Euler angle Theta of tool orientation. 00354 * @param new_theta new theta value 00355 */ 00356 void 00357 KatanaInterface::set_theta(const float new_theta) 00358 { 00359 data->theta = new_theta; 00360 data_changed = true; 00361 } 00362 00363 /** Get psi value. 00364 * DEPRECATED! Euler angle Psi of tool orientation. 00365 * @return psi value 00366 */ 00367 float 00368 KatanaInterface::psi() const 00369 { 00370 return data->psi; 00371 } 00372 00373 /** Get maximum length of psi value. 00374 * @return length of psi value, can be length of the array or number of 00375 * maximum number of characters for a string 00376 */ 00377 size_t 00378 KatanaInterface::maxlenof_psi() const 00379 { 00380 return 1; 00381 } 00382 00383 /** Set psi value. 00384 * DEPRECATED! Euler angle Psi of tool orientation. 00385 * @param new_psi new psi value 00386 */ 00387 void 00388 KatanaInterface::set_psi(const float new_psi) 00389 { 00390 data->psi = new_psi; 00391 data_changed = true; 00392 } 00393 00394 /** Get encoders value. 00395 * Encoder values of motors 00396 * @return encoders value 00397 */ 00398 int32_t * 00399 KatanaInterface::encoders() const 00400 { 00401 return data->encoders; 00402 } 00403 00404 /** Get encoders value at given index. 00405 * Encoder values of motors 00406 * @param index index of value 00407 * @return encoders value 00408 * @exception Exception thrown if index is out of bounds 00409 */ 00410 int32_t 00411 KatanaInterface::encoders(unsigned int index) const 00412 { 00413 if (index > 6) { 00414 throw Exception("Index value %u out of bounds (0..6)", index); 00415 } 00416 return data->encoders[index]; 00417 } 00418 00419 /** Get maximum length of encoders value. 00420 * @return length of encoders value, can be length of the array or number of 00421 * maximum number of characters for a string 00422 */ 00423 size_t 00424 KatanaInterface::maxlenof_encoders() const 00425 { 00426 return 6; 00427 } 00428 00429 /** Set encoders value. 00430 * Encoder values of motors 00431 * @param new_encoders new encoders value 00432 */ 00433 void 00434 KatanaInterface::set_encoders(const int32_t * new_encoders) 00435 { 00436 memcpy(data->encoders, new_encoders, sizeof(int32_t) * 6); 00437 data_changed = true; 00438 } 00439 00440 /** Set encoders value at given index. 00441 * Encoder values of motors 00442 * @param new_encoders new encoders value 00443 * @param index index for of the value 00444 */ 00445 void 00446 KatanaInterface::set_encoders(unsigned int index, const int32_t new_encoders) 00447 { 00448 if (index > 6) { 00449 throw Exception("Index value %u out of bounds (0..6)", index); 00450 } 00451 data->encoders[index] = new_encoders; 00452 data_changed = true; 00453 } 00454 /** Get angles value. 00455 * Angle values of motors 00456 * @return angles value 00457 */ 00458 float * 00459 KatanaInterface::angles() const 00460 { 00461 return data->angles; 00462 } 00463 00464 /** Get angles value at given index. 00465 * Angle values of motors 00466 * @param index index of value 00467 * @return angles value 00468 * @exception Exception thrown if index is out of bounds 00469 */ 00470 float 00471 KatanaInterface::angles(unsigned int index) const 00472 { 00473 if (index > 6) { 00474 throw Exception("Index value %u out of bounds (0..6)", index); 00475 } 00476 return data->angles[index]; 00477 } 00478 00479 /** Get maximum length of angles value. 00480 * @return length of angles value, can be length of the array or number of 00481 * maximum number of characters for a string 00482 */ 00483 size_t 00484 KatanaInterface::maxlenof_angles() const 00485 { 00486 return 6; 00487 } 00488 00489 /** Set angles value. 00490 * Angle values of motors 00491 * @param new_angles new angles value 00492 */ 00493 void 00494 KatanaInterface::set_angles(const float * new_angles) 00495 { 00496 memcpy(data->angles, new_angles, sizeof(float) * 6); 00497 data_changed = true; 00498 } 00499 00500 /** Set angles value at given index. 00501 * Angle values of motors 00502 * @param new_angles new angles value 00503 * @param index index for of the value 00504 */ 00505 void 00506 KatanaInterface::set_angles(unsigned int index, const float new_angles) 00507 { 00508 if (index > 6) { 00509 throw Exception("Index value %u out of bounds (0..6)", index); 00510 } 00511 data->angles[index] = new_angles; 00512 data_changed = true; 00513 } 00514 /** Get msgid value. 00515 * The ID of the message that is currently being 00516 processed, or 0 if no message is being processed. 00517 * @return msgid value 00518 */ 00519 uint32_t 00520 KatanaInterface::msgid() const 00521 { 00522 return data->msgid; 00523 } 00524 00525 /** Get maximum length of msgid value. 00526 * @return length of msgid value, can be length of the array or number of 00527 * maximum number of characters for a string 00528 */ 00529 size_t 00530 KatanaInterface::maxlenof_msgid() const 00531 { 00532 return 1; 00533 } 00534 00535 /** Set msgid value. 00536 * The ID of the message that is currently being 00537 processed, or 0 if no message is being processed. 00538 * @param new_msgid new msgid value 00539 */ 00540 void 00541 KatanaInterface::set_msgid(const uint32_t new_msgid) 00542 { 00543 data->msgid = new_msgid; 00544 data_changed = true; 00545 } 00546 00547 /** Get final value. 00548 * True, if the last goto command has been finished, 00549 false if it is still running 00550 * @return final value 00551 */ 00552 bool 00553 KatanaInterface::is_final() const 00554 { 00555 return data->final; 00556 } 00557 00558 /** Get maximum length of final value. 00559 * @return length of final value, can be length of the array or number of 00560 * maximum number of characters for a string 00561 */ 00562 size_t 00563 KatanaInterface::maxlenof_final() const 00564 { 00565 return 1; 00566 } 00567 00568 /** Set final value. 00569 * True, if the last goto command has been finished, 00570 false if it is still running 00571 * @param new_final new final value 00572 */ 00573 void 00574 KatanaInterface::set_final(const bool new_final) 00575 { 00576 data->final = new_final; 00577 data_changed = true; 00578 } 00579 00580 /** Get error_code value. 00581 * Failure code set if 00582 final is true. 0 if no error occured, an error code from ERROR_* 00583 constants otherwise (or a bit-wise combination). 00584 * @return error_code value 00585 */ 00586 uint32_t 00587 KatanaInterface::error_code() const 00588 { 00589 return data->error_code; 00590 } 00591 00592 /** Get maximum length of error_code value. 00593 * @return length of error_code value, can be length of the array or number of 00594 * maximum number of characters for a string 00595 */ 00596 size_t 00597 KatanaInterface::maxlenof_error_code() const 00598 { 00599 return 1; 00600 } 00601 00602 /** Set error_code value. 00603 * Failure code set if 00604 final is true. 0 if no error occured, an error code from ERROR_* 00605 constants otherwise (or a bit-wise combination). 00606 * @param new_error_code new error_code value 00607 */ 00608 void 00609 KatanaInterface::set_error_code(const uint32_t new_error_code) 00610 { 00611 data->error_code = new_error_code; 00612 data_changed = true; 00613 } 00614 00615 /** Get enabled value. 00616 * Are motors enabled? 00617 * @return enabled value 00618 */ 00619 bool 00620 KatanaInterface::is_enabled() const 00621 { 00622 return data->enabled; 00623 } 00624 00625 /** Get maximum length of enabled value. 00626 * @return length of enabled value, can be length of the array or number of 00627 * maximum number of characters for a string 00628 */ 00629 size_t 00630 KatanaInterface::maxlenof_enabled() const 00631 { 00632 return 1; 00633 } 00634 00635 /** Set enabled value. 00636 * Are motors enabled? 00637 * @param new_enabled new enabled value 00638 */ 00639 void 00640 KatanaInterface::set_enabled(const bool new_enabled) 00641 { 00642 data->enabled = new_enabled; 00643 data_changed = true; 00644 } 00645 00646 /** Get calibrated value. 00647 * Has arm been calibrated? 00648 * @return calibrated value 00649 */ 00650 bool 00651 KatanaInterface::is_calibrated() const 00652 { 00653 return data->calibrated; 00654 } 00655 00656 /** Get maximum length of calibrated value. 00657 * @return length of calibrated value, can be length of the array or number of 00658 * maximum number of characters for a string 00659 */ 00660 size_t 00661 KatanaInterface::maxlenof_calibrated() const 00662 { 00663 return 1; 00664 } 00665 00666 /** Set calibrated value. 00667 * Has arm been calibrated? 00668 * @param new_calibrated new calibrated value 00669 */ 00670 void 00671 KatanaInterface::set_calibrated(const bool new_calibrated) 00672 { 00673 data->calibrated = new_calibrated; 00674 data_changed = true; 00675 } 00676 00677 /** Get max_velocity value. 00678 * Maximum velocity 00679 * @return max_velocity value 00680 */ 00681 uint8_t 00682 KatanaInterface::max_velocity() const 00683 { 00684 return data->max_velocity; 00685 } 00686 00687 /** Get maximum length of max_velocity value. 00688 * @return length of max_velocity value, can be length of the array or number of 00689 * maximum number of characters for a string 00690 */ 00691 size_t 00692 KatanaInterface::maxlenof_max_velocity() const 00693 { 00694 return 1; 00695 } 00696 00697 /** Set max_velocity value. 00698 * Maximum velocity 00699 * @param new_max_velocity new max_velocity value 00700 */ 00701 void 00702 KatanaInterface::set_max_velocity(const uint8_t new_max_velocity) 00703 { 00704 data->max_velocity = new_max_velocity; 00705 data_changed = true; 00706 } 00707 00708 /** Get num_motors value. 00709 * Number of motors 00710 * @return num_motors value 00711 */ 00712 uint8_t 00713 KatanaInterface::num_motors() const 00714 { 00715 return data->num_motors; 00716 } 00717 00718 /** Get maximum length of num_motors value. 00719 * @return length of num_motors value, can be length of the array or number of 00720 * maximum number of characters for a string 00721 */ 00722 size_t 00723 KatanaInterface::maxlenof_num_motors() const 00724 { 00725 return 1; 00726 } 00727 00728 /** Set num_motors value. 00729 * Number of motors 00730 * @param new_num_motors new num_motors value 00731 */ 00732 void 00733 KatanaInterface::set_num_motors(const uint8_t new_num_motors) 00734 { 00735 data->num_motors = new_num_motors; 00736 data_changed = true; 00737 } 00738 00739 /* =========== message create =========== */ 00740 Message * 00741 KatanaInterface::create_message(const char *type) const 00742 { 00743 if ( strncmp("StopMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00744 return new StopMessage(); 00745 } else if ( strncmp("FlushMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00746 return new FlushMessage(); 00747 } else if ( strncmp("ParkMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00748 return new ParkMessage(); 00749 } else if ( strncmp("LinearGotoMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00750 return new LinearGotoMessage(); 00751 } else if ( strncmp("LinearGotoKniMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00752 return new LinearGotoKniMessage(); 00753 } else if ( strncmp("ObjectGotoMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00754 return new ObjectGotoMessage(); 00755 } else if ( strncmp("CalibrateMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00756 return new CalibrateMessage(); 00757 } else if ( strncmp("OpenGripperMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00758 return new OpenGripperMessage(); 00759 } else if ( strncmp("CloseGripperMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00760 return new CloseGripperMessage(); 00761 } else if ( strncmp("SetEnabledMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00762 return new SetEnabledMessage(); 00763 } else if ( strncmp("SetMaxVelocityMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00764 return new SetMaxVelocityMessage(); 00765 } else if ( strncmp("SetPlannerParamsMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00766 return new SetPlannerParamsMessage(); 00767 } else if ( strncmp("SetMotorEncoderMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00768 return new SetMotorEncoderMessage(); 00769 } else if ( strncmp("MoveMotorEncoderMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00770 return new MoveMotorEncoderMessage(); 00771 } else if ( strncmp("SetMotorAngleMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00772 return new SetMotorAngleMessage(); 00773 } else if ( strncmp("MoveMotorAngleMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00774 return new MoveMotorAngleMessage(); 00775 } else { 00776 throw UnknownTypeException("The given type '%s' does not match any known " 00777 "message type for this interface type.", type); 00778 } 00779 } 00780 00781 00782 /** Copy values from other interface. 00783 * @param other other interface to copy values from 00784 */ 00785 void 00786 KatanaInterface::copy_values(const Interface *other) 00787 { 00788 const KatanaInterface *oi = dynamic_cast<const KatanaInterface *>(other); 00789 if (oi == NULL) { 00790 throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)", 00791 type(), other->type()); 00792 } 00793 memcpy(data, oi->data, sizeof(KatanaInterface_data_t)); 00794 } 00795 00796 const char * 00797 KatanaInterface::enum_tostring(const char *enumtype, int val) const 00798 { 00799 throw UnknownTypeException("Unknown enum type %s", enumtype); 00800 } 00801 00802 /* =========== messages =========== */ 00803 /** @class KatanaInterface::StopMessage <interfaces/KatanaInterface.h> 00804 * StopMessage Fawkes BlackBoard Interface Message. 00805 * 00806 00807 */ 00808 00809 00810 /** Constructor */ 00811 KatanaInterface::StopMessage::StopMessage() : Message("StopMessage") 00812 { 00813 data_size = sizeof(StopMessage_data_t); 00814 data_ptr = malloc(data_size); 00815 memset(data_ptr, 0, data_size); 00816 data = (StopMessage_data_t *)data_ptr; 00817 data_ts = (message_data_ts_t *)data_ptr; 00818 } 00819 00820 /** Destructor */ 00821 KatanaInterface::StopMessage::~StopMessage() 00822 { 00823 free(data_ptr); 00824 } 00825 00826 /** Copy constructor. 00827 * @param m message to copy from 00828 */ 00829 KatanaInterface::StopMessage::StopMessage(const StopMessage *m) : Message("StopMessage") 00830 { 00831 data_size = m->data_size; 00832 data_ptr = malloc(data_size); 00833 memcpy(data_ptr, m->data_ptr, data_size); 00834 data = (StopMessage_data_t *)data_ptr; 00835 data_ts = (message_data_ts_t *)data_ptr; 00836 } 00837 00838 /* Methods */ 00839 /** Clone this message. 00840 * Produces a message of the same type as this message and copies the 00841 * data to the new message. 00842 * @return clone of this message 00843 */ 00844 Message * 00845 KatanaInterface::StopMessage::clone() const 00846 { 00847 return new KatanaInterface::StopMessage(this); 00848 } 00849 /** @class KatanaInterface::FlushMessage <interfaces/KatanaInterface.h> 00850 * FlushMessage Fawkes BlackBoard Interface Message. 00851 * 00852 00853 */ 00854 00855 00856 /** Constructor */ 00857 KatanaInterface::FlushMessage::FlushMessage() : Message("FlushMessage") 00858 { 00859 data_size = sizeof(FlushMessage_data_t); 00860 data_ptr = malloc(data_size); 00861 memset(data_ptr, 0, data_size); 00862 data = (FlushMessage_data_t *)data_ptr; 00863 data_ts = (message_data_ts_t *)data_ptr; 00864 } 00865 00866 /** Destructor */ 00867 KatanaInterface::FlushMessage::~FlushMessage() 00868 { 00869 free(data_ptr); 00870 } 00871 00872 /** Copy constructor. 00873 * @param m message to copy from 00874 */ 00875 KatanaInterface::FlushMessage::FlushMessage(const FlushMessage *m) : Message("FlushMessage") 00876 { 00877 data_size = m->data_size; 00878 data_ptr = malloc(data_size); 00879 memcpy(data_ptr, m->data_ptr, data_size); 00880 data = (FlushMessage_data_t *)data_ptr; 00881 data_ts = (message_data_ts_t *)data_ptr; 00882 } 00883 00884 /* Methods */ 00885 /** Clone this message. 00886 * Produces a message of the same type as this message and copies the 00887 * data to the new message. 00888 * @return clone of this message 00889 */ 00890 Message * 00891 KatanaInterface::FlushMessage::clone() const 00892 { 00893 return new KatanaInterface::FlushMessage(this); 00894 } 00895 /** @class KatanaInterface::ParkMessage <interfaces/KatanaInterface.h> 00896 * ParkMessage Fawkes BlackBoard Interface Message. 00897 * 00898 00899 */ 00900 00901 00902 /** Constructor */ 00903 KatanaInterface::ParkMessage::ParkMessage() : Message("ParkMessage") 00904 { 00905 data_size = sizeof(ParkMessage_data_t); 00906 data_ptr = malloc(data_size); 00907 memset(data_ptr, 0, data_size); 00908 data = (ParkMessage_data_t *)data_ptr; 00909 data_ts = (message_data_ts_t *)data_ptr; 00910 } 00911 00912 /** Destructor */ 00913 KatanaInterface::ParkMessage::~ParkMessage() 00914 { 00915 free(data_ptr); 00916 } 00917 00918 /** Copy constructor. 00919 * @param m message to copy from 00920 */ 00921 KatanaInterface::ParkMessage::ParkMessage(const ParkMessage *m) : Message("ParkMessage") 00922 { 00923 data_size = m->data_size; 00924 data_ptr = malloc(data_size); 00925 memcpy(data_ptr, m->data_ptr, data_size); 00926 data = (ParkMessage_data_t *)data_ptr; 00927 data_ts = (message_data_ts_t *)data_ptr; 00928 } 00929 00930 /* Methods */ 00931 /** Clone this message. 00932 * Produces a message of the same type as this message and copies the 00933 * data to the new message. 00934 * @return clone of this message 00935 */ 00936 Message * 00937 KatanaInterface::ParkMessage::clone() const 00938 { 00939 return new KatanaInterface::ParkMessage(this); 00940 } 00941 /** @class KatanaInterface::LinearGotoMessage <interfaces/KatanaInterface.h> 00942 * LinearGotoMessage Fawkes BlackBoard Interface Message. 00943 * 00944 00945 */ 00946 00947 00948 /** Constructor with initial values. 00949 * @param ini_theta_error initial value for theta_error 00950 * @param ini_offset_xy initial value for offset_xy 00951 * @param ini_straight initial value for straight 00952 * @param ini_trans_frame initial value for trans_frame 00953 * @param ini_rot_frame initial value for rot_frame 00954 * @param ini_x initial value for x 00955 * @param ini_y initial value for y 00956 * @param ini_z initial value for z 00957 * @param ini_phi initial value for phi 00958 * @param ini_theta initial value for theta 00959 * @param ini_psi initial value for psi 00960 */ 00961 KatanaInterface::LinearGotoMessage::LinearGotoMessage(const float ini_theta_error, const float ini_offset_xy, const bool ini_straight, const char * ini_trans_frame, const char * ini_rot_frame, const float ini_x, const float ini_y, const float ini_z, const float ini_phi, const float ini_theta, const float ini_psi) : Message("LinearGotoMessage") 00962 { 00963 data_size = sizeof(LinearGotoMessage_data_t); 00964 data_ptr = malloc(data_size); 00965 memset(data_ptr, 0, data_size); 00966 data = (LinearGotoMessage_data_t *)data_ptr; 00967 data_ts = (message_data_ts_t *)data_ptr; 00968 data->theta_error = ini_theta_error; 00969 data->offset_xy = ini_offset_xy; 00970 data->straight = ini_straight; 00971 strncpy(data->trans_frame, ini_trans_frame, 32); 00972 strncpy(data->rot_frame, ini_rot_frame, 32); 00973 data->x = ini_x; 00974 data->y = ini_y; 00975 data->z = ini_z; 00976 data->phi = ini_phi; 00977 data->theta = ini_theta; 00978 data->psi = ini_psi; 00979 add_fieldinfo(IFT_FLOAT, "theta_error", 1, &data->theta_error); 00980 add_fieldinfo(IFT_FLOAT, "offset_xy", 1, &data->offset_xy); 00981 add_fieldinfo(IFT_BOOL, "straight", 1, &data->straight); 00982 add_fieldinfo(IFT_STRING, "trans_frame", 32, data->trans_frame); 00983 add_fieldinfo(IFT_STRING, "rot_frame", 32, data->rot_frame); 00984 add_fieldinfo(IFT_FLOAT, "x", 1, &data->x); 00985 add_fieldinfo(IFT_FLOAT, "y", 1, &data->y); 00986 add_fieldinfo(IFT_FLOAT, "z", 1, &data->z); 00987 add_fieldinfo(IFT_FLOAT, "phi", 1, &data->phi); 00988 add_fieldinfo(IFT_FLOAT, "theta", 1, &data->theta); 00989 add_fieldinfo(IFT_FLOAT, "psi", 1, &data->psi); 00990 } 00991 /** Constructor */ 00992 KatanaInterface::LinearGotoMessage::LinearGotoMessage() : Message("LinearGotoMessage") 00993 { 00994 data_size = sizeof(LinearGotoMessage_data_t); 00995 data_ptr = malloc(data_size); 00996 memset(data_ptr, 0, data_size); 00997 data = (LinearGotoMessage_data_t *)data_ptr; 00998 data_ts = (message_data_ts_t *)data_ptr; 00999 add_fieldinfo(IFT_FLOAT, "theta_error", 1, &data->theta_error); 01000 add_fieldinfo(IFT_FLOAT, "offset_xy", 1, &data->offset_xy); 01001 add_fieldinfo(IFT_BOOL, "straight", 1, &data->straight); 01002 add_fieldinfo(IFT_STRING, "trans_frame", 32, data->trans_frame); 01003 add_fieldinfo(IFT_STRING, "rot_frame", 32, data->rot_frame); 01004 add_fieldinfo(IFT_FLOAT, "x", 1, &data->x); 01005 add_fieldinfo(IFT_FLOAT, "y", 1, &data->y); 01006 add_fieldinfo(IFT_FLOAT, "z", 1, &data->z); 01007 add_fieldinfo(IFT_FLOAT, "phi", 1, &data->phi); 01008 add_fieldinfo(IFT_FLOAT, "theta", 1, &data->theta); 01009 add_fieldinfo(IFT_FLOAT, "psi", 1, &data->psi); 01010 } 01011 01012 /** Destructor */ 01013 KatanaInterface::LinearGotoMessage::~LinearGotoMessage() 01014 { 01015 free(data_ptr); 01016 } 01017 01018 /** Copy constructor. 01019 * @param m message to copy from 01020 */ 01021 KatanaInterface::LinearGotoMessage::LinearGotoMessage(const LinearGotoMessage *m) : Message("LinearGotoMessage") 01022 { 01023 data_size = m->data_size; 01024 data_ptr = malloc(data_size); 01025 memcpy(data_ptr, m->data_ptr, data_size); 01026 data = (LinearGotoMessage_data_t *)data_ptr; 01027 data_ts = (message_data_ts_t *)data_ptr; 01028 } 01029 01030 /* Methods */ 01031 /** Get theta_error value. 01032 * Error range of theta rotation, gives more flexibility 01033 for IK-solution searching. 01034 * @return theta_error value 01035 */ 01036 float 01037 KatanaInterface::LinearGotoMessage::theta_error() const 01038 { 01039 return data->theta_error; 01040 } 01041 01042 /** Get maximum length of theta_error value. 01043 * @return length of theta_error value, can be length of the array or number of 01044 * maximum number of characters for a string 01045 */ 01046 size_t 01047 KatanaInterface::LinearGotoMessage::maxlenof_theta_error() const 01048 { 01049 return 1; 01050 } 01051 01052 /** Set theta_error value. 01053 * Error range of theta rotation, gives more flexibility 01054 for IK-solution searching. 01055 * @param new_theta_error new theta_error value 01056 */ 01057 void 01058 KatanaInterface::LinearGotoMessage::set_theta_error(const float new_theta_error) 01059 { 01060 data->theta_error = new_theta_error; 01061 } 01062 01063 /** Get offset_xy value. 01064 * Offset to target. Distance in m (on the way to the target) 01065 * @return offset_xy value 01066 */ 01067 float 01068 KatanaInterface::LinearGotoMessage::offset_xy() const 01069 { 01070 return data->offset_xy; 01071 } 01072 01073 /** Get maximum length of offset_xy value. 01074 * @return length of offset_xy value, can be length of the array or number of 01075 * maximum number of characters for a string 01076 */ 01077 size_t 01078 KatanaInterface::LinearGotoMessage::maxlenof_offset_xy() const 01079 { 01080 return 1; 01081 } 01082 01083 /** Set offset_xy value. 01084 * Offset to target. Distance in m (on the way to the target) 01085 * @param new_offset_xy new offset_xy value 01086 */ 01087 void 01088 KatanaInterface::LinearGotoMessage::set_offset_xy(const float new_offset_xy) 01089 { 01090 data->offset_xy = new_offset_xy; 01091 } 01092 01093 /** Get straight value. 01094 * Move in a straight line? 01095 * @return straight value 01096 */ 01097 bool 01098 KatanaInterface::LinearGotoMessage::is_straight() const 01099 { 01100 return data->straight; 01101 } 01102 01103 /** Get maximum length of straight value. 01104 * @return length of straight value, can be length of the array or number of 01105 * maximum number of characters for a string 01106 */ 01107 size_t 01108 KatanaInterface::LinearGotoMessage::maxlenof_straight() const 01109 { 01110 return 1; 01111 } 01112 01113 /** Set straight value. 01114 * Move in a straight line? 01115 * @param new_straight new straight value 01116 */ 01117 void 01118 KatanaInterface::LinearGotoMessage::set_straight(const bool new_straight) 01119 { 01120 data->straight = new_straight; 01121 } 01122 01123 /** Get trans_frame value. 01124 * tf frame-id of origin's coordinate system, 01125 regarding the translation 01126 * @return trans_frame value 01127 */ 01128 char * 01129 KatanaInterface::LinearGotoMessage::trans_frame() const 01130 { 01131 return data->trans_frame; 01132 } 01133 01134 /** Get maximum length of trans_frame value. 01135 * @return length of trans_frame value, can be length of the array or number of 01136 * maximum number of characters for a string 01137 */ 01138 size_t 01139 KatanaInterface::LinearGotoMessage::maxlenof_trans_frame() const 01140 { 01141 return 32; 01142 } 01143 01144 /** Set trans_frame value. 01145 * tf frame-id of origin's coordinate system, 01146 regarding the translation 01147 * @param new_trans_frame new trans_frame value 01148 */ 01149 void 01150 KatanaInterface::LinearGotoMessage::set_trans_frame(const char * new_trans_frame) 01151 { 01152 strncpy(data->trans_frame, new_trans_frame, sizeof(data->trans_frame)); 01153 } 01154 01155 /** Get rot_frame value. 01156 * tf frame-id of origin's coordinate system, 01157 regarding the rotation. In most cases, this is the robot's base coordinate system. 01158 * @return rot_frame value 01159 */ 01160 char * 01161 KatanaInterface::LinearGotoMessage::rot_frame() const 01162 { 01163 return data->rot_frame; 01164 } 01165 01166 /** Get maximum length of rot_frame value. 01167 * @return length of rot_frame value, can be length of the array or number of 01168 * maximum number of characters for a string 01169 */ 01170 size_t 01171 KatanaInterface::LinearGotoMessage::maxlenof_rot_frame() const 01172 { 01173 return 32; 01174 } 01175 01176 /** Set rot_frame value. 01177 * tf frame-id of origin's coordinate system, 01178 regarding the rotation. In most cases, this is the robot's base coordinate system. 01179 * @param new_rot_frame new rot_frame value 01180 */ 01181 void 01182 KatanaInterface::LinearGotoMessage::set_rot_frame(const char * new_rot_frame) 01183 { 01184 strncpy(data->rot_frame, new_rot_frame, sizeof(data->rot_frame)); 01185 } 01186 01187 /** Get x value. 01188 * DEPRECATED! X-Coordinate for tool position 01189 compared to base coordinate system. 01190 * @return x value 01191 */ 01192 float 01193 KatanaInterface::LinearGotoMessage::x() const 01194 { 01195 return data->x; 01196 } 01197 01198 /** Get maximum length of x value. 01199 * @return length of x value, can be length of the array or number of 01200 * maximum number of characters for a string 01201 */ 01202 size_t 01203 KatanaInterface::LinearGotoMessage::maxlenof_x() const 01204 { 01205 return 1; 01206 } 01207 01208 /** Set x value. 01209 * DEPRECATED! X-Coordinate for tool position 01210 compared to base coordinate system. 01211 * @param new_x new x value 01212 */ 01213 void 01214 KatanaInterface::LinearGotoMessage::set_x(const float new_x) 01215 { 01216 data->x = new_x; 01217 } 01218 01219 /** Get y value. 01220 * DEPRECATED! Y-Coordinate for tool position 01221 compared to base coordinate system. 01222 * @return y value 01223 */ 01224 float 01225 KatanaInterface::LinearGotoMessage::y() const 01226 { 01227 return data->y; 01228 } 01229 01230 /** Get maximum length of y value. 01231 * @return length of y value, can be length of the array or number of 01232 * maximum number of characters for a string 01233 */ 01234 size_t 01235 KatanaInterface::LinearGotoMessage::maxlenof_y() const 01236 { 01237 return 1; 01238 } 01239 01240 /** Set y value. 01241 * DEPRECATED! Y-Coordinate for tool position 01242 compared to base coordinate system. 01243 * @param new_y new y value 01244 */ 01245 void 01246 KatanaInterface::LinearGotoMessage::set_y(const float new_y) 01247 { 01248 data->y = new_y; 01249 } 01250 01251 /** Get z value. 01252 * DEPRECATED! Z-Coordinate for tool position 01253 compared to base coordinate system. 01254 * @return z value 01255 */ 01256 float 01257 KatanaInterface::LinearGotoMessage::z() const 01258 { 01259 return data->z; 01260 } 01261 01262 /** Get maximum length of z value. 01263 * @return length of z value, can be length of the array or number of 01264 * maximum number of characters for a string 01265 */ 01266 size_t 01267 KatanaInterface::LinearGotoMessage::maxlenof_z() const 01268 { 01269 return 1; 01270 } 01271 01272 /** Set z value. 01273 * DEPRECATED! Z-Coordinate for tool position 01274 compared to base coordinate system. 01275 * @param new_z new z value 01276 */ 01277 void 01278 KatanaInterface::LinearGotoMessage::set_z(const float new_z) 01279 { 01280 data->z = new_z; 01281 } 01282 01283 /** Get phi value. 01284 * DEPRECATED! Euler angle Phi of tool orientation. 01285 * @return phi value 01286 */ 01287 float 01288 KatanaInterface::LinearGotoMessage::phi() const 01289 { 01290 return data->phi; 01291 } 01292 01293 /** Get maximum length of phi value. 01294 * @return length of phi value, can be length of the array or number of 01295 * maximum number of characters for a string 01296 */ 01297 size_t 01298 KatanaInterface::LinearGotoMessage::maxlenof_phi() const 01299 { 01300 return 1; 01301 } 01302 01303 /** Set phi value. 01304 * DEPRECATED! Euler angle Phi of tool orientation. 01305 * @param new_phi new phi value 01306 */ 01307 void 01308 KatanaInterface::LinearGotoMessage::set_phi(const float new_phi) 01309 { 01310 data->phi = new_phi; 01311 } 01312 01313 /** Get theta value. 01314 * DEPRECATED! Euler angle Theta of tool orientation. 01315 * @return theta value 01316 */ 01317 float 01318 KatanaInterface::LinearGotoMessage::theta() const 01319 { 01320 return data->theta; 01321 } 01322 01323 /** Get maximum length of theta value. 01324 * @return length of theta value, can be length of the array or number of 01325 * maximum number of characters for a string 01326 */ 01327 size_t 01328 KatanaInterface::LinearGotoMessage::maxlenof_theta() const 01329 { 01330 return 1; 01331 } 01332 01333 /** Set theta value. 01334 * DEPRECATED! Euler angle Theta of tool orientation. 01335 * @param new_theta new theta value 01336 */ 01337 void 01338 KatanaInterface::LinearGotoMessage::set_theta(const float new_theta) 01339 { 01340 data->theta = new_theta; 01341 } 01342 01343 /** Get psi value. 01344 * DEPRECATED! Euler angle Psi of tool orientation. 01345 * @return psi value 01346 */ 01347 float 01348 KatanaInterface::LinearGotoMessage::psi() const 01349 { 01350 return data->psi; 01351 } 01352 01353 /** Get maximum length of psi value. 01354 * @return length of psi value, can be length of the array or number of 01355 * maximum number of characters for a string 01356 */ 01357 size_t 01358 KatanaInterface::LinearGotoMessage::maxlenof_psi() const 01359 { 01360 return 1; 01361 } 01362 01363 /** Set psi value. 01364 * DEPRECATED! Euler angle Psi of tool orientation. 01365 * @param new_psi new psi value 01366 */ 01367 void 01368 KatanaInterface::LinearGotoMessage::set_psi(const float new_psi) 01369 { 01370 data->psi = new_psi; 01371 } 01372 01373 /** Clone this message. 01374 * Produces a message of the same type as this message and copies the 01375 * data to the new message. 01376 * @return clone of this message 01377 */ 01378 Message * 01379 KatanaInterface::LinearGotoMessage::clone() const 01380 { 01381 return new KatanaInterface::LinearGotoMessage(this); 01382 } 01383 /** @class KatanaInterface::LinearGotoKniMessage <interfaces/KatanaInterface.h> 01384 * LinearGotoKniMessage Fawkes BlackBoard Interface Message. 01385 * 01386 01387 */ 01388 01389 01390 /** Constructor with initial values. 01391 * @param ini_x initial value for x 01392 * @param ini_y initial value for y 01393 * @param ini_z initial value for z 01394 * @param ini_phi initial value for phi 01395 * @param ini_theta initial value for theta 01396 * @param ini_psi initial value for psi 01397 */ 01398 KatanaInterface::LinearGotoKniMessage::LinearGotoKniMessage(const float ini_x, const float ini_y, const float ini_z, const float ini_phi, const float ini_theta, const float ini_psi) : Message("LinearGotoKniMessage") 01399 { 01400 data_size = sizeof(LinearGotoKniMessage_data_t); 01401 data_ptr = malloc(data_size); 01402 memset(data_ptr, 0, data_size); 01403 data = (LinearGotoKniMessage_data_t *)data_ptr; 01404 data_ts = (message_data_ts_t *)data_ptr; 01405 data->x = ini_x; 01406 data->y = ini_y; 01407 data->z = ini_z; 01408 data->phi = ini_phi; 01409 data->theta = ini_theta; 01410 data->psi = ini_psi; 01411 add_fieldinfo(IFT_FLOAT, "x", 1, &data->x); 01412 add_fieldinfo(IFT_FLOAT, "y", 1, &data->y); 01413 add_fieldinfo(IFT_FLOAT, "z", 1, &data->z); 01414 add_fieldinfo(IFT_FLOAT, "phi", 1, &data->phi); 01415 add_fieldinfo(IFT_FLOAT, "theta", 1, &data->theta); 01416 add_fieldinfo(IFT_FLOAT, "psi", 1, &data->psi); 01417 } 01418 /** Constructor */ 01419 KatanaInterface::LinearGotoKniMessage::LinearGotoKniMessage() : Message("LinearGotoKniMessage") 01420 { 01421 data_size = sizeof(LinearGotoKniMessage_data_t); 01422 data_ptr = malloc(data_size); 01423 memset(data_ptr, 0, data_size); 01424 data = (LinearGotoKniMessage_data_t *)data_ptr; 01425 data_ts = (message_data_ts_t *)data_ptr; 01426 add_fieldinfo(IFT_FLOAT, "x", 1, &data->x); 01427 add_fieldinfo(IFT_FLOAT, "y", 1, &data->y); 01428 add_fieldinfo(IFT_FLOAT, "z", 1, &data->z); 01429 add_fieldinfo(IFT_FLOAT, "phi", 1, &data->phi); 01430 add_fieldinfo(IFT_FLOAT, "theta", 1, &data->theta); 01431 add_fieldinfo(IFT_FLOAT, "psi", 1, &data->psi); 01432 } 01433 01434 /** Destructor */ 01435 KatanaInterface::LinearGotoKniMessage::~LinearGotoKniMessage() 01436 { 01437 free(data_ptr); 01438 } 01439 01440 /** Copy constructor. 01441 * @param m message to copy from 01442 */ 01443 KatanaInterface::LinearGotoKniMessage::LinearGotoKniMessage(const LinearGotoKniMessage *m) : Message("LinearGotoKniMessage") 01444 { 01445 data_size = m->data_size; 01446 data_ptr = malloc(data_size); 01447 memcpy(data_ptr, m->data_ptr, data_size); 01448 data = (LinearGotoKniMessage_data_t *)data_ptr; 01449 data_ts = (message_data_ts_t *)data_ptr; 01450 } 01451 01452 /* Methods */ 01453 /** Get x value. 01454 * X-Coordinate for tool position 01455 compared to base libkni coordinate system. 01456 * @return x value 01457 */ 01458 float 01459 KatanaInterface::LinearGotoKniMessage::x() const 01460 { 01461 return data->x; 01462 } 01463 01464 /** Get maximum length of x value. 01465 * @return length of x value, can be length of the array or number of 01466 * maximum number of characters for a string 01467 */ 01468 size_t 01469 KatanaInterface::LinearGotoKniMessage::maxlenof_x() const 01470 { 01471 return 1; 01472 } 01473 01474 /** Set x value. 01475 * X-Coordinate for tool position 01476 compared to base libkni coordinate system. 01477 * @param new_x new x value 01478 */ 01479 void 01480 KatanaInterface::LinearGotoKniMessage::set_x(const float new_x) 01481 { 01482 data->x = new_x; 01483 } 01484 01485 /** Get y value. 01486 * Y-Coordinate for tool position 01487 compared to base libkni coordinate system. 01488 * @return y value 01489 */ 01490 float 01491 KatanaInterface::LinearGotoKniMessage::y() const 01492 { 01493 return data->y; 01494 } 01495 01496 /** Get maximum length of y value. 01497 * @return length of y value, can be length of the array or number of 01498 * maximum number of characters for a string 01499 */ 01500 size_t 01501 KatanaInterface::LinearGotoKniMessage::maxlenof_y() const 01502 { 01503 return 1; 01504 } 01505 01506 /** Set y value. 01507 * Y-Coordinate for tool position 01508 compared to base libkni coordinate system. 01509 * @param new_y new y value 01510 */ 01511 void 01512 KatanaInterface::LinearGotoKniMessage::set_y(const float new_y) 01513 { 01514 data->y = new_y; 01515 } 01516 01517 /** Get z value. 01518 * Z-Coordinate for tool position 01519 compared to base libkni coordinate system. 01520 * @return z value 01521 */ 01522 float 01523 KatanaInterface::LinearGotoKniMessage::z() const 01524 { 01525 return data->z; 01526 } 01527 01528 /** Get maximum length of z value. 01529 * @return length of z value, can be length of the array or number of 01530 * maximum number of characters for a string 01531 */ 01532 size_t 01533 KatanaInterface::LinearGotoKniMessage::maxlenof_z() const 01534 { 01535 return 1; 01536 } 01537 01538 /** Set z value. 01539 * Z-Coordinate for tool position 01540 compared to base libkni coordinate system. 01541 * @param new_z new z value 01542 */ 01543 void 01544 KatanaInterface::LinearGotoKniMessage::set_z(const float new_z) 01545 { 01546 data->z = new_z; 01547 } 01548 01549 /** Get phi value. 01550 * Euler angle Phi of tool orientation. 01551 * @return phi value 01552 */ 01553 float 01554 KatanaInterface::LinearGotoKniMessage::phi() const 01555 { 01556 return data->phi; 01557 } 01558 01559 /** Get maximum length of phi value. 01560 * @return length of phi value, can be length of the array or number of 01561 * maximum number of characters for a string 01562 */ 01563 size_t 01564 KatanaInterface::LinearGotoKniMessage::maxlenof_phi() const 01565 { 01566 return 1; 01567 } 01568 01569 /** Set phi value. 01570 * Euler angle Phi of tool orientation. 01571 * @param new_phi new phi value 01572 */ 01573 void 01574 KatanaInterface::LinearGotoKniMessage::set_phi(const float new_phi) 01575 { 01576 data->phi = new_phi; 01577 } 01578 01579 /** Get theta value. 01580 * Euler angle Theta of tool orientation. 01581 * @return theta value 01582 */ 01583 float 01584 KatanaInterface::LinearGotoKniMessage::theta() const 01585 { 01586 return data->theta; 01587 } 01588 01589 /** Get maximum length of theta value. 01590 * @return length of theta value, can be length of the array or number of 01591 * maximum number of characters for a string 01592 */ 01593 size_t 01594 KatanaInterface::LinearGotoKniMessage::maxlenof_theta() const 01595 { 01596 return 1; 01597 } 01598 01599 /** Set theta value. 01600 * Euler angle Theta of tool orientation. 01601 * @param new_theta new theta value 01602 */ 01603 void 01604 KatanaInterface::LinearGotoKniMessage::set_theta(const float new_theta) 01605 { 01606 data->theta = new_theta; 01607 } 01608 01609 /** Get psi value. 01610 * Euler angle Psi of tool orientation. 01611 * @return psi value 01612 */ 01613 float 01614 KatanaInterface::LinearGotoKniMessage::psi() const 01615 { 01616 return data->psi; 01617 } 01618 01619 /** Get maximum length of psi value. 01620 * @return length of psi value, can be length of the array or number of 01621 * maximum number of characters for a string 01622 */ 01623 size_t 01624 KatanaInterface::LinearGotoKniMessage::maxlenof_psi() const 01625 { 01626 return 1; 01627 } 01628 01629 /** Set psi value. 01630 * Euler angle Psi of tool orientation. 01631 * @param new_psi new psi value 01632 */ 01633 void 01634 KatanaInterface::LinearGotoKniMessage::set_psi(const float new_psi) 01635 { 01636 data->psi = new_psi; 01637 } 01638 01639 /** Clone this message. 01640 * Produces a message of the same type as this message and copies the 01641 * data to the new message. 01642 * @return clone of this message 01643 */ 01644 Message * 01645 KatanaInterface::LinearGotoKniMessage::clone() const 01646 { 01647 return new KatanaInterface::LinearGotoKniMessage(this); 01648 } 01649 /** @class KatanaInterface::ObjectGotoMessage <interfaces/KatanaInterface.h> 01650 * ObjectGotoMessage Fawkes BlackBoard Interface Message. 01651 * 01652 01653 */ 01654 01655 01656 /** Constructor with initial values. 01657 * @param ini_object initial value for object 01658 * @param ini_rot_x initial value for rot_x 01659 */ 01660 KatanaInterface::ObjectGotoMessage::ObjectGotoMessage(const char * ini_object, const float ini_rot_x) : Message("ObjectGotoMessage") 01661 { 01662 data_size = sizeof(ObjectGotoMessage_data_t); 01663 data_ptr = malloc(data_size); 01664 memset(data_ptr, 0, data_size); 01665 data = (ObjectGotoMessage_data_t *)data_ptr; 01666 data_ts = (message_data_ts_t *)data_ptr; 01667 strncpy(data->object, ini_object, 32); 01668 data->rot_x = ini_rot_x; 01669 add_fieldinfo(IFT_STRING, "object", 32, data->object); 01670 add_fieldinfo(IFT_FLOAT, "rot_x", 1, &data->rot_x); 01671 } 01672 /** Constructor */ 01673 KatanaInterface::ObjectGotoMessage::ObjectGotoMessage() : Message("ObjectGotoMessage") 01674 { 01675 data_size = sizeof(ObjectGotoMessage_data_t); 01676 data_ptr = malloc(data_size); 01677 memset(data_ptr, 0, data_size); 01678 data = (ObjectGotoMessage_data_t *)data_ptr; 01679 data_ts = (message_data_ts_t *)data_ptr; 01680 add_fieldinfo(IFT_STRING, "object", 32, data->object); 01681 add_fieldinfo(IFT_FLOAT, "rot_x", 1, &data->rot_x); 01682 } 01683 01684 /** Destructor */ 01685 KatanaInterface::ObjectGotoMessage::~ObjectGotoMessage() 01686 { 01687 free(data_ptr); 01688 } 01689 01690 /** Copy constructor. 01691 * @param m message to copy from 01692 */ 01693 KatanaInterface::ObjectGotoMessage::ObjectGotoMessage(const ObjectGotoMessage *m) : Message("ObjectGotoMessage") 01694 { 01695 data_size = m->data_size; 01696 data_ptr = malloc(data_size); 01697 memcpy(data_ptr, m->data_ptr, data_size); 01698 data = (ObjectGotoMessage_data_t *)data_ptr; 01699 data_ts = (message_data_ts_t *)data_ptr; 01700 } 01701 01702 /* Methods */ 01703 /** Get object value. 01704 * Name of object 01705 * @return object value 01706 */ 01707 char * 01708 KatanaInterface::ObjectGotoMessage::object() const 01709 { 01710 return data->object; 01711 } 01712 01713 /** Get maximum length of object value. 01714 * @return length of object value, can be length of the array or number of 01715 * maximum number of characters for a string 01716 */ 01717 size_t 01718 KatanaInterface::ObjectGotoMessage::maxlenof_object() const 01719 { 01720 return 32; 01721 } 01722 01723 /** Set object value. 01724 * Name of object 01725 * @param new_object new object value 01726 */ 01727 void 01728 KatanaInterface::ObjectGotoMessage::set_object(const char * new_object) 01729 { 01730 strncpy(data->object, new_object, sizeof(data->object)); 01731 } 01732 01733 /** Get rot_x value. 01734 * Rotation of object on its x-axis 01735 * @return rot_x value 01736 */ 01737 float 01738 KatanaInterface::ObjectGotoMessage::rot_x() const 01739 { 01740 return data->rot_x; 01741 } 01742 01743 /** Get maximum length of rot_x value. 01744 * @return length of rot_x value, can be length of the array or number of 01745 * maximum number of characters for a string 01746 */ 01747 size_t 01748 KatanaInterface::ObjectGotoMessage::maxlenof_rot_x() const 01749 { 01750 return 1; 01751 } 01752 01753 /** Set rot_x value. 01754 * Rotation of object on its x-axis 01755 * @param new_rot_x new rot_x value 01756 */ 01757 void 01758 KatanaInterface::ObjectGotoMessage::set_rot_x(const float new_rot_x) 01759 { 01760 data->rot_x = new_rot_x; 01761 } 01762 01763 /** Clone this message. 01764 * Produces a message of the same type as this message and copies the 01765 * data to the new message. 01766 * @return clone of this message 01767 */ 01768 Message * 01769 KatanaInterface::ObjectGotoMessage::clone() const 01770 { 01771 return new KatanaInterface::ObjectGotoMessage(this); 01772 } 01773 /** @class KatanaInterface::CalibrateMessage <interfaces/KatanaInterface.h> 01774 * CalibrateMessage Fawkes BlackBoard Interface Message. 01775 * 01776 01777 */ 01778 01779 01780 /** Constructor */ 01781 KatanaInterface::CalibrateMessage::CalibrateMessage() : Message("CalibrateMessage") 01782 { 01783 data_size = sizeof(CalibrateMessage_data_t); 01784 data_ptr = malloc(data_size); 01785 memset(data_ptr, 0, data_size); 01786 data = (CalibrateMessage_data_t *)data_ptr; 01787 data_ts = (message_data_ts_t *)data_ptr; 01788 } 01789 01790 /** Destructor */ 01791 KatanaInterface::CalibrateMessage::~CalibrateMessage() 01792 { 01793 free(data_ptr); 01794 } 01795 01796 /** Copy constructor. 01797 * @param m message to copy from 01798 */ 01799 KatanaInterface::CalibrateMessage::CalibrateMessage(const CalibrateMessage *m) : Message("CalibrateMessage") 01800 { 01801 data_size = m->data_size; 01802 data_ptr = malloc(data_size); 01803 memcpy(data_ptr, m->data_ptr, data_size); 01804 data = (CalibrateMessage_data_t *)data_ptr; 01805 data_ts = (message_data_ts_t *)data_ptr; 01806 } 01807 01808 /* Methods */ 01809 /** Clone this message. 01810 * Produces a message of the same type as this message and copies the 01811 * data to the new message. 01812 * @return clone of this message 01813 */ 01814 Message * 01815 KatanaInterface::CalibrateMessage::clone() const 01816 { 01817 return new KatanaInterface::CalibrateMessage(this); 01818 } 01819 /** @class KatanaInterface::OpenGripperMessage <interfaces/KatanaInterface.h> 01820 * OpenGripperMessage Fawkes BlackBoard Interface Message. 01821 * 01822 01823 */ 01824 01825 01826 /** Constructor */ 01827 KatanaInterface::OpenGripperMessage::OpenGripperMessage() : Message("OpenGripperMessage") 01828 { 01829 data_size = sizeof(OpenGripperMessage_data_t); 01830 data_ptr = malloc(data_size); 01831 memset(data_ptr, 0, data_size); 01832 data = (OpenGripperMessage_data_t *)data_ptr; 01833 data_ts = (message_data_ts_t *)data_ptr; 01834 } 01835 01836 /** Destructor */ 01837 KatanaInterface::OpenGripperMessage::~OpenGripperMessage() 01838 { 01839 free(data_ptr); 01840 } 01841 01842 /** Copy constructor. 01843 * @param m message to copy from 01844 */ 01845 KatanaInterface::OpenGripperMessage::OpenGripperMessage(const OpenGripperMessage *m) : Message("OpenGripperMessage") 01846 { 01847 data_size = m->data_size; 01848 data_ptr = malloc(data_size); 01849 memcpy(data_ptr, m->data_ptr, data_size); 01850 data = (OpenGripperMessage_data_t *)data_ptr; 01851 data_ts = (message_data_ts_t *)data_ptr; 01852 } 01853 01854 /* Methods */ 01855 /** Clone this message. 01856 * Produces a message of the same type as this message and copies the 01857 * data to the new message. 01858 * @return clone of this message 01859 */ 01860 Message * 01861 KatanaInterface::OpenGripperMessage::clone() const 01862 { 01863 return new KatanaInterface::OpenGripperMessage(this); 01864 } 01865 /** @class KatanaInterface::CloseGripperMessage <interfaces/KatanaInterface.h> 01866 * CloseGripperMessage Fawkes BlackBoard Interface Message. 01867 * 01868 01869 */ 01870 01871 01872 /** Constructor */ 01873 KatanaInterface::CloseGripperMessage::CloseGripperMessage() : Message("CloseGripperMessage") 01874 { 01875 data_size = sizeof(CloseGripperMessage_data_t); 01876 data_ptr = malloc(data_size); 01877 memset(data_ptr, 0, data_size); 01878 data = (CloseGripperMessage_data_t *)data_ptr; 01879 data_ts = (message_data_ts_t *)data_ptr; 01880 } 01881 01882 /** Destructor */ 01883 KatanaInterface::CloseGripperMessage::~CloseGripperMessage() 01884 { 01885 free(data_ptr); 01886 } 01887 01888 /** Copy constructor. 01889 * @param m message to copy from 01890 */ 01891 KatanaInterface::CloseGripperMessage::CloseGripperMessage(const CloseGripperMessage *m) : Message("CloseGripperMessage") 01892 { 01893 data_size = m->data_size; 01894 data_ptr = malloc(data_size); 01895 memcpy(data_ptr, m->data_ptr, data_size); 01896 data = (CloseGripperMessage_data_t *)data_ptr; 01897 data_ts = (message_data_ts_t *)data_ptr; 01898 } 01899 01900 /* Methods */ 01901 /** Clone this message. 01902 * Produces a message of the same type as this message and copies the 01903 * data to the new message. 01904 * @return clone of this message 01905 */ 01906 Message * 01907 KatanaInterface::CloseGripperMessage::clone() const 01908 { 01909 return new KatanaInterface::CloseGripperMessage(this); 01910 } 01911 /** @class KatanaInterface::SetEnabledMessage <interfaces/KatanaInterface.h> 01912 * SetEnabledMessage Fawkes BlackBoard Interface Message. 01913 * 01914 01915 */ 01916 01917 01918 /** Constructor with initial values. 01919 * @param ini_enabled initial value for enabled 01920 */ 01921 KatanaInterface::SetEnabledMessage::SetEnabledMessage(const bool ini_enabled) : Message("SetEnabledMessage") 01922 { 01923 data_size = sizeof(SetEnabledMessage_data_t); 01924 data_ptr = malloc(data_size); 01925 memset(data_ptr, 0, data_size); 01926 data = (SetEnabledMessage_data_t *)data_ptr; 01927 data_ts = (message_data_ts_t *)data_ptr; 01928 data->enabled = ini_enabled; 01929 add_fieldinfo(IFT_BOOL, "enabled", 1, &data->enabled); 01930 } 01931 /** Constructor */ 01932 KatanaInterface::SetEnabledMessage::SetEnabledMessage() : Message("SetEnabledMessage") 01933 { 01934 data_size = sizeof(SetEnabledMessage_data_t); 01935 data_ptr = malloc(data_size); 01936 memset(data_ptr, 0, data_size); 01937 data = (SetEnabledMessage_data_t *)data_ptr; 01938 data_ts = (message_data_ts_t *)data_ptr; 01939 add_fieldinfo(IFT_BOOL, "enabled", 1, &data->enabled); 01940 } 01941 01942 /** Destructor */ 01943 KatanaInterface::SetEnabledMessage::~SetEnabledMessage() 01944 { 01945 free(data_ptr); 01946 } 01947 01948 /** Copy constructor. 01949 * @param m message to copy from 01950 */ 01951 KatanaInterface::SetEnabledMessage::SetEnabledMessage(const SetEnabledMessage *m) : Message("SetEnabledMessage") 01952 { 01953 data_size = m->data_size; 01954 data_ptr = malloc(data_size); 01955 memcpy(data_ptr, m->data_ptr, data_size); 01956 data = (SetEnabledMessage_data_t *)data_ptr; 01957 data_ts = (message_data_ts_t *)data_ptr; 01958 } 01959 01960 /* Methods */ 01961 /** Get enabled value. 01962 * Are motors enabled? 01963 * @return enabled value 01964 */ 01965 bool 01966 KatanaInterface::SetEnabledMessage::is_enabled() const 01967 { 01968 return data->enabled; 01969 } 01970 01971 /** Get maximum length of enabled value. 01972 * @return length of enabled value, can be length of the array or number of 01973 * maximum number of characters for a string 01974 */ 01975 size_t 01976 KatanaInterface::SetEnabledMessage::maxlenof_enabled() const 01977 { 01978 return 1; 01979 } 01980 01981 /** Set enabled value. 01982 * Are motors enabled? 01983 * @param new_enabled new enabled value 01984 */ 01985 void 01986 KatanaInterface::SetEnabledMessage::set_enabled(const bool new_enabled) 01987 { 01988 data->enabled = new_enabled; 01989 } 01990 01991 /** Clone this message. 01992 * Produces a message of the same type as this message and copies the 01993 * data to the new message. 01994 * @return clone of this message 01995 */ 01996 Message * 01997 KatanaInterface::SetEnabledMessage::clone() const 01998 { 01999 return new KatanaInterface::SetEnabledMessage(this); 02000 } 02001 /** @class KatanaInterface::SetMaxVelocityMessage <interfaces/KatanaInterface.h> 02002 * SetMaxVelocityMessage Fawkes BlackBoard Interface Message. 02003 * 02004 02005 */ 02006 02007 02008 /** Constructor with initial values. 02009 * @param ini_max_velocity initial value for max_velocity 02010 */ 02011 KatanaInterface::SetMaxVelocityMessage::SetMaxVelocityMessage(const uint8_t ini_max_velocity) : Message("SetMaxVelocityMessage") 02012 { 02013 data_size = sizeof(SetMaxVelocityMessage_data_t); 02014 data_ptr = malloc(data_size); 02015 memset(data_ptr, 0, data_size); 02016 data = (SetMaxVelocityMessage_data_t *)data_ptr; 02017 data_ts = (message_data_ts_t *)data_ptr; 02018 data->max_velocity = ini_max_velocity; 02019 add_fieldinfo(IFT_BYTE, "max_velocity", 1, &data->max_velocity); 02020 } 02021 /** Constructor */ 02022 KatanaInterface::SetMaxVelocityMessage::SetMaxVelocityMessage() : Message("SetMaxVelocityMessage") 02023 { 02024 data_size = sizeof(SetMaxVelocityMessage_data_t); 02025 data_ptr = malloc(data_size); 02026 memset(data_ptr, 0, data_size); 02027 data = (SetMaxVelocityMessage_data_t *)data_ptr; 02028 data_ts = (message_data_ts_t *)data_ptr; 02029 add_fieldinfo(IFT_BYTE, "max_velocity", 1, &data->max_velocity); 02030 } 02031 02032 /** Destructor */ 02033 KatanaInterface::SetMaxVelocityMessage::~SetMaxVelocityMessage() 02034 { 02035 free(data_ptr); 02036 } 02037 02038 /** Copy constructor. 02039 * @param m message to copy from 02040 */ 02041 KatanaInterface::SetMaxVelocityMessage::SetMaxVelocityMessage(const SetMaxVelocityMessage *m) : Message("SetMaxVelocityMessage") 02042 { 02043 data_size = m->data_size; 02044 data_ptr = malloc(data_size); 02045 memcpy(data_ptr, m->data_ptr, data_size); 02046 data = (SetMaxVelocityMessage_data_t *)data_ptr; 02047 data_ts = (message_data_ts_t *)data_ptr; 02048 } 02049 02050 /* Methods */ 02051 /** Get max_velocity value. 02052 * Maximum velocity 02053 * @return max_velocity value 02054 */ 02055 uint8_t 02056 KatanaInterface::SetMaxVelocityMessage::max_velocity() const 02057 { 02058 return data->max_velocity; 02059 } 02060 02061 /** Get maximum length of max_velocity value. 02062 * @return length of max_velocity value, can be length of the array or number of 02063 * maximum number of characters for a string 02064 */ 02065 size_t 02066 KatanaInterface::SetMaxVelocityMessage::maxlenof_max_velocity() const 02067 { 02068 return 1; 02069 } 02070 02071 /** Set max_velocity value. 02072 * Maximum velocity 02073 * @param new_max_velocity new max_velocity value 02074 */ 02075 void 02076 KatanaInterface::SetMaxVelocityMessage::set_max_velocity(const uint8_t new_max_velocity) 02077 { 02078 data->max_velocity = new_max_velocity; 02079 } 02080 02081 /** Clone this message. 02082 * Produces a message of the same type as this message and copies the 02083 * data to the new message. 02084 * @return clone of this message 02085 */ 02086 Message * 02087 KatanaInterface::SetMaxVelocityMessage::clone() const 02088 { 02089 return new KatanaInterface::SetMaxVelocityMessage(this); 02090 } 02091 /** @class KatanaInterface::SetPlannerParamsMessage <interfaces/KatanaInterface.h> 02092 * SetPlannerParamsMessage Fawkes BlackBoard Interface Message. 02093 * 02094 02095 */ 02096 02097 02098 /** Constructor with initial values. 02099 * @param ini_plannerparams initial value for plannerparams 02100 * @param ini_straight initial value for straight 02101 */ 02102 KatanaInterface::SetPlannerParamsMessage::SetPlannerParamsMessage(const char * ini_plannerparams, const bool ini_straight) : Message("SetPlannerParamsMessage") 02103 { 02104 data_size = sizeof(SetPlannerParamsMessage_data_t); 02105 data_ptr = malloc(data_size); 02106 memset(data_ptr, 0, data_size); 02107 data = (SetPlannerParamsMessage_data_t *)data_ptr; 02108 data_ts = (message_data_ts_t *)data_ptr; 02109 strncpy(data->plannerparams, ini_plannerparams, 1024); 02110 data->straight = ini_straight; 02111 add_fieldinfo(IFT_STRING, "plannerparams", 1024, data->plannerparams); 02112 add_fieldinfo(IFT_BOOL, "straight", 1, &data->straight); 02113 } 02114 /** Constructor */ 02115 KatanaInterface::SetPlannerParamsMessage::SetPlannerParamsMessage() : Message("SetPlannerParamsMessage") 02116 { 02117 data_size = sizeof(SetPlannerParamsMessage_data_t); 02118 data_ptr = malloc(data_size); 02119 memset(data_ptr, 0, data_size); 02120 data = (SetPlannerParamsMessage_data_t *)data_ptr; 02121 data_ts = (message_data_ts_t *)data_ptr; 02122 add_fieldinfo(IFT_STRING, "plannerparams", 1024, data->plannerparams); 02123 add_fieldinfo(IFT_BOOL, "straight", 1, &data->straight); 02124 } 02125 02126 /** Destructor */ 02127 KatanaInterface::SetPlannerParamsMessage::~SetPlannerParamsMessage() 02128 { 02129 free(data_ptr); 02130 } 02131 02132 /** Copy constructor. 02133 * @param m message to copy from 02134 */ 02135 KatanaInterface::SetPlannerParamsMessage::SetPlannerParamsMessage(const SetPlannerParamsMessage *m) : Message("SetPlannerParamsMessage") 02136 { 02137 data_size = m->data_size; 02138 data_ptr = malloc(data_size); 02139 memcpy(data_ptr, m->data_ptr, data_size); 02140 data = (SetPlannerParamsMessage_data_t *)data_ptr; 02141 data_ts = (message_data_ts_t *)data_ptr; 02142 } 02143 02144 /* Methods */ 02145 /** Get plannerparams value. 02146 * Planner parameters 02147 * @return plannerparams value 02148 */ 02149 char * 02150 KatanaInterface::SetPlannerParamsMessage::plannerparams() const 02151 { 02152 return data->plannerparams; 02153 } 02154 02155 /** Get maximum length of plannerparams value. 02156 * @return length of plannerparams value, can be length of the array or number of 02157 * maximum number of characters for a string 02158 */ 02159 size_t 02160 KatanaInterface::SetPlannerParamsMessage::maxlenof_plannerparams() const 02161 { 02162 return 1024; 02163 } 02164 02165 /** Set plannerparams value. 02166 * Planner parameters 02167 * @param new_plannerparams new plannerparams value 02168 */ 02169 void 02170 KatanaInterface::SetPlannerParamsMessage::set_plannerparams(const char * new_plannerparams) 02171 { 02172 strncpy(data->plannerparams, new_plannerparams, sizeof(data->plannerparams)); 02173 } 02174 02175 /** Get straight value. 02176 * Parameters for straight movement? 02177 * @return straight value 02178 */ 02179 bool 02180 KatanaInterface::SetPlannerParamsMessage::is_straight() const 02181 { 02182 return data->straight; 02183 } 02184 02185 /** Get maximum length of straight value. 02186 * @return length of straight value, can be length of the array or number of 02187 * maximum number of characters for a string 02188 */ 02189 size_t 02190 KatanaInterface::SetPlannerParamsMessage::maxlenof_straight() const 02191 { 02192 return 1; 02193 } 02194 02195 /** Set straight value. 02196 * Parameters for straight movement? 02197 * @param new_straight new straight value 02198 */ 02199 void 02200 KatanaInterface::SetPlannerParamsMessage::set_straight(const bool new_straight) 02201 { 02202 data->straight = new_straight; 02203 } 02204 02205 /** Clone this message. 02206 * Produces a message of the same type as this message and copies the 02207 * data to the new message. 02208 * @return clone of this message 02209 */ 02210 Message * 02211 KatanaInterface::SetPlannerParamsMessage::clone() const 02212 { 02213 return new KatanaInterface::SetPlannerParamsMessage(this); 02214 } 02215 /** @class KatanaInterface::SetMotorEncoderMessage <interfaces/KatanaInterface.h> 02216 * SetMotorEncoderMessage Fawkes BlackBoard Interface Message. 02217 * 02218 02219 */ 02220 02221 02222 /** Constructor with initial values. 02223 * @param ini_nr initial value for nr 02224 * @param ini_enc initial value for enc 02225 */ 02226 KatanaInterface::SetMotorEncoderMessage::SetMotorEncoderMessage(const uint32_t ini_nr, const uint32_t ini_enc) : Message("SetMotorEncoderMessage") 02227 { 02228 data_size = sizeof(SetMotorEncoderMessage_data_t); 02229 data_ptr = malloc(data_size); 02230 memset(data_ptr, 0, data_size); 02231 data = (SetMotorEncoderMessage_data_t *)data_ptr; 02232 data_ts = (message_data_ts_t *)data_ptr; 02233 data->nr = ini_nr; 02234 data->enc = ini_enc; 02235 add_fieldinfo(IFT_UINT32, "nr", 1, &data->nr); 02236 add_fieldinfo(IFT_UINT32, "enc", 1, &data->enc); 02237 } 02238 /** Constructor */ 02239 KatanaInterface::SetMotorEncoderMessage::SetMotorEncoderMessage() : Message("SetMotorEncoderMessage") 02240 { 02241 data_size = sizeof(SetMotorEncoderMessage_data_t); 02242 data_ptr = malloc(data_size); 02243 memset(data_ptr, 0, data_size); 02244 data = (SetMotorEncoderMessage_data_t *)data_ptr; 02245 data_ts = (message_data_ts_t *)data_ptr; 02246 add_fieldinfo(IFT_UINT32, "nr", 1, &data->nr); 02247 add_fieldinfo(IFT_UINT32, "enc", 1, &data->enc); 02248 } 02249 02250 /** Destructor */ 02251 KatanaInterface::SetMotorEncoderMessage::~SetMotorEncoderMessage() 02252 { 02253 free(data_ptr); 02254 } 02255 02256 /** Copy constructor. 02257 * @param m message to copy from 02258 */ 02259 KatanaInterface::SetMotorEncoderMessage::SetMotorEncoderMessage(const SetMotorEncoderMessage *m) : Message("SetMotorEncoderMessage") 02260 { 02261 data_size = m->data_size; 02262 data_ptr = malloc(data_size); 02263 memcpy(data_ptr, m->data_ptr, data_size); 02264 data = (SetMotorEncoderMessage_data_t *)data_ptr; 02265 data_ts = (message_data_ts_t *)data_ptr; 02266 } 02267 02268 /* Methods */ 02269 /** Get nr value. 02270 * Motor number 02271 * @return nr value 02272 */ 02273 uint32_t 02274 KatanaInterface::SetMotorEncoderMessage::nr() const 02275 { 02276 return data->nr; 02277 } 02278 02279 /** Get maximum length of nr value. 02280 * @return length of nr value, can be length of the array or number of 02281 * maximum number of characters for a string 02282 */ 02283 size_t 02284 KatanaInterface::SetMotorEncoderMessage::maxlenof_nr() const 02285 { 02286 return 1; 02287 } 02288 02289 /** Set nr value. 02290 * Motor number 02291 * @param new_nr new nr value 02292 */ 02293 void 02294 KatanaInterface::SetMotorEncoderMessage::set_nr(const uint32_t new_nr) 02295 { 02296 data->nr = new_nr; 02297 } 02298 02299 /** Get enc value. 02300 * Encoder value 02301 * @return enc value 02302 */ 02303 uint32_t 02304 KatanaInterface::SetMotorEncoderMessage::enc() const 02305 { 02306 return data->enc; 02307 } 02308 02309 /** Get maximum length of enc value. 02310 * @return length of enc value, can be length of the array or number of 02311 * maximum number of characters for a string 02312 */ 02313 size_t 02314 KatanaInterface::SetMotorEncoderMessage::maxlenof_enc() const 02315 { 02316 return 1; 02317 } 02318 02319 /** Set enc value. 02320 * Encoder value 02321 * @param new_enc new enc value 02322 */ 02323 void 02324 KatanaInterface::SetMotorEncoderMessage::set_enc(const uint32_t new_enc) 02325 { 02326 data->enc = new_enc; 02327 } 02328 02329 /** Clone this message. 02330 * Produces a message of the same type as this message and copies the 02331 * data to the new message. 02332 * @return clone of this message 02333 */ 02334 Message * 02335 KatanaInterface::SetMotorEncoderMessage::clone() const 02336 { 02337 return new KatanaInterface::SetMotorEncoderMessage(this); 02338 } 02339 /** @class KatanaInterface::MoveMotorEncoderMessage <interfaces/KatanaInterface.h> 02340 * MoveMotorEncoderMessage Fawkes BlackBoard Interface Message. 02341 * 02342 02343 */ 02344 02345 02346 /** Constructor with initial values. 02347 * @param ini_nr initial value for nr 02348 * @param ini_enc initial value for enc 02349 */ 02350 KatanaInterface::MoveMotorEncoderMessage::MoveMotorEncoderMessage(const uint32_t ini_nr, const uint32_t ini_enc) : Message("MoveMotorEncoderMessage") 02351 { 02352 data_size = sizeof(MoveMotorEncoderMessage_data_t); 02353 data_ptr = malloc(data_size); 02354 memset(data_ptr, 0, data_size); 02355 data = (MoveMotorEncoderMessage_data_t *)data_ptr; 02356 data_ts = (message_data_ts_t *)data_ptr; 02357 data->nr = ini_nr; 02358 data->enc = ini_enc; 02359 add_fieldinfo(IFT_UINT32, "nr", 1, &data->nr); 02360 add_fieldinfo(IFT_UINT32, "enc", 1, &data->enc); 02361 } 02362 /** Constructor */ 02363 KatanaInterface::MoveMotorEncoderMessage::MoveMotorEncoderMessage() : Message("MoveMotorEncoderMessage") 02364 { 02365 data_size = sizeof(MoveMotorEncoderMessage_data_t); 02366 data_ptr = malloc(data_size); 02367 memset(data_ptr, 0, data_size); 02368 data = (MoveMotorEncoderMessage_data_t *)data_ptr; 02369 data_ts = (message_data_ts_t *)data_ptr; 02370 add_fieldinfo(IFT_UINT32, "nr", 1, &data->nr); 02371 add_fieldinfo(IFT_UINT32, "enc", 1, &data->enc); 02372 } 02373 02374 /** Destructor */ 02375 KatanaInterface::MoveMotorEncoderMessage::~MoveMotorEncoderMessage() 02376 { 02377 free(data_ptr); 02378 } 02379 02380 /** Copy constructor. 02381 * @param m message to copy from 02382 */ 02383 KatanaInterface::MoveMotorEncoderMessage::MoveMotorEncoderMessage(const MoveMotorEncoderMessage *m) : Message("MoveMotorEncoderMessage") 02384 { 02385 data_size = m->data_size; 02386 data_ptr = malloc(data_size); 02387 memcpy(data_ptr, m->data_ptr, data_size); 02388 data = (MoveMotorEncoderMessage_data_t *)data_ptr; 02389 data_ts = (message_data_ts_t *)data_ptr; 02390 } 02391 02392 /* Methods */ 02393 /** Get nr value. 02394 * Motor number 02395 * @return nr value 02396 */ 02397 uint32_t 02398 KatanaInterface::MoveMotorEncoderMessage::nr() const 02399 { 02400 return data->nr; 02401 } 02402 02403 /** Get maximum length of nr value. 02404 * @return length of nr value, can be length of the array or number of 02405 * maximum number of characters for a string 02406 */ 02407 size_t 02408 KatanaInterface::MoveMotorEncoderMessage::maxlenof_nr() const 02409 { 02410 return 1; 02411 } 02412 02413 /** Set nr value. 02414 * Motor number 02415 * @param new_nr new nr value 02416 */ 02417 void 02418 KatanaInterface::MoveMotorEncoderMessage::set_nr(const uint32_t new_nr) 02419 { 02420 data->nr = new_nr; 02421 } 02422 02423 /** Get enc value. 02424 * Encoder value 02425 * @return enc value 02426 */ 02427 uint32_t 02428 KatanaInterface::MoveMotorEncoderMessage::enc() const 02429 { 02430 return data->enc; 02431 } 02432 02433 /** Get maximum length of enc value. 02434 * @return length of enc value, can be length of the array or number of 02435 * maximum number of characters for a string 02436 */ 02437 size_t 02438 KatanaInterface::MoveMotorEncoderMessage::maxlenof_enc() const 02439 { 02440 return 1; 02441 } 02442 02443 /** Set enc value. 02444 * Encoder value 02445 * @param new_enc new enc value 02446 */ 02447 void 02448 KatanaInterface::MoveMotorEncoderMessage::set_enc(const uint32_t new_enc) 02449 { 02450 data->enc = new_enc; 02451 } 02452 02453 /** Clone this message. 02454 * Produces a message of the same type as this message and copies the 02455 * data to the new message. 02456 * @return clone of this message 02457 */ 02458 Message * 02459 KatanaInterface::MoveMotorEncoderMessage::clone() const 02460 { 02461 return new KatanaInterface::MoveMotorEncoderMessage(this); 02462 } 02463 /** @class KatanaInterface::SetMotorAngleMessage <interfaces/KatanaInterface.h> 02464 * SetMotorAngleMessage Fawkes BlackBoard Interface Message. 02465 * 02466 02467 */ 02468 02469 02470 /** Constructor with initial values. 02471 * @param ini_nr initial value for nr 02472 * @param ini_angle initial value for angle 02473 */ 02474 KatanaInterface::SetMotorAngleMessage::SetMotorAngleMessage(const uint32_t ini_nr, const float ini_angle) : Message("SetMotorAngleMessage") 02475 { 02476 data_size = sizeof(SetMotorAngleMessage_data_t); 02477 data_ptr = malloc(data_size); 02478 memset(data_ptr, 0, data_size); 02479 data = (SetMotorAngleMessage_data_t *)data_ptr; 02480 data_ts = (message_data_ts_t *)data_ptr; 02481 data->nr = ini_nr; 02482 data->angle = ini_angle; 02483 add_fieldinfo(IFT_UINT32, "nr", 1, &data->nr); 02484 add_fieldinfo(IFT_FLOAT, "angle", 1, &data->angle); 02485 } 02486 /** Constructor */ 02487 KatanaInterface::SetMotorAngleMessage::SetMotorAngleMessage() : Message("SetMotorAngleMessage") 02488 { 02489 data_size = sizeof(SetMotorAngleMessage_data_t); 02490 data_ptr = malloc(data_size); 02491 memset(data_ptr, 0, data_size); 02492 data = (SetMotorAngleMessage_data_t *)data_ptr; 02493 data_ts = (message_data_ts_t *)data_ptr; 02494 add_fieldinfo(IFT_UINT32, "nr", 1, &data->nr); 02495 add_fieldinfo(IFT_FLOAT, "angle", 1, &data->angle); 02496 } 02497 02498 /** Destructor */ 02499 KatanaInterface::SetMotorAngleMessage::~SetMotorAngleMessage() 02500 { 02501 free(data_ptr); 02502 } 02503 02504 /** Copy constructor. 02505 * @param m message to copy from 02506 */ 02507 KatanaInterface::SetMotorAngleMessage::SetMotorAngleMessage(const SetMotorAngleMessage *m) : Message("SetMotorAngleMessage") 02508 { 02509 data_size = m->data_size; 02510 data_ptr = malloc(data_size); 02511 memcpy(data_ptr, m->data_ptr, data_size); 02512 data = (SetMotorAngleMessage_data_t *)data_ptr; 02513 data_ts = (message_data_ts_t *)data_ptr; 02514 } 02515 02516 /* Methods */ 02517 /** Get nr value. 02518 * Motor number 02519 * @return nr value 02520 */ 02521 uint32_t 02522 KatanaInterface::SetMotorAngleMessage::nr() const 02523 { 02524 return data->nr; 02525 } 02526 02527 /** Get maximum length of nr value. 02528 * @return length of nr value, can be length of the array or number of 02529 * maximum number of characters for a string 02530 */ 02531 size_t 02532 KatanaInterface::SetMotorAngleMessage::maxlenof_nr() const 02533 { 02534 return 1; 02535 } 02536 02537 /** Set nr value. 02538 * Motor number 02539 * @param new_nr new nr value 02540 */ 02541 void 02542 KatanaInterface::SetMotorAngleMessage::set_nr(const uint32_t new_nr) 02543 { 02544 data->nr = new_nr; 02545 } 02546 02547 /** Get angle value. 02548 * Angle value (positive: increase; negative: decrease) 02549 * @return angle value 02550 */ 02551 float 02552 KatanaInterface::SetMotorAngleMessage::angle() const 02553 { 02554 return data->angle; 02555 } 02556 02557 /** Get maximum length of angle value. 02558 * @return length of angle value, can be length of the array or number of 02559 * maximum number of characters for a string 02560 */ 02561 size_t 02562 KatanaInterface::SetMotorAngleMessage::maxlenof_angle() const 02563 { 02564 return 1; 02565 } 02566 02567 /** Set angle value. 02568 * Angle value (positive: increase; negative: decrease) 02569 * @param new_angle new angle value 02570 */ 02571 void 02572 KatanaInterface::SetMotorAngleMessage::set_angle(const float new_angle) 02573 { 02574 data->angle = new_angle; 02575 } 02576 02577 /** Clone this message. 02578 * Produces a message of the same type as this message and copies the 02579 * data to the new message. 02580 * @return clone of this message 02581 */ 02582 Message * 02583 KatanaInterface::SetMotorAngleMessage::clone() const 02584 { 02585 return new KatanaInterface::SetMotorAngleMessage(this); 02586 } 02587 /** @class KatanaInterface::MoveMotorAngleMessage <interfaces/KatanaInterface.h> 02588 * MoveMotorAngleMessage Fawkes BlackBoard Interface Message. 02589 * 02590 02591 */ 02592 02593 02594 /** Constructor with initial values. 02595 * @param ini_nr initial value for nr 02596 * @param ini_angle initial value for angle 02597 */ 02598 KatanaInterface::MoveMotorAngleMessage::MoveMotorAngleMessage(const uint32_t ini_nr, const float ini_angle) : Message("MoveMotorAngleMessage") 02599 { 02600 data_size = sizeof(MoveMotorAngleMessage_data_t); 02601 data_ptr = malloc(data_size); 02602 memset(data_ptr, 0, data_size); 02603 data = (MoveMotorAngleMessage_data_t *)data_ptr; 02604 data_ts = (message_data_ts_t *)data_ptr; 02605 data->nr = ini_nr; 02606 data->angle = ini_angle; 02607 add_fieldinfo(IFT_UINT32, "nr", 1, &data->nr); 02608 add_fieldinfo(IFT_FLOAT, "angle", 1, &data->angle); 02609 } 02610 /** Constructor */ 02611 KatanaInterface::MoveMotorAngleMessage::MoveMotorAngleMessage() : Message("MoveMotorAngleMessage") 02612 { 02613 data_size = sizeof(MoveMotorAngleMessage_data_t); 02614 data_ptr = malloc(data_size); 02615 memset(data_ptr, 0, data_size); 02616 data = (MoveMotorAngleMessage_data_t *)data_ptr; 02617 data_ts = (message_data_ts_t *)data_ptr; 02618 add_fieldinfo(IFT_UINT32, "nr", 1, &data->nr); 02619 add_fieldinfo(IFT_FLOAT, "angle", 1, &data->angle); 02620 } 02621 02622 /** Destructor */ 02623 KatanaInterface::MoveMotorAngleMessage::~MoveMotorAngleMessage() 02624 { 02625 free(data_ptr); 02626 } 02627 02628 /** Copy constructor. 02629 * @param m message to copy from 02630 */ 02631 KatanaInterface::MoveMotorAngleMessage::MoveMotorAngleMessage(const MoveMotorAngleMessage *m) : Message("MoveMotorAngleMessage") 02632 { 02633 data_size = m->data_size; 02634 data_ptr = malloc(data_size); 02635 memcpy(data_ptr, m->data_ptr, data_size); 02636 data = (MoveMotorAngleMessage_data_t *)data_ptr; 02637 data_ts = (message_data_ts_t *)data_ptr; 02638 } 02639 02640 /* Methods */ 02641 /** Get nr value. 02642 * Motor number 02643 * @return nr value 02644 */ 02645 uint32_t 02646 KatanaInterface::MoveMotorAngleMessage::nr() const 02647 { 02648 return data->nr; 02649 } 02650 02651 /** Get maximum length of nr value. 02652 * @return length of nr value, can be length of the array or number of 02653 * maximum number of characters for a string 02654 */ 02655 size_t 02656 KatanaInterface::MoveMotorAngleMessage::maxlenof_nr() const 02657 { 02658 return 1; 02659 } 02660 02661 /** Set nr value. 02662 * Motor number 02663 * @param new_nr new nr value 02664 */ 02665 void 02666 KatanaInterface::MoveMotorAngleMessage::set_nr(const uint32_t new_nr) 02667 { 02668 data->nr = new_nr; 02669 } 02670 02671 /** Get angle value. 02672 * Angle value (positive: increase; negative: decrease) 02673 * @return angle value 02674 */ 02675 float 02676 KatanaInterface::MoveMotorAngleMessage::angle() const 02677 { 02678 return data->angle; 02679 } 02680 02681 /** Get maximum length of angle value. 02682 * @return length of angle value, can be length of the array or number of 02683 * maximum number of characters for a string 02684 */ 02685 size_t 02686 KatanaInterface::MoveMotorAngleMessage::maxlenof_angle() const 02687 { 02688 return 1; 02689 } 02690 02691 /** Set angle value. 02692 * Angle value (positive: increase; negative: decrease) 02693 * @param new_angle new angle value 02694 */ 02695 void 02696 KatanaInterface::MoveMotorAngleMessage::set_angle(const float new_angle) 02697 { 02698 data->angle = new_angle; 02699 } 02700 02701 /** Clone this message. 02702 * Produces a message of the same type as this message and copies the 02703 * data to the new message. 02704 * @return clone of this message 02705 */ 02706 Message * 02707 KatanaInterface::MoveMotorAngleMessage::clone() const 02708 { 02709 return new KatanaInterface::MoveMotorAngleMessage(this); 02710 } 02711 /** Check if message is valid and can be enqueued. 02712 * @param message Message to check 02713 * @return true if the message is valid, false otherwise. 02714 */ 02715 bool 02716 KatanaInterface::message_valid(const Message *message) const 02717 { 02718 const StopMessage *m0 = dynamic_cast<const StopMessage *>(message); 02719 if ( m0 != NULL ) { 02720 return true; 02721 } 02722 const FlushMessage *m1 = dynamic_cast<const FlushMessage *>(message); 02723 if ( m1 != NULL ) { 02724 return true; 02725 } 02726 const ParkMessage *m2 = dynamic_cast<const ParkMessage *>(message); 02727 if ( m2 != NULL ) { 02728 return true; 02729 } 02730 const LinearGotoMessage *m3 = dynamic_cast<const LinearGotoMessage *>(message); 02731 if ( m3 != NULL ) { 02732 return true; 02733 } 02734 const LinearGotoKniMessage *m4 = dynamic_cast<const LinearGotoKniMessage *>(message); 02735 if ( m4 != NULL ) { 02736 return true; 02737 } 02738 const ObjectGotoMessage *m5 = dynamic_cast<const ObjectGotoMessage *>(message); 02739 if ( m5 != NULL ) { 02740 return true; 02741 } 02742 const CalibrateMessage *m6 = dynamic_cast<const CalibrateMessage *>(message); 02743 if ( m6 != NULL ) { 02744 return true; 02745 } 02746 const OpenGripperMessage *m7 = dynamic_cast<const OpenGripperMessage *>(message); 02747 if ( m7 != NULL ) { 02748 return true; 02749 } 02750 const CloseGripperMessage *m8 = dynamic_cast<const CloseGripperMessage *>(message); 02751 if ( m8 != NULL ) { 02752 return true; 02753 } 02754 const SetEnabledMessage *m9 = dynamic_cast<const SetEnabledMessage *>(message); 02755 if ( m9 != NULL ) { 02756 return true; 02757 } 02758 const SetMaxVelocityMessage *m10 = dynamic_cast<const SetMaxVelocityMessage *>(message); 02759 if ( m10 != NULL ) { 02760 return true; 02761 } 02762 const SetPlannerParamsMessage *m11 = dynamic_cast<const SetPlannerParamsMessage *>(message); 02763 if ( m11 != NULL ) { 02764 return true; 02765 } 02766 const SetMotorEncoderMessage *m12 = dynamic_cast<const SetMotorEncoderMessage *>(message); 02767 if ( m12 != NULL ) { 02768 return true; 02769 } 02770 const MoveMotorEncoderMessage *m13 = dynamic_cast<const MoveMotorEncoderMessage *>(message); 02771 if ( m13 != NULL ) { 02772 return true; 02773 } 02774 const SetMotorAngleMessage *m14 = dynamic_cast<const SetMotorAngleMessage *>(message); 02775 if ( m14 != NULL ) { 02776 return true; 02777 } 02778 const MoveMotorAngleMessage *m15 = dynamic_cast<const MoveMotorAngleMessage *>(message); 02779 if ( m15 != NULL ) { 02780 return true; 02781 } 02782 return false; 02783 } 02784 02785 /// @cond INTERNALS 02786 EXPORT_INTERFACE(KatanaInterface) 02787 /// @endcond 02788 02789 02790 } // end namespace fawkes