Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
SetLabels.h
00001 #ifndef _ROS_SERVICE_SetLabels_h 00002 #define _ROS_SERVICE_SetLabels_h 00003 #include <stdint.h> 00004 #include <string.h> 00005 #include <stdlib.h> 00006 #include "ros/msg.h" 00007 00008 namespace jsk_recognition_msgs 00009 { 00010 00011 static const char SETLABELS[] = "jsk_recognition_msgs/SetLabels"; 00012 00013 class SetLabelsRequest : public ros::Msg 00014 { 00015 public: 00016 uint32_t labels_length; 00017 typedef int64_t _labels_type; 00018 _labels_type st_labels; 00019 _labels_type * labels; 00020 00021 SetLabelsRequest(): 00022 labels_length(0), labels(NULL) 00023 { 00024 } 00025 00026 virtual int serialize(unsigned char *outbuffer) const 00027 { 00028 int offset = 0; 00029 *(outbuffer + offset + 0) = (this->labels_length >> (8 * 0)) & 0xFF; 00030 *(outbuffer + offset + 1) = (this->labels_length >> (8 * 1)) & 0xFF; 00031 *(outbuffer + offset + 2) = (this->labels_length >> (8 * 2)) & 0xFF; 00032 *(outbuffer + offset + 3) = (this->labels_length >> (8 * 3)) & 0xFF; 00033 offset += sizeof(this->labels_length); 00034 for( uint32_t i = 0; i < labels_length; i++){ 00035 union { 00036 int64_t real; 00037 uint64_t base; 00038 } u_labelsi; 00039 u_labelsi.real = this->labels[i]; 00040 *(outbuffer + offset + 0) = (u_labelsi.base >> (8 * 0)) & 0xFF; 00041 *(outbuffer + offset + 1) = (u_labelsi.base >> (8 * 1)) & 0xFF; 00042 *(outbuffer + offset + 2) = (u_labelsi.base >> (8 * 2)) & 0xFF; 00043 *(outbuffer + offset + 3) = (u_labelsi.base >> (8 * 3)) & 0xFF; 00044 *(outbuffer + offset + 4) = (u_labelsi.base >> (8 * 4)) & 0xFF; 00045 *(outbuffer + offset + 5) = (u_labelsi.base >> (8 * 5)) & 0xFF; 00046 *(outbuffer + offset + 6) = (u_labelsi.base >> (8 * 6)) & 0xFF; 00047 *(outbuffer + offset + 7) = (u_labelsi.base >> (8 * 7)) & 0xFF; 00048 offset += sizeof(this->labels[i]); 00049 } 00050 return offset; 00051 } 00052 00053 virtual int deserialize(unsigned char *inbuffer) 00054 { 00055 int offset = 0; 00056 uint32_t labels_lengthT = ((uint32_t) (*(inbuffer + offset))); 00057 labels_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00058 labels_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00059 labels_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00060 offset += sizeof(this->labels_length); 00061 if(labels_lengthT > labels_length) 00062 this->labels = (int64_t*)realloc(this->labels, labels_lengthT * sizeof(int64_t)); 00063 labels_length = labels_lengthT; 00064 for( uint32_t i = 0; i < labels_length; i++){ 00065 union { 00066 int64_t real; 00067 uint64_t base; 00068 } u_st_labels; 00069 u_st_labels.base = 0; 00070 u_st_labels.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); 00071 u_st_labels.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); 00072 u_st_labels.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); 00073 u_st_labels.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); 00074 u_st_labels.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); 00075 u_st_labels.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); 00076 u_st_labels.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); 00077 u_st_labels.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); 00078 this->st_labels = u_st_labels.real; 00079 offset += sizeof(this->st_labels); 00080 memcpy( &(this->labels[i]), &(this->st_labels), sizeof(int64_t)); 00081 } 00082 return offset; 00083 } 00084 00085 virtual const char * getType(){ return SETLABELS; }; 00086 virtual const char * getMD5(){ return "59c228f541cab5b727a29411b8f17b33"; }; 00087 00088 }; 00089 00090 class SetLabelsResponse : public ros::Msg 00091 { 00092 public: 00093 typedef bool _success_type; 00094 _success_type success; 00095 00096 SetLabelsResponse(): 00097 success(0) 00098 { 00099 } 00100 00101 virtual int serialize(unsigned char *outbuffer) const 00102 { 00103 int offset = 0; 00104 union { 00105 bool real; 00106 uint8_t base; 00107 } u_success; 00108 u_success.real = this->success; 00109 *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; 00110 offset += sizeof(this->success); 00111 return offset; 00112 } 00113 00114 virtual int deserialize(unsigned char *inbuffer) 00115 { 00116 int offset = 0; 00117 union { 00118 bool real; 00119 uint8_t base; 00120 } u_success; 00121 u_success.base = 0; 00122 u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); 00123 this->success = u_success.real; 00124 offset += sizeof(this->success); 00125 return offset; 00126 } 00127 00128 virtual const char * getType(){ return SETLABELS; }; 00129 virtual const char * getMD5(){ return "358e233cde0c8a8bcfea4ce193f8fc15"; }; 00130 00131 }; 00132 00133 class SetLabels { 00134 public: 00135 typedef SetLabelsRequest Request; 00136 typedef SetLabelsResponse Response; 00137 }; 00138 00139 } 00140 #endif
Generated on Mon Sep 26 2022 13:47:03 by
