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_UINT32, "msgid", 1, &data->msgid); 00104 add_fieldinfo(IFT_BOOL, "final", 1, &data->final); 00105 add_fieldinfo(IFT_UINT32, "error_code", 1, &data->error_code); 00106 add_fieldinfo(IFT_BOOL, "enabled", 1, &data->enabled); 00107 add_fieldinfo(IFT_BOOL, "calibrated", 1, &data->calibrated); 00108 add_fieldinfo(IFT_BYTE, "max_velocity", 1, &data->max_velocity); 00109 add_fieldinfo(IFT_BYTE, "num_motors", 1, &data->num_motors); 00110 add_messageinfo("StopMessage"); 00111 add_messageinfo("FlushMessage"); 00112 add_messageinfo("ParkMessage"); 00113 add_messageinfo("LinearGotoMessage"); 00114 add_messageinfo("CalibrateMessage"); 00115 add_messageinfo("OpenGripperMessage"); 00116 add_messageinfo("CloseGripperMessage"); 00117 add_messageinfo("SetEnabledMessage"); 00118 add_messageinfo("SetMaxVelocityMessage"); 00119 unsigned char tmp_hash[] = {0x36, 0x80, 0x78, 0x4, 0x9f, 0x14, 0x1b, 0x27, 0x38, 0x40, 0x77, 0xb6, 0xc0, 0x7, 0xe, 0x73}; 00120 set_hash(tmp_hash); 00121 } 00122 00123 /** Destructor */ 00124 KatanaInterface::~KatanaInterface() 00125 { 00126 free(data_ptr); 00127 } 00128 /* Methods */ 00129 /** Get sensor_value value. 00130 * Sensor 00131 values. Use SENSOR_* indexes for accessing the values. 00132 * @return sensor_value value 00133 */ 00134 uint8_t * 00135 KatanaInterface::sensor_value() const 00136 { 00137 return data->sensor_value; 00138 } 00139 00140 /** Get sensor_value value at given index. 00141 * Sensor 00142 values. Use SENSOR_* indexes for accessing the values. 00143 * @param index index of value 00144 * @return sensor_value value 00145 * @exception Exception thrown if index is out of bounds 00146 */ 00147 uint8_t 00148 KatanaInterface::sensor_value(unsigned int index) const 00149 { 00150 if (index > 16) { 00151 throw Exception("Index value %u out of bounds (0..16)", index); 00152 } 00153 return data->sensor_value[index]; 00154 } 00155 00156 /** Get maximum length of sensor_value value. 00157 * @return length of sensor_value value, can be length of the array or number of 00158 * maximum number of characters for a string 00159 */ 00160 size_t 00161 KatanaInterface::maxlenof_sensor_value() const 00162 { 00163 return 16; 00164 } 00165 00166 /** Set sensor_value value. 00167 * Sensor 00168 values. Use SENSOR_* indexes for accessing the values. 00169 * @param new_sensor_value new sensor_value value 00170 */ 00171 void 00172 KatanaInterface::set_sensor_value(const uint8_t * new_sensor_value) 00173 { 00174 memcpy(data->sensor_value, new_sensor_value, sizeof(uint8_t) * 16); 00175 data_changed = true; 00176 } 00177 00178 /** Set sensor_value value at given index. 00179 * Sensor 00180 values. Use SENSOR_* indexes for accessing the values. 00181 * @param new_sensor_value new sensor_value value 00182 * @param index index for of the value 00183 */ 00184 void 00185 KatanaInterface::set_sensor_value(unsigned int index, const uint8_t new_sensor_value) 00186 { 00187 if (index > 16) { 00188 throw Exception("Index value %u out of bounds (0..16)", index); 00189 } 00190 data->sensor_value[index] = new_sensor_value; 00191 } 00192 /** Get x value. 00193 * X-Coordinate for tool position 00194 compared to base coordinate system. 00195 * @return x value 00196 */ 00197 float 00198 KatanaInterface::x() const 00199 { 00200 return data->x; 00201 } 00202 00203 /** Get maximum length of x value. 00204 * @return length of x value, can be length of the array or number of 00205 * maximum number of characters for a string 00206 */ 00207 size_t 00208 KatanaInterface::maxlenof_x() const 00209 { 00210 return 1; 00211 } 00212 00213 /** Set x value. 00214 * X-Coordinate for tool position 00215 compared to base coordinate system. 00216 * @param new_x new x value 00217 */ 00218 void 00219 KatanaInterface::set_x(const float new_x) 00220 { 00221 data->x = new_x; 00222 data_changed = true; 00223 } 00224 00225 /** Get y value. 00226 * Y-Coordinate for tool position 00227 compared to base coordinate system. 00228 * @return y value 00229 */ 00230 float 00231 KatanaInterface::y() const 00232 { 00233 return data->y; 00234 } 00235 00236 /** Get maximum length of y value. 00237 * @return length of y value, can be length of the array or number of 00238 * maximum number of characters for a string 00239 */ 00240 size_t 00241 KatanaInterface::maxlenof_y() const 00242 { 00243 return 1; 00244 } 00245 00246 /** Set y value. 00247 * Y-Coordinate for tool position 00248 compared to base coordinate system. 00249 * @param new_y new y value 00250 */ 00251 void 00252 KatanaInterface::set_y(const float new_y) 00253 { 00254 data->y = new_y; 00255 data_changed = true; 00256 } 00257 00258 /** Get z value. 00259 * Z-Coordinate for tool position 00260 compared to base coordinate system. 00261 * @return z value 00262 */ 00263 float 00264 KatanaInterface::z() const 00265 { 00266 return data->z; 00267 } 00268 00269 /** Get maximum length of z value. 00270 * @return length of z value, can be length of the array or number of 00271 * maximum number of characters for a string 00272 */ 00273 size_t 00274 KatanaInterface::maxlenof_z() const 00275 { 00276 return 1; 00277 } 00278 00279 /** Set z value. 00280 * Z-Coordinate for tool position 00281 compared to base coordinate system. 00282 * @param new_z new z value 00283 */ 00284 void 00285 KatanaInterface::set_z(const float new_z) 00286 { 00287 data->z = new_z; 00288 data_changed = true; 00289 } 00290 00291 /** Get phi value. 00292 * Euler angle Phi of tool orientation. 00293 * @return phi value 00294 */ 00295 float 00296 KatanaInterface::phi() const 00297 { 00298 return data->phi; 00299 } 00300 00301 /** Get maximum length of phi value. 00302 * @return length of phi value, can be length of the array or number of 00303 * maximum number of characters for a string 00304 */ 00305 size_t 00306 KatanaInterface::maxlenof_phi() const 00307 { 00308 return 1; 00309 } 00310 00311 /** Set phi value. 00312 * Euler angle Phi of tool orientation. 00313 * @param new_phi new phi value 00314 */ 00315 void 00316 KatanaInterface::set_phi(const float new_phi) 00317 { 00318 data->phi = new_phi; 00319 data_changed = true; 00320 } 00321 00322 /** Get theta value. 00323 * Euler angle Theta of tool orientation. 00324 * @return theta value 00325 */ 00326 float 00327 KatanaInterface::theta() const 00328 { 00329 return data->theta; 00330 } 00331 00332 /** Get maximum length of theta value. 00333 * @return length of theta value, can be length of the array or number of 00334 * maximum number of characters for a string 00335 */ 00336 size_t 00337 KatanaInterface::maxlenof_theta() const 00338 { 00339 return 1; 00340 } 00341 00342 /** Set theta value. 00343 * Euler angle Theta of tool orientation. 00344 * @param new_theta new theta value 00345 */ 00346 void 00347 KatanaInterface::set_theta(const float new_theta) 00348 { 00349 data->theta = new_theta; 00350 data_changed = true; 00351 } 00352 00353 /** Get psi value. 00354 * Euler angle Psi of tool orientation.. 00355 * @return psi value 00356 */ 00357 float 00358 KatanaInterface::psi() const 00359 { 00360 return data->psi; 00361 } 00362 00363 /** Get maximum length of psi value. 00364 * @return length of psi value, can be length of the array or number of 00365 * maximum number of characters for a string 00366 */ 00367 size_t 00368 KatanaInterface::maxlenof_psi() const 00369 { 00370 return 1; 00371 } 00372 00373 /** Set psi value. 00374 * Euler angle Psi of tool orientation.. 00375 * @param new_psi new psi value 00376 */ 00377 void 00378 KatanaInterface::set_psi(const float new_psi) 00379 { 00380 data->psi = new_psi; 00381 data_changed = true; 00382 } 00383 00384 /** Get msgid value. 00385 * The ID of the message that is currently being 00386 processed, or 0 if no message is being processed. 00387 * @return msgid value 00388 */ 00389 uint32_t 00390 KatanaInterface::msgid() const 00391 { 00392 return data->msgid; 00393 } 00394 00395 /** Get maximum length of msgid value. 00396 * @return length of msgid value, can be length of the array or number of 00397 * maximum number of characters for a string 00398 */ 00399 size_t 00400 KatanaInterface::maxlenof_msgid() const 00401 { 00402 return 1; 00403 } 00404 00405 /** Set msgid value. 00406 * The ID of the message that is currently being 00407 processed, or 0 if no message is being processed. 00408 * @param new_msgid new msgid value 00409 */ 00410 void 00411 KatanaInterface::set_msgid(const uint32_t new_msgid) 00412 { 00413 data->msgid = new_msgid; 00414 data_changed = true; 00415 } 00416 00417 /** Get final value. 00418 * True, if the last goto command has been finished, 00419 false if it is still running 00420 * @return final value 00421 */ 00422 bool 00423 KatanaInterface::is_final() const 00424 { 00425 return data->final; 00426 } 00427 00428 /** Get maximum length of final value. 00429 * @return length of final value, can be length of the array or number of 00430 * maximum number of characters for a string 00431 */ 00432 size_t 00433 KatanaInterface::maxlenof_final() const 00434 { 00435 return 1; 00436 } 00437 00438 /** Set final value. 00439 * True, if the last goto command has been finished, 00440 false if it is still running 00441 * @param new_final new final value 00442 */ 00443 void 00444 KatanaInterface::set_final(const bool new_final) 00445 { 00446 data->final = new_final; 00447 data_changed = true; 00448 } 00449 00450 /** Get error_code value. 00451 * Failure code set if 00452 final is true. 0 if no error occured, an error code from ERROR_* 00453 constants otherwise (or a bit-wise combination). 00454 * @return error_code value 00455 */ 00456 uint32_t 00457 KatanaInterface::error_code() const 00458 { 00459 return data->error_code; 00460 } 00461 00462 /** Get maximum length of error_code value. 00463 * @return length of error_code value, can be length of the array or number of 00464 * maximum number of characters for a string 00465 */ 00466 size_t 00467 KatanaInterface::maxlenof_error_code() const 00468 { 00469 return 1; 00470 } 00471 00472 /** Set error_code value. 00473 * Failure code set if 00474 final is true. 0 if no error occured, an error code from ERROR_* 00475 constants otherwise (or a bit-wise combination). 00476 * @param new_error_code new error_code value 00477 */ 00478 void 00479 KatanaInterface::set_error_code(const uint32_t new_error_code) 00480 { 00481 data->error_code = new_error_code; 00482 data_changed = true; 00483 } 00484 00485 /** Get enabled value. 00486 * Are motors enabled? 00487 * @return enabled value 00488 */ 00489 bool 00490 KatanaInterface::is_enabled() const 00491 { 00492 return data->enabled; 00493 } 00494 00495 /** Get maximum length of enabled value. 00496 * @return length of enabled value, can be length of the array or number of 00497 * maximum number of characters for a string 00498 */ 00499 size_t 00500 KatanaInterface::maxlenof_enabled() const 00501 { 00502 return 1; 00503 } 00504 00505 /** Set enabled value. 00506 * Are motors enabled? 00507 * @param new_enabled new enabled value 00508 */ 00509 void 00510 KatanaInterface::set_enabled(const bool new_enabled) 00511 { 00512 data->enabled = new_enabled; 00513 data_changed = true; 00514 } 00515 00516 /** Get calibrated value. 00517 * Has arm been calibrated? 00518 * @return calibrated value 00519 */ 00520 bool 00521 KatanaInterface::is_calibrated() const 00522 { 00523 return data->calibrated; 00524 } 00525 00526 /** Get maximum length of calibrated value. 00527 * @return length of calibrated value, can be length of the array or number of 00528 * maximum number of characters for a string 00529 */ 00530 size_t 00531 KatanaInterface::maxlenof_calibrated() const 00532 { 00533 return 1; 00534 } 00535 00536 /** Set calibrated value. 00537 * Has arm been calibrated? 00538 * @param new_calibrated new calibrated value 00539 */ 00540 void 00541 KatanaInterface::set_calibrated(const bool new_calibrated) 00542 { 00543 data->calibrated = new_calibrated; 00544 data_changed = true; 00545 } 00546 00547 /** Get max_velocity value. 00548 * Maximum velocity 00549 * @return max_velocity value 00550 */ 00551 uint8_t 00552 KatanaInterface::max_velocity() const 00553 { 00554 return data->max_velocity; 00555 } 00556 00557 /** Get maximum length of max_velocity value. 00558 * @return length of max_velocity value, can be length of the array or number of 00559 * maximum number of characters for a string 00560 */ 00561 size_t 00562 KatanaInterface::maxlenof_max_velocity() const 00563 { 00564 return 1; 00565 } 00566 00567 /** Set max_velocity value. 00568 * Maximum velocity 00569 * @param new_max_velocity new max_velocity value 00570 */ 00571 void 00572 KatanaInterface::set_max_velocity(const uint8_t new_max_velocity) 00573 { 00574 data->max_velocity = new_max_velocity; 00575 data_changed = true; 00576 } 00577 00578 /** Get num_motors value. 00579 * Number of motors 00580 * @return num_motors value 00581 */ 00582 uint8_t 00583 KatanaInterface::num_motors() const 00584 { 00585 return data->num_motors; 00586 } 00587 00588 /** Get maximum length of num_motors value. 00589 * @return length of num_motors value, can be length of the array or number of 00590 * maximum number of characters for a string 00591 */ 00592 size_t 00593 KatanaInterface::maxlenof_num_motors() const 00594 { 00595 return 1; 00596 } 00597 00598 /** Set num_motors value. 00599 * Number of motors 00600 * @param new_num_motors new num_motors value 00601 */ 00602 void 00603 KatanaInterface::set_num_motors(const uint8_t new_num_motors) 00604 { 00605 data->num_motors = new_num_motors; 00606 data_changed = true; 00607 } 00608 00609 /* =========== message create =========== */ 00610 Message * 00611 KatanaInterface::create_message(const char *type) const 00612 { 00613 if ( strncmp("StopMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00614 return new StopMessage(); 00615 } else if ( strncmp("FlushMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00616 return new FlushMessage(); 00617 } else if ( strncmp("ParkMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00618 return new ParkMessage(); 00619 } else if ( strncmp("LinearGotoMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00620 return new LinearGotoMessage(); 00621 } else if ( strncmp("CalibrateMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00622 return new CalibrateMessage(); 00623 } else if ( strncmp("OpenGripperMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00624 return new OpenGripperMessage(); 00625 } else if ( strncmp("CloseGripperMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00626 return new CloseGripperMessage(); 00627 } else if ( strncmp("SetEnabledMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00628 return new SetEnabledMessage(); 00629 } else if ( strncmp("SetMaxVelocityMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) { 00630 return new SetMaxVelocityMessage(); 00631 } else { 00632 throw UnknownTypeException("The given type '%s' does not match any known " 00633 "message type for this interface type.", type); 00634 } 00635 } 00636 00637 00638 /** Copy values from other interface. 00639 * @param other other interface to copy values from 00640 */ 00641 void 00642 KatanaInterface::copy_values(const Interface *other) 00643 { 00644 const KatanaInterface *oi = dynamic_cast<const KatanaInterface *>(other); 00645 if (oi == NULL) { 00646 throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)", 00647 type(), other->type()); 00648 } 00649 memcpy(data, oi->data, sizeof(KatanaInterface_data_t)); 00650 } 00651 00652 const char * 00653 KatanaInterface::enum_tostring(const char *enumtype, int val) const 00654 { 00655 throw UnknownTypeException("Unknown enum type %s", enumtype); 00656 } 00657 00658 /* =========== messages =========== */ 00659 /** @class KatanaInterface::StopMessage <interfaces/KatanaInterface.h> 00660 * StopMessage Fawkes BlackBoard Interface Message. 00661 * 00662 00663 */ 00664 00665 00666 /** Constructor */ 00667 KatanaInterface::StopMessage::StopMessage() : Message("StopMessage") 00668 { 00669 data_size = sizeof(StopMessage_data_t); 00670 data_ptr = malloc(data_size); 00671 memset(data_ptr, 0, data_size); 00672 data = (StopMessage_data_t *)data_ptr; 00673 data_ts = (message_data_ts_t *)data_ptr; 00674 } 00675 00676 /** Destructor */ 00677 KatanaInterface::StopMessage::~StopMessage() 00678 { 00679 free(data_ptr); 00680 } 00681 00682 /** Copy constructor. 00683 * @param m message to copy from 00684 */ 00685 KatanaInterface::StopMessage::StopMessage(const StopMessage *m) : Message("StopMessage") 00686 { 00687 data_size = m->data_size; 00688 data_ptr = malloc(data_size); 00689 memcpy(data_ptr, m->data_ptr, data_size); 00690 data = (StopMessage_data_t *)data_ptr; 00691 data_ts = (message_data_ts_t *)data_ptr; 00692 } 00693 00694 /* Methods */ 00695 /** Clone this message. 00696 * Produces a message of the same type as this message and copies the 00697 * data to the new message. 00698 * @return clone of this message 00699 */ 00700 Message * 00701 KatanaInterface::StopMessage::clone() const 00702 { 00703 return new KatanaInterface::StopMessage(this); 00704 } 00705 /** @class KatanaInterface::FlushMessage <interfaces/KatanaInterface.h> 00706 * FlushMessage Fawkes BlackBoard Interface Message. 00707 * 00708 00709 */ 00710 00711 00712 /** Constructor */ 00713 KatanaInterface::FlushMessage::FlushMessage() : Message("FlushMessage") 00714 { 00715 data_size = sizeof(FlushMessage_data_t); 00716 data_ptr = malloc(data_size); 00717 memset(data_ptr, 0, data_size); 00718 data = (FlushMessage_data_t *)data_ptr; 00719 data_ts = (message_data_ts_t *)data_ptr; 00720 } 00721 00722 /** Destructor */ 00723 KatanaInterface::FlushMessage::~FlushMessage() 00724 { 00725 free(data_ptr); 00726 } 00727 00728 /** Copy constructor. 00729 * @param m message to copy from 00730 */ 00731 KatanaInterface::FlushMessage::FlushMessage(const FlushMessage *m) : Message("FlushMessage") 00732 { 00733 data_size = m->data_size; 00734 data_ptr = malloc(data_size); 00735 memcpy(data_ptr, m->data_ptr, data_size); 00736 data = (FlushMessage_data_t *)data_ptr; 00737 data_ts = (message_data_ts_t *)data_ptr; 00738 } 00739 00740 /* Methods */ 00741 /** Clone this message. 00742 * Produces a message of the same type as this message and copies the 00743 * data to the new message. 00744 * @return clone of this message 00745 */ 00746 Message * 00747 KatanaInterface::FlushMessage::clone() const 00748 { 00749 return new KatanaInterface::FlushMessage(this); 00750 } 00751 /** @class KatanaInterface::ParkMessage <interfaces/KatanaInterface.h> 00752 * ParkMessage Fawkes BlackBoard Interface Message. 00753 * 00754 00755 */ 00756 00757 00758 /** Constructor */ 00759 KatanaInterface::ParkMessage::ParkMessage() : Message("ParkMessage") 00760 { 00761 data_size = sizeof(ParkMessage_data_t); 00762 data_ptr = malloc(data_size); 00763 memset(data_ptr, 0, data_size); 00764 data = (ParkMessage_data_t *)data_ptr; 00765 data_ts = (message_data_ts_t *)data_ptr; 00766 } 00767 00768 /** Destructor */ 00769 KatanaInterface::ParkMessage::~ParkMessage() 00770 { 00771 free(data_ptr); 00772 } 00773 00774 /** Copy constructor. 00775 * @param m message to copy from 00776 */ 00777 KatanaInterface::ParkMessage::ParkMessage(const ParkMessage *m) : Message("ParkMessage") 00778 { 00779 data_size = m->data_size; 00780 data_ptr = malloc(data_size); 00781 memcpy(data_ptr, m->data_ptr, data_size); 00782 data = (ParkMessage_data_t *)data_ptr; 00783 data_ts = (message_data_ts_t *)data_ptr; 00784 } 00785 00786 /* Methods */ 00787 /** Clone this message. 00788 * Produces a message of the same type as this message and copies the 00789 * data to the new message. 00790 * @return clone of this message 00791 */ 00792 Message * 00793 KatanaInterface::ParkMessage::clone() const 00794 { 00795 return new KatanaInterface::ParkMessage(this); 00796 } 00797 /** @class KatanaInterface::LinearGotoMessage <interfaces/KatanaInterface.h> 00798 * LinearGotoMessage Fawkes BlackBoard Interface Message. 00799 * 00800 00801 */ 00802 00803 00804 /** Constructor with initial values. 00805 * @param ini_x initial value for x 00806 * @param ini_y initial value for y 00807 * @param ini_z initial value for z 00808 * @param ini_phi initial value for phi 00809 * @param ini_theta initial value for theta 00810 * @param ini_psi initial value for psi 00811 */ 00812 KatanaInterface::LinearGotoMessage::LinearGotoMessage(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") 00813 { 00814 data_size = sizeof(LinearGotoMessage_data_t); 00815 data_ptr = malloc(data_size); 00816 memset(data_ptr, 0, data_size); 00817 data = (LinearGotoMessage_data_t *)data_ptr; 00818 data_ts = (message_data_ts_t *)data_ptr; 00819 data->x = ini_x; 00820 data->y = ini_y; 00821 data->z = ini_z; 00822 data->phi = ini_phi; 00823 data->theta = ini_theta; 00824 data->psi = ini_psi; 00825 add_fieldinfo(IFT_FLOAT, "x", 1, &data->x); 00826 add_fieldinfo(IFT_FLOAT, "y", 1, &data->y); 00827 add_fieldinfo(IFT_FLOAT, "z", 1, &data->z); 00828 add_fieldinfo(IFT_FLOAT, "phi", 1, &data->phi); 00829 add_fieldinfo(IFT_FLOAT, "theta", 1, &data->theta); 00830 add_fieldinfo(IFT_FLOAT, "psi", 1, &data->psi); 00831 } 00832 /** Constructor */ 00833 KatanaInterface::LinearGotoMessage::LinearGotoMessage() : Message("LinearGotoMessage") 00834 { 00835 data_size = sizeof(LinearGotoMessage_data_t); 00836 data_ptr = malloc(data_size); 00837 memset(data_ptr, 0, data_size); 00838 data = (LinearGotoMessage_data_t *)data_ptr; 00839 data_ts = (message_data_ts_t *)data_ptr; 00840 add_fieldinfo(IFT_FLOAT, "x", 1, &data->x); 00841 add_fieldinfo(IFT_FLOAT, "y", 1, &data->y); 00842 add_fieldinfo(IFT_FLOAT, "z", 1, &data->z); 00843 add_fieldinfo(IFT_FLOAT, "phi", 1, &data->phi); 00844 add_fieldinfo(IFT_FLOAT, "theta", 1, &data->theta); 00845 add_fieldinfo(IFT_FLOAT, "psi", 1, &data->psi); 00846 } 00847 00848 /** Destructor */ 00849 KatanaInterface::LinearGotoMessage::~LinearGotoMessage() 00850 { 00851 free(data_ptr); 00852 } 00853 00854 /** Copy constructor. 00855 * @param m message to copy from 00856 */ 00857 KatanaInterface::LinearGotoMessage::LinearGotoMessage(const LinearGotoMessage *m) : Message("LinearGotoMessage") 00858 { 00859 data_size = m->data_size; 00860 data_ptr = malloc(data_size); 00861 memcpy(data_ptr, m->data_ptr, data_size); 00862 data = (LinearGotoMessage_data_t *)data_ptr; 00863 data_ts = (message_data_ts_t *)data_ptr; 00864 } 00865 00866 /* Methods */ 00867 /** Get x value. 00868 * X-Coordinate for tool position 00869 compared to base coordinate system. 00870 * @return x value 00871 */ 00872 float 00873 KatanaInterface::LinearGotoMessage::x() const 00874 { 00875 return data->x; 00876 } 00877 00878 /** Get maximum length of x value. 00879 * @return length of x value, can be length of the array or number of 00880 * maximum number of characters for a string 00881 */ 00882 size_t 00883 KatanaInterface::LinearGotoMessage::maxlenof_x() const 00884 { 00885 return 1; 00886 } 00887 00888 /** Set x value. 00889 * X-Coordinate for tool position 00890 compared to base coordinate system. 00891 * @param new_x new x value 00892 */ 00893 void 00894 KatanaInterface::LinearGotoMessage::set_x(const float new_x) 00895 { 00896 data->x = new_x; 00897 } 00898 00899 /** Get y value. 00900 * Y-Coordinate for tool position 00901 compared to base coordinate system. 00902 * @return y value 00903 */ 00904 float 00905 KatanaInterface::LinearGotoMessage::y() const 00906 { 00907 return data->y; 00908 } 00909 00910 /** Get maximum length of y value. 00911 * @return length of y value, can be length of the array or number of 00912 * maximum number of characters for a string 00913 */ 00914 size_t 00915 KatanaInterface::LinearGotoMessage::maxlenof_y() const 00916 { 00917 return 1; 00918 } 00919 00920 /** Set y value. 00921 * Y-Coordinate for tool position 00922 compared to base coordinate system. 00923 * @param new_y new y value 00924 */ 00925 void 00926 KatanaInterface::LinearGotoMessage::set_y(const float new_y) 00927 { 00928 data->y = new_y; 00929 } 00930 00931 /** Get z value. 00932 * Z-Coordinate for tool position 00933 compared to base coordinate system. 00934 * @return z value 00935 */ 00936 float 00937 KatanaInterface::LinearGotoMessage::z() const 00938 { 00939 return data->z; 00940 } 00941 00942 /** Get maximum length of z value. 00943 * @return length of z value, can be length of the array or number of 00944 * maximum number of characters for a string 00945 */ 00946 size_t 00947 KatanaInterface::LinearGotoMessage::maxlenof_z() const 00948 { 00949 return 1; 00950 } 00951 00952 /** Set z value. 00953 * Z-Coordinate for tool position 00954 compared to base coordinate system. 00955 * @param new_z new z value 00956 */ 00957 void 00958 KatanaInterface::LinearGotoMessage::set_z(const float new_z) 00959 { 00960 data->z = new_z; 00961 } 00962 00963 /** Get phi value. 00964 * Euler angle Phi of tool orientation. 00965 * @return phi value 00966 */ 00967 float 00968 KatanaInterface::LinearGotoMessage::phi() const 00969 { 00970 return data->phi; 00971 } 00972 00973 /** Get maximum length of phi value. 00974 * @return length of phi value, can be length of the array or number of 00975 * maximum number of characters for a string 00976 */ 00977 size_t 00978 KatanaInterface::LinearGotoMessage::maxlenof_phi() const 00979 { 00980 return 1; 00981 } 00982 00983 /** Set phi value. 00984 * Euler angle Phi of tool orientation. 00985 * @param new_phi new phi value 00986 */ 00987 void 00988 KatanaInterface::LinearGotoMessage::set_phi(const float new_phi) 00989 { 00990 data->phi = new_phi; 00991 } 00992 00993 /** Get theta value. 00994 * Euler angle Theta of tool orientation. 00995 * @return theta value 00996 */ 00997 float 00998 KatanaInterface::LinearGotoMessage::theta() const 00999 { 01000 return data->theta; 01001 } 01002 01003 /** Get maximum length of theta value. 01004 * @return length of theta value, can be length of the array or number of 01005 * maximum number of characters for a string 01006 */ 01007 size_t 01008 KatanaInterface::LinearGotoMessage::maxlenof_theta() const 01009 { 01010 return 1; 01011 } 01012 01013 /** Set theta value. 01014 * Euler angle Theta of tool orientation. 01015 * @param new_theta new theta value 01016 */ 01017 void 01018 KatanaInterface::LinearGotoMessage::set_theta(const float new_theta) 01019 { 01020 data->theta = new_theta; 01021 } 01022 01023 /** Get psi value. 01024 * Euler angle Psi of tool orientation.. 01025 * @return psi value 01026 */ 01027 float 01028 KatanaInterface::LinearGotoMessage::psi() const 01029 { 01030 return data->psi; 01031 } 01032 01033 /** Get maximum length of psi value. 01034 * @return length of psi value, can be length of the array or number of 01035 * maximum number of characters for a string 01036 */ 01037 size_t 01038 KatanaInterface::LinearGotoMessage::maxlenof_psi() const 01039 { 01040 return 1; 01041 } 01042 01043 /** Set psi value. 01044 * Euler angle Psi of tool orientation.. 01045 * @param new_psi new psi value 01046 */ 01047 void 01048 KatanaInterface::LinearGotoMessage::set_psi(const float new_psi) 01049 { 01050 data->psi = new_psi; 01051 } 01052 01053 /** Clone this message. 01054 * Produces a message of the same type as this message and copies the 01055 * data to the new message. 01056 * @return clone of this message 01057 */ 01058 Message * 01059 KatanaInterface::LinearGotoMessage::clone() const 01060 { 01061 return new KatanaInterface::LinearGotoMessage(this); 01062 } 01063 /** @class KatanaInterface::CalibrateMessage <interfaces/KatanaInterface.h> 01064 * CalibrateMessage Fawkes BlackBoard Interface Message. 01065 * 01066 01067 */ 01068 01069 01070 /** Constructor */ 01071 KatanaInterface::CalibrateMessage::CalibrateMessage() : Message("CalibrateMessage") 01072 { 01073 data_size = sizeof(CalibrateMessage_data_t); 01074 data_ptr = malloc(data_size); 01075 memset(data_ptr, 0, data_size); 01076 data = (CalibrateMessage_data_t *)data_ptr; 01077 data_ts = (message_data_ts_t *)data_ptr; 01078 } 01079 01080 /** Destructor */ 01081 KatanaInterface::CalibrateMessage::~CalibrateMessage() 01082 { 01083 free(data_ptr); 01084 } 01085 01086 /** Copy constructor. 01087 * @param m message to copy from 01088 */ 01089 KatanaInterface::CalibrateMessage::CalibrateMessage(const CalibrateMessage *m) : Message("CalibrateMessage") 01090 { 01091 data_size = m->data_size; 01092 data_ptr = malloc(data_size); 01093 memcpy(data_ptr, m->data_ptr, data_size); 01094 data = (CalibrateMessage_data_t *)data_ptr; 01095 data_ts = (message_data_ts_t *)data_ptr; 01096 } 01097 01098 /* Methods */ 01099 /** Clone this message. 01100 * Produces a message of the same type as this message and copies the 01101 * data to the new message. 01102 * @return clone of this message 01103 */ 01104 Message * 01105 KatanaInterface::CalibrateMessage::clone() const 01106 { 01107 return new KatanaInterface::CalibrateMessage(this); 01108 } 01109 /** @class KatanaInterface::OpenGripperMessage <interfaces/KatanaInterface.h> 01110 * OpenGripperMessage Fawkes BlackBoard Interface Message. 01111 * 01112 01113 */ 01114 01115 01116 /** Constructor */ 01117 KatanaInterface::OpenGripperMessage::OpenGripperMessage() : Message("OpenGripperMessage") 01118 { 01119 data_size = sizeof(OpenGripperMessage_data_t); 01120 data_ptr = malloc(data_size); 01121 memset(data_ptr, 0, data_size); 01122 data = (OpenGripperMessage_data_t *)data_ptr; 01123 data_ts = (message_data_ts_t *)data_ptr; 01124 } 01125 01126 /** Destructor */ 01127 KatanaInterface::OpenGripperMessage::~OpenGripperMessage() 01128 { 01129 free(data_ptr); 01130 } 01131 01132 /** Copy constructor. 01133 * @param m message to copy from 01134 */ 01135 KatanaInterface::OpenGripperMessage::OpenGripperMessage(const OpenGripperMessage *m) : Message("OpenGripperMessage") 01136 { 01137 data_size = m->data_size; 01138 data_ptr = malloc(data_size); 01139 memcpy(data_ptr, m->data_ptr, data_size); 01140 data = (OpenGripperMessage_data_t *)data_ptr; 01141 data_ts = (message_data_ts_t *)data_ptr; 01142 } 01143 01144 /* Methods */ 01145 /** Clone this message. 01146 * Produces a message of the same type as this message and copies the 01147 * data to the new message. 01148 * @return clone of this message 01149 */ 01150 Message * 01151 KatanaInterface::OpenGripperMessage::clone() const 01152 { 01153 return new KatanaInterface::OpenGripperMessage(this); 01154 } 01155 /** @class KatanaInterface::CloseGripperMessage <interfaces/KatanaInterface.h> 01156 * CloseGripperMessage Fawkes BlackBoard Interface Message. 01157 * 01158 01159 */ 01160 01161 01162 /** Constructor */ 01163 KatanaInterface::CloseGripperMessage::CloseGripperMessage() : Message("CloseGripperMessage") 01164 { 01165 data_size = sizeof(CloseGripperMessage_data_t); 01166 data_ptr = malloc(data_size); 01167 memset(data_ptr, 0, data_size); 01168 data = (CloseGripperMessage_data_t *)data_ptr; 01169 data_ts = (message_data_ts_t *)data_ptr; 01170 } 01171 01172 /** Destructor */ 01173 KatanaInterface::CloseGripperMessage::~CloseGripperMessage() 01174 { 01175 free(data_ptr); 01176 } 01177 01178 /** Copy constructor. 01179 * @param m message to copy from 01180 */ 01181 KatanaInterface::CloseGripperMessage::CloseGripperMessage(const CloseGripperMessage *m) : Message("CloseGripperMessage") 01182 { 01183 data_size = m->data_size; 01184 data_ptr = malloc(data_size); 01185 memcpy(data_ptr, m->data_ptr, data_size); 01186 data = (CloseGripperMessage_data_t *)data_ptr; 01187 data_ts = (message_data_ts_t *)data_ptr; 01188 } 01189 01190 /* Methods */ 01191 /** Clone this message. 01192 * Produces a message of the same type as this message and copies the 01193 * data to the new message. 01194 * @return clone of this message 01195 */ 01196 Message * 01197 KatanaInterface::CloseGripperMessage::clone() const 01198 { 01199 return new KatanaInterface::CloseGripperMessage(this); 01200 } 01201 /** @class KatanaInterface::SetEnabledMessage <interfaces/KatanaInterface.h> 01202 * SetEnabledMessage Fawkes BlackBoard Interface Message. 01203 * 01204 01205 */ 01206 01207 01208 /** Constructor with initial values. 01209 * @param ini_enabled initial value for enabled 01210 */ 01211 KatanaInterface::SetEnabledMessage::SetEnabledMessage(const bool ini_enabled) : Message("SetEnabledMessage") 01212 { 01213 data_size = sizeof(SetEnabledMessage_data_t); 01214 data_ptr = malloc(data_size); 01215 memset(data_ptr, 0, data_size); 01216 data = (SetEnabledMessage_data_t *)data_ptr; 01217 data_ts = (message_data_ts_t *)data_ptr; 01218 data->enabled = ini_enabled; 01219 add_fieldinfo(IFT_BOOL, "enabled", 1, &data->enabled); 01220 } 01221 /** Constructor */ 01222 KatanaInterface::SetEnabledMessage::SetEnabledMessage() : Message("SetEnabledMessage") 01223 { 01224 data_size = sizeof(SetEnabledMessage_data_t); 01225 data_ptr = malloc(data_size); 01226 memset(data_ptr, 0, data_size); 01227 data = (SetEnabledMessage_data_t *)data_ptr; 01228 data_ts = (message_data_ts_t *)data_ptr; 01229 add_fieldinfo(IFT_BOOL, "enabled", 1, &data->enabled); 01230 } 01231 01232 /** Destructor */ 01233 KatanaInterface::SetEnabledMessage::~SetEnabledMessage() 01234 { 01235 free(data_ptr); 01236 } 01237 01238 /** Copy constructor. 01239 * @param m message to copy from 01240 */ 01241 KatanaInterface::SetEnabledMessage::SetEnabledMessage(const SetEnabledMessage *m) : Message("SetEnabledMessage") 01242 { 01243 data_size = m->data_size; 01244 data_ptr = malloc(data_size); 01245 memcpy(data_ptr, m->data_ptr, data_size); 01246 data = (SetEnabledMessage_data_t *)data_ptr; 01247 data_ts = (message_data_ts_t *)data_ptr; 01248 } 01249 01250 /* Methods */ 01251 /** Get enabled value. 01252 * Are motors enabled? 01253 * @return enabled value 01254 */ 01255 bool 01256 KatanaInterface::SetEnabledMessage::is_enabled() const 01257 { 01258 return data->enabled; 01259 } 01260 01261 /** Get maximum length of enabled value. 01262 * @return length of enabled value, can be length of the array or number of 01263 * maximum number of characters for a string 01264 */ 01265 size_t 01266 KatanaInterface::SetEnabledMessage::maxlenof_enabled() const 01267 { 01268 return 1; 01269 } 01270 01271 /** Set enabled value. 01272 * Are motors enabled? 01273 * @param new_enabled new enabled value 01274 */ 01275 void 01276 KatanaInterface::SetEnabledMessage::set_enabled(const bool new_enabled) 01277 { 01278 data->enabled = new_enabled; 01279 } 01280 01281 /** Clone this message. 01282 * Produces a message of the same type as this message and copies the 01283 * data to the new message. 01284 * @return clone of this message 01285 */ 01286 Message * 01287 KatanaInterface::SetEnabledMessage::clone() const 01288 { 01289 return new KatanaInterface::SetEnabledMessage(this); 01290 } 01291 /** @class KatanaInterface::SetMaxVelocityMessage <interfaces/KatanaInterface.h> 01292 * SetMaxVelocityMessage Fawkes BlackBoard Interface Message. 01293 * 01294 01295 */ 01296 01297 01298 /** Constructor with initial values. 01299 * @param ini_max_velocity initial value for max_velocity 01300 */ 01301 KatanaInterface::SetMaxVelocityMessage::SetMaxVelocityMessage(const uint8_t ini_max_velocity) : Message("SetMaxVelocityMessage") 01302 { 01303 data_size = sizeof(SetMaxVelocityMessage_data_t); 01304 data_ptr = malloc(data_size); 01305 memset(data_ptr, 0, data_size); 01306 data = (SetMaxVelocityMessage_data_t *)data_ptr; 01307 data_ts = (message_data_ts_t *)data_ptr; 01308 data->max_velocity = ini_max_velocity; 01309 add_fieldinfo(IFT_BYTE, "max_velocity", 1, &data->max_velocity); 01310 } 01311 /** Constructor */ 01312 KatanaInterface::SetMaxVelocityMessage::SetMaxVelocityMessage() : Message("SetMaxVelocityMessage") 01313 { 01314 data_size = sizeof(SetMaxVelocityMessage_data_t); 01315 data_ptr = malloc(data_size); 01316 memset(data_ptr, 0, data_size); 01317 data = (SetMaxVelocityMessage_data_t *)data_ptr; 01318 data_ts = (message_data_ts_t *)data_ptr; 01319 add_fieldinfo(IFT_BYTE, "max_velocity", 1, &data->max_velocity); 01320 } 01321 01322 /** Destructor */ 01323 KatanaInterface::SetMaxVelocityMessage::~SetMaxVelocityMessage() 01324 { 01325 free(data_ptr); 01326 } 01327 01328 /** Copy constructor. 01329 * @param m message to copy from 01330 */ 01331 KatanaInterface::SetMaxVelocityMessage::SetMaxVelocityMessage(const SetMaxVelocityMessage *m) : Message("SetMaxVelocityMessage") 01332 { 01333 data_size = m->data_size; 01334 data_ptr = malloc(data_size); 01335 memcpy(data_ptr, m->data_ptr, data_size); 01336 data = (SetMaxVelocityMessage_data_t *)data_ptr; 01337 data_ts = (message_data_ts_t *)data_ptr; 01338 } 01339 01340 /* Methods */ 01341 /** Get max_velocity value. 01342 * Maximum velocity 01343 * @return max_velocity value 01344 */ 01345 uint8_t 01346 KatanaInterface::SetMaxVelocityMessage::max_velocity() const 01347 { 01348 return data->max_velocity; 01349 } 01350 01351 /** Get maximum length of max_velocity value. 01352 * @return length of max_velocity value, can be length of the array or number of 01353 * maximum number of characters for a string 01354 */ 01355 size_t 01356 KatanaInterface::SetMaxVelocityMessage::maxlenof_max_velocity() const 01357 { 01358 return 1; 01359 } 01360 01361 /** Set max_velocity value. 01362 * Maximum velocity 01363 * @param new_max_velocity new max_velocity value 01364 */ 01365 void 01366 KatanaInterface::SetMaxVelocityMessage::set_max_velocity(const uint8_t new_max_velocity) 01367 { 01368 data->max_velocity = new_max_velocity; 01369 } 01370 01371 /** Clone this message. 01372 * Produces a message of the same type as this message and copies the 01373 * data to the new message. 01374 * @return clone of this message 01375 */ 01376 Message * 01377 KatanaInterface::SetMaxVelocityMessage::clone() const 01378 { 01379 return new KatanaInterface::SetMaxVelocityMessage(this); 01380 } 01381 /** Check if message is valid and can be enqueued. 01382 * @param message Message to check 01383 * @return true if the message is valid, false otherwise. 01384 */ 01385 bool 01386 KatanaInterface::message_valid(const Message *message) const 01387 { 01388 const StopMessage *m0 = dynamic_cast<const StopMessage *>(message); 01389 if ( m0 != NULL ) { 01390 return true; 01391 } 01392 const FlushMessage *m1 = dynamic_cast<const FlushMessage *>(message); 01393 if ( m1 != NULL ) { 01394 return true; 01395 } 01396 const ParkMessage *m2 = dynamic_cast<const ParkMessage *>(message); 01397 if ( m2 != NULL ) { 01398 return true; 01399 } 01400 const LinearGotoMessage *m3 = dynamic_cast<const LinearGotoMessage *>(message); 01401 if ( m3 != NULL ) { 01402 return true; 01403 } 01404 const CalibrateMessage *m4 = dynamic_cast<const CalibrateMessage *>(message); 01405 if ( m4 != NULL ) { 01406 return true; 01407 } 01408 const OpenGripperMessage *m5 = dynamic_cast<const OpenGripperMessage *>(message); 01409 if ( m5 != NULL ) { 01410 return true; 01411 } 01412 const CloseGripperMessage *m6 = dynamic_cast<const CloseGripperMessage *>(message); 01413 if ( m6 != NULL ) { 01414 return true; 01415 } 01416 const SetEnabledMessage *m7 = dynamic_cast<const SetEnabledMessage *>(message); 01417 if ( m7 != NULL ) { 01418 return true; 01419 } 01420 const SetMaxVelocityMessage *m8 = dynamic_cast<const SetMaxVelocityMessage *>(message); 01421 if ( m8 != NULL ) { 01422 return true; 01423 } 01424 return false; 01425 } 01426 01427 /// @cond INTERNALS 01428 EXPORT_INTERFACE(KatanaInterface) 01429 /// @endcond 01430 01431 01432 } // end namespace fawkes