00001 #ifndef _ROS_SERVICE_GetModelProperties_h 00002 #define _ROS_SERVICE_GetModelProperties_h 00003 #include <stdint.h> 00004 #include <string.h> 00005 #include <stdlib.h> 00006 #include "ros/msg.h" 00007 00008 namespace gazebo_msgs 00009 { 00010 00011 static const char GETMODELPROPERTIES[] = "gazebo_msgs/GetModelProperties"; 00012 00013 class GetModelPropertiesRequest : public ros::Msg 00014 { 00015 public: 00016 char * model_name; 00017 00018 virtual int serialize(unsigned char *outbuffer) const 00019 { 00020 int offset = 0; 00021 uint32_t length_model_name = strlen( (const char*) this->model_name); 00022 memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); 00023 offset += 4; 00024 memcpy(outbuffer + offset, this->model_name, length_model_name); 00025 offset += length_model_name; 00026 return offset; 00027 } 00028 00029 virtual int deserialize(unsigned char *inbuffer) 00030 { 00031 int offset = 0; 00032 uint32_t length_model_name; 00033 memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); 00034 offset += 4; 00035 for(unsigned int k= offset; k< offset+length_model_name; ++k){ 00036 inbuffer[k-1]=inbuffer[k]; 00037 } 00038 inbuffer[offset+length_model_name-1]=0; 00039 this->model_name = (char *)(inbuffer + offset-1); 00040 offset += length_model_name; 00041 return offset; 00042 } 00043 00044 const char * getType(){ return GETMODELPROPERTIES; }; 00045 const char * getMD5(){ return "ea31c8eab6fc401383cf528a7c0984ba"; }; 00046 00047 }; 00048 00049 class GetModelPropertiesResponse : public ros::Msg 00050 { 00051 public: 00052 char * parent_model_name; 00053 char * canonical_body_name; 00054 uint8_t body_names_length; 00055 char* st_body_names; 00056 char* * body_names; 00057 uint8_t geom_names_length; 00058 char* st_geom_names; 00059 char* * geom_names; 00060 uint8_t joint_names_length; 00061 char* st_joint_names; 00062 char* * joint_names; 00063 uint8_t child_model_names_length; 00064 char* st_child_model_names; 00065 char* * child_model_names; 00066 bool is_static; 00067 bool success; 00068 char * status_message; 00069 00070 virtual int serialize(unsigned char *outbuffer) const 00071 { 00072 int offset = 0; 00073 uint32_t length_parent_model_name = strlen( (const char*) this->parent_model_name); 00074 memcpy(outbuffer + offset, &length_parent_model_name, sizeof(uint32_t)); 00075 offset += 4; 00076 memcpy(outbuffer + offset, this->parent_model_name, length_parent_model_name); 00077 offset += length_parent_model_name; 00078 uint32_t length_canonical_body_name = strlen( (const char*) this->canonical_body_name); 00079 memcpy(outbuffer + offset, &length_canonical_body_name, sizeof(uint32_t)); 00080 offset += 4; 00081 memcpy(outbuffer + offset, this->canonical_body_name, length_canonical_body_name); 00082 offset += length_canonical_body_name; 00083 *(outbuffer + offset++) = body_names_length; 00084 *(outbuffer + offset++) = 0; 00085 *(outbuffer + offset++) = 0; 00086 *(outbuffer + offset++) = 0; 00087 for( uint8_t i = 0; i < body_names_length; i++){ 00088 uint32_t length_body_namesi = strlen( (const char*) this->body_names[i]); 00089 memcpy(outbuffer + offset, &length_body_namesi, sizeof(uint32_t)); 00090 offset += 4; 00091 memcpy(outbuffer + offset, this->body_names[i], length_body_namesi); 00092 offset += length_body_namesi; 00093 } 00094 *(outbuffer + offset++) = geom_names_length; 00095 *(outbuffer + offset++) = 0; 00096 *(outbuffer + offset++) = 0; 00097 *(outbuffer + offset++) = 0; 00098 for( uint8_t i = 0; i < geom_names_length; i++){ 00099 uint32_t length_geom_namesi = strlen( (const char*) this->geom_names[i]); 00100 memcpy(outbuffer + offset, &length_geom_namesi, sizeof(uint32_t)); 00101 offset += 4; 00102 memcpy(outbuffer + offset, this->geom_names[i], length_geom_namesi); 00103 offset += length_geom_namesi; 00104 } 00105 *(outbuffer + offset++) = joint_names_length; 00106 *(outbuffer + offset++) = 0; 00107 *(outbuffer + offset++) = 0; 00108 *(outbuffer + offset++) = 0; 00109 for( uint8_t i = 0; i < joint_names_length; i++){ 00110 uint32_t length_joint_namesi = strlen( (const char*) this->joint_names[i]); 00111 memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); 00112 offset += 4; 00113 memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); 00114 offset += length_joint_namesi; 00115 } 00116 *(outbuffer + offset++) = child_model_names_length; 00117 *(outbuffer + offset++) = 0; 00118 *(outbuffer + offset++) = 0; 00119 *(outbuffer + offset++) = 0; 00120 for( uint8_t i = 0; i < child_model_names_length; i++){ 00121 uint32_t length_child_model_namesi = strlen( (const char*) this->child_model_names[i]); 00122 memcpy(outbuffer + offset, &length_child_model_namesi, sizeof(uint32_t)); 00123 offset += 4; 00124 memcpy(outbuffer + offset, this->child_model_names[i], length_child_model_namesi); 00125 offset += length_child_model_namesi; 00126 } 00127 union { 00128 bool real; 00129 uint8_t base; 00130 } u_is_static; 00131 u_is_static.real = this->is_static; 00132 *(outbuffer + offset + 0) = (u_is_static.base >> (8 * 0)) & 0xFF; 00133 offset += sizeof(this->is_static); 00134 union { 00135 bool real; 00136 uint8_t base; 00137 } u_success; 00138 u_success.real = this->success; 00139 *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; 00140 offset += sizeof(this->success); 00141 uint32_t length_status_message = strlen( (const char*) this->status_message); 00142 memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); 00143 offset += 4; 00144 memcpy(outbuffer + offset, this->status_message, length_status_message); 00145 offset += length_status_message; 00146 return offset; 00147 } 00148 00149 virtual int deserialize(unsigned char *inbuffer) 00150 { 00151 int offset = 0; 00152 uint32_t length_parent_model_name; 00153 memcpy(&length_parent_model_name, (inbuffer + offset), sizeof(uint32_t)); 00154 offset += 4; 00155 for(unsigned int k= offset; k< offset+length_parent_model_name; ++k){ 00156 inbuffer[k-1]=inbuffer[k]; 00157 } 00158 inbuffer[offset+length_parent_model_name-1]=0; 00159 this->parent_model_name = (char *)(inbuffer + offset-1); 00160 offset += length_parent_model_name; 00161 uint32_t length_canonical_body_name; 00162 memcpy(&length_canonical_body_name, (inbuffer + offset), sizeof(uint32_t)); 00163 offset += 4; 00164 for(unsigned int k= offset; k< offset+length_canonical_body_name; ++k){ 00165 inbuffer[k-1]=inbuffer[k]; 00166 } 00167 inbuffer[offset+length_canonical_body_name-1]=0; 00168 this->canonical_body_name = (char *)(inbuffer + offset-1); 00169 offset += length_canonical_body_name; 00170 uint8_t body_names_lengthT = *(inbuffer + offset++); 00171 if(body_names_lengthT > body_names_length) 00172 this->body_names = (char**)realloc(this->body_names, body_names_lengthT * sizeof(char*)); 00173 offset += 3; 00174 body_names_length = body_names_lengthT; 00175 for( uint8_t i = 0; i < body_names_length; i++){ 00176 uint32_t length_st_body_names; 00177 memcpy(&length_st_body_names, (inbuffer + offset), sizeof(uint32_t)); 00178 offset += 4; 00179 for(unsigned int k= offset; k< offset+length_st_body_names; ++k){ 00180 inbuffer[k-1]=inbuffer[k]; 00181 } 00182 inbuffer[offset+length_st_body_names-1]=0; 00183 this->st_body_names = (char *)(inbuffer + offset-1); 00184 offset += length_st_body_names; 00185 memcpy( &(this->body_names[i]), &(this->st_body_names), sizeof(char*)); 00186 } 00187 uint8_t geom_names_lengthT = *(inbuffer + offset++); 00188 if(geom_names_lengthT > geom_names_length) 00189 this->geom_names = (char**)realloc(this->geom_names, geom_names_lengthT * sizeof(char*)); 00190 offset += 3; 00191 geom_names_length = geom_names_lengthT; 00192 for( uint8_t i = 0; i < geom_names_length; i++){ 00193 uint32_t length_st_geom_names; 00194 memcpy(&length_st_geom_names, (inbuffer + offset), sizeof(uint32_t)); 00195 offset += 4; 00196 for(unsigned int k= offset; k< offset+length_st_geom_names; ++k){ 00197 inbuffer[k-1]=inbuffer[k]; 00198 } 00199 inbuffer[offset+length_st_geom_names-1]=0; 00200 this->st_geom_names = (char *)(inbuffer + offset-1); 00201 offset += length_st_geom_names; 00202 memcpy( &(this->geom_names[i]), &(this->st_geom_names), sizeof(char*)); 00203 } 00204 uint8_t joint_names_lengthT = *(inbuffer + offset++); 00205 if(joint_names_lengthT > joint_names_length) 00206 this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); 00207 offset += 3; 00208 joint_names_length = joint_names_lengthT; 00209 for( uint8_t i = 0; i < joint_names_length; i++){ 00210 uint32_t length_st_joint_names; 00211 memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); 00212 offset += 4; 00213 for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ 00214 inbuffer[k-1]=inbuffer[k]; 00215 } 00216 inbuffer[offset+length_st_joint_names-1]=0; 00217 this->st_joint_names = (char *)(inbuffer + offset-1); 00218 offset += length_st_joint_names; 00219 memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); 00220 } 00221 uint8_t child_model_names_lengthT = *(inbuffer + offset++); 00222 if(child_model_names_lengthT > child_model_names_length) 00223 this->child_model_names = (char**)realloc(this->child_model_names, child_model_names_lengthT * sizeof(char*)); 00224 offset += 3; 00225 child_model_names_length = child_model_names_lengthT; 00226 for( uint8_t i = 0; i < child_model_names_length; i++){ 00227 uint32_t length_st_child_model_names; 00228 memcpy(&length_st_child_model_names, (inbuffer + offset), sizeof(uint32_t)); 00229 offset += 4; 00230 for(unsigned int k= offset; k< offset+length_st_child_model_names; ++k){ 00231 inbuffer[k-1]=inbuffer[k]; 00232 } 00233 inbuffer[offset+length_st_child_model_names-1]=0; 00234 this->st_child_model_names = (char *)(inbuffer + offset-1); 00235 offset += length_st_child_model_names; 00236 memcpy( &(this->child_model_names[i]), &(this->st_child_model_names), sizeof(char*)); 00237 } 00238 union { 00239 bool real; 00240 uint8_t base; 00241 } u_is_static; 00242 u_is_static.base = 0; 00243 u_is_static.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); 00244 this->is_static = u_is_static.real; 00245 offset += sizeof(this->is_static); 00246 union { 00247 bool real; 00248 uint8_t base; 00249 } u_success; 00250 u_success.base = 0; 00251 u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); 00252 this->success = u_success.real; 00253 offset += sizeof(this->success); 00254 uint32_t length_status_message; 00255 memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); 00256 offset += 4; 00257 for(unsigned int k= offset; k< offset+length_status_message; ++k){ 00258 inbuffer[k-1]=inbuffer[k]; 00259 } 00260 inbuffer[offset+length_status_message-1]=0; 00261 this->status_message = (char *)(inbuffer + offset-1); 00262 offset += length_status_message; 00263 return offset; 00264 } 00265 00266 const char * getType(){ return GETMODELPROPERTIES; }; 00267 const char * getMD5(){ return "b7f370938ef77b464b95f1bab3ec5028"; }; 00268 00269 }; 00270 00271 class GetModelProperties { 00272 public: 00273 typedef GetModelPropertiesRequest Request; 00274 typedef GetModelPropertiesResponse Response; 00275 }; 00276 00277 } 00278 #endif