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.
GetModelProperties.h
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 typedef const char* _model_name_type; 00017 _model_name_type model_name; 00018 00019 GetModelPropertiesRequest(): 00020 model_name("") 00021 { 00022 } 00023 00024 virtual int serialize(unsigned char *outbuffer) const 00025 { 00026 int offset = 0; 00027 uint32_t length_model_name = strlen(this->model_name); 00028 varToArr(outbuffer + offset, length_model_name); 00029 offset += 4; 00030 memcpy(outbuffer + offset, this->model_name, length_model_name); 00031 offset += length_model_name; 00032 return offset; 00033 } 00034 00035 virtual int deserialize(unsigned char *inbuffer) 00036 { 00037 int offset = 0; 00038 uint32_t length_model_name; 00039 arrToVar(length_model_name, (inbuffer + offset)); 00040 offset += 4; 00041 for(unsigned int k= offset; k< offset+length_model_name; ++k){ 00042 inbuffer[k-1]=inbuffer[k]; 00043 } 00044 inbuffer[offset+length_model_name-1]=0; 00045 this->model_name = (char *)(inbuffer + offset-1); 00046 offset += length_model_name; 00047 return offset; 00048 } 00049 00050 const char * getType(){ return GETMODELPROPERTIES; }; 00051 const char * getMD5(){ return "ea31c8eab6fc401383cf528a7c0984ba"; }; 00052 00053 }; 00054 00055 class GetModelPropertiesResponse : public ros::Msg 00056 { 00057 public: 00058 typedef const char* _parent_model_name_type; 00059 _parent_model_name_type parent_model_name; 00060 typedef const char* _canonical_body_name_type; 00061 _canonical_body_name_type canonical_body_name; 00062 uint32_t body_names_length; 00063 typedef char* _body_names_type; 00064 _body_names_type st_body_names; 00065 _body_names_type * body_names; 00066 uint32_t geom_names_length; 00067 typedef char* _geom_names_type; 00068 _geom_names_type st_geom_names; 00069 _geom_names_type * geom_names; 00070 uint32_t joint_names_length; 00071 typedef char* _joint_names_type; 00072 _joint_names_type st_joint_names; 00073 _joint_names_type * joint_names; 00074 uint32_t child_model_names_length; 00075 typedef char* _child_model_names_type; 00076 _child_model_names_type st_child_model_names; 00077 _child_model_names_type * child_model_names; 00078 typedef bool _is_static_type; 00079 _is_static_type is_static; 00080 typedef bool _success_type; 00081 _success_type success; 00082 typedef const char* _status_message_type; 00083 _status_message_type status_message; 00084 00085 GetModelPropertiesResponse(): 00086 parent_model_name(""), 00087 canonical_body_name(""), 00088 body_names_length(0), body_names(NULL), 00089 geom_names_length(0), geom_names(NULL), 00090 joint_names_length(0), joint_names(NULL), 00091 child_model_names_length(0), child_model_names(NULL), 00092 is_static(0), 00093 success(0), 00094 status_message("") 00095 { 00096 } 00097 00098 virtual int serialize(unsigned char *outbuffer) const 00099 { 00100 int offset = 0; 00101 uint32_t length_parent_model_name = strlen(this->parent_model_name); 00102 varToArr(outbuffer + offset, length_parent_model_name); 00103 offset += 4; 00104 memcpy(outbuffer + offset, this->parent_model_name, length_parent_model_name); 00105 offset += length_parent_model_name; 00106 uint32_t length_canonical_body_name = strlen(this->canonical_body_name); 00107 varToArr(outbuffer + offset, length_canonical_body_name); 00108 offset += 4; 00109 memcpy(outbuffer + offset, this->canonical_body_name, length_canonical_body_name); 00110 offset += length_canonical_body_name; 00111 *(outbuffer + offset + 0) = (this->body_names_length >> (8 * 0)) & 0xFF; 00112 *(outbuffer + offset + 1) = (this->body_names_length >> (8 * 1)) & 0xFF; 00113 *(outbuffer + offset + 2) = (this->body_names_length >> (8 * 2)) & 0xFF; 00114 *(outbuffer + offset + 3) = (this->body_names_length >> (8 * 3)) & 0xFF; 00115 offset += sizeof(this->body_names_length); 00116 for( uint32_t i = 0; i < body_names_length; i++){ 00117 uint32_t length_body_namesi = strlen(this->body_names[i]); 00118 varToArr(outbuffer + offset, length_body_namesi); 00119 offset += 4; 00120 memcpy(outbuffer + offset, this->body_names[i], length_body_namesi); 00121 offset += length_body_namesi; 00122 } 00123 *(outbuffer + offset + 0) = (this->geom_names_length >> (8 * 0)) & 0xFF; 00124 *(outbuffer + offset + 1) = (this->geom_names_length >> (8 * 1)) & 0xFF; 00125 *(outbuffer + offset + 2) = (this->geom_names_length >> (8 * 2)) & 0xFF; 00126 *(outbuffer + offset + 3) = (this->geom_names_length >> (8 * 3)) & 0xFF; 00127 offset += sizeof(this->geom_names_length); 00128 for( uint32_t i = 0; i < geom_names_length; i++){ 00129 uint32_t length_geom_namesi = strlen(this->geom_names[i]); 00130 varToArr(outbuffer + offset, length_geom_namesi); 00131 offset += 4; 00132 memcpy(outbuffer + offset, this->geom_names[i], length_geom_namesi); 00133 offset += length_geom_namesi; 00134 } 00135 *(outbuffer + offset + 0) = (this->joint_names_length >> (8 * 0)) & 0xFF; 00136 *(outbuffer + offset + 1) = (this->joint_names_length >> (8 * 1)) & 0xFF; 00137 *(outbuffer + offset + 2) = (this->joint_names_length >> (8 * 2)) & 0xFF; 00138 *(outbuffer + offset + 3) = (this->joint_names_length >> (8 * 3)) & 0xFF; 00139 offset += sizeof(this->joint_names_length); 00140 for( uint32_t i = 0; i < joint_names_length; i++){ 00141 uint32_t length_joint_namesi = strlen(this->joint_names[i]); 00142 varToArr(outbuffer + offset, length_joint_namesi); 00143 offset += 4; 00144 memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); 00145 offset += length_joint_namesi; 00146 } 00147 *(outbuffer + offset + 0) = (this->child_model_names_length >> (8 * 0)) & 0xFF; 00148 *(outbuffer + offset + 1) = (this->child_model_names_length >> (8 * 1)) & 0xFF; 00149 *(outbuffer + offset + 2) = (this->child_model_names_length >> (8 * 2)) & 0xFF; 00150 *(outbuffer + offset + 3) = (this->child_model_names_length >> (8 * 3)) & 0xFF; 00151 offset += sizeof(this->child_model_names_length); 00152 for( uint32_t i = 0; i < child_model_names_length; i++){ 00153 uint32_t length_child_model_namesi = strlen(this->child_model_names[i]); 00154 varToArr(outbuffer + offset, length_child_model_namesi); 00155 offset += 4; 00156 memcpy(outbuffer + offset, this->child_model_names[i], length_child_model_namesi); 00157 offset += length_child_model_namesi; 00158 } 00159 union { 00160 bool real; 00161 uint8_t base; 00162 } u_is_static; 00163 u_is_static.real = this->is_static; 00164 *(outbuffer + offset + 0) = (u_is_static.base >> (8 * 0)) & 0xFF; 00165 offset += sizeof(this->is_static); 00166 union { 00167 bool real; 00168 uint8_t base; 00169 } u_success; 00170 u_success.real = this->success; 00171 *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; 00172 offset += sizeof(this->success); 00173 uint32_t length_status_message = strlen(this->status_message); 00174 varToArr(outbuffer + offset, length_status_message); 00175 offset += 4; 00176 memcpy(outbuffer + offset, this->status_message, length_status_message); 00177 offset += length_status_message; 00178 return offset; 00179 } 00180 00181 virtual int deserialize(unsigned char *inbuffer) 00182 { 00183 int offset = 0; 00184 uint32_t length_parent_model_name; 00185 arrToVar(length_parent_model_name, (inbuffer + offset)); 00186 offset += 4; 00187 for(unsigned int k= offset; k< offset+length_parent_model_name; ++k){ 00188 inbuffer[k-1]=inbuffer[k]; 00189 } 00190 inbuffer[offset+length_parent_model_name-1]=0; 00191 this->parent_model_name = (char *)(inbuffer + offset-1); 00192 offset += length_parent_model_name; 00193 uint32_t length_canonical_body_name; 00194 arrToVar(length_canonical_body_name, (inbuffer + offset)); 00195 offset += 4; 00196 for(unsigned int k= offset; k< offset+length_canonical_body_name; ++k){ 00197 inbuffer[k-1]=inbuffer[k]; 00198 } 00199 inbuffer[offset+length_canonical_body_name-1]=0; 00200 this->canonical_body_name = (char *)(inbuffer + offset-1); 00201 offset += length_canonical_body_name; 00202 uint32_t body_names_lengthT = ((uint32_t) (*(inbuffer + offset))); 00203 body_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00204 body_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00205 body_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00206 offset += sizeof(this->body_names_length); 00207 if(body_names_lengthT > body_names_length) 00208 this->body_names = (char**)realloc(this->body_names, body_names_lengthT * sizeof(char*)); 00209 body_names_length = body_names_lengthT; 00210 for( uint32_t i = 0; i < body_names_length; i++){ 00211 uint32_t length_st_body_names; 00212 arrToVar(length_st_body_names, (inbuffer + offset)); 00213 offset += 4; 00214 for(unsigned int k= offset; k< offset+length_st_body_names; ++k){ 00215 inbuffer[k-1]=inbuffer[k]; 00216 } 00217 inbuffer[offset+length_st_body_names-1]=0; 00218 this->st_body_names = (char *)(inbuffer + offset-1); 00219 offset += length_st_body_names; 00220 memcpy( &(this->body_names[i]), &(this->st_body_names), sizeof(char*)); 00221 } 00222 uint32_t geom_names_lengthT = ((uint32_t) (*(inbuffer + offset))); 00223 geom_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00224 geom_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00225 geom_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00226 offset += sizeof(this->geom_names_length); 00227 if(geom_names_lengthT > geom_names_length) 00228 this->geom_names = (char**)realloc(this->geom_names, geom_names_lengthT * sizeof(char*)); 00229 geom_names_length = geom_names_lengthT; 00230 for( uint32_t i = 0; i < geom_names_length; i++){ 00231 uint32_t length_st_geom_names; 00232 arrToVar(length_st_geom_names, (inbuffer + offset)); 00233 offset += 4; 00234 for(unsigned int k= offset; k< offset+length_st_geom_names; ++k){ 00235 inbuffer[k-1]=inbuffer[k]; 00236 } 00237 inbuffer[offset+length_st_geom_names-1]=0; 00238 this->st_geom_names = (char *)(inbuffer + offset-1); 00239 offset += length_st_geom_names; 00240 memcpy( &(this->geom_names[i]), &(this->st_geom_names), sizeof(char*)); 00241 } 00242 uint32_t joint_names_lengthT = ((uint32_t) (*(inbuffer + offset))); 00243 joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00244 joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00245 joint_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00246 offset += sizeof(this->joint_names_length); 00247 if(joint_names_lengthT > joint_names_length) 00248 this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); 00249 joint_names_length = joint_names_lengthT; 00250 for( uint32_t i = 0; i < joint_names_length; i++){ 00251 uint32_t length_st_joint_names; 00252 arrToVar(length_st_joint_names, (inbuffer + offset)); 00253 offset += 4; 00254 for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ 00255 inbuffer[k-1]=inbuffer[k]; 00256 } 00257 inbuffer[offset+length_st_joint_names-1]=0; 00258 this->st_joint_names = (char *)(inbuffer + offset-1); 00259 offset += length_st_joint_names; 00260 memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); 00261 } 00262 uint32_t child_model_names_lengthT = ((uint32_t) (*(inbuffer + offset))); 00263 child_model_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00264 child_model_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00265 child_model_names_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00266 offset += sizeof(this->child_model_names_length); 00267 if(child_model_names_lengthT > child_model_names_length) 00268 this->child_model_names = (char**)realloc(this->child_model_names, child_model_names_lengthT * sizeof(char*)); 00269 child_model_names_length = child_model_names_lengthT; 00270 for( uint32_t i = 0; i < child_model_names_length; i++){ 00271 uint32_t length_st_child_model_names; 00272 arrToVar(length_st_child_model_names, (inbuffer + offset)); 00273 offset += 4; 00274 for(unsigned int k= offset; k< offset+length_st_child_model_names; ++k){ 00275 inbuffer[k-1]=inbuffer[k]; 00276 } 00277 inbuffer[offset+length_st_child_model_names-1]=0; 00278 this->st_child_model_names = (char *)(inbuffer + offset-1); 00279 offset += length_st_child_model_names; 00280 memcpy( &(this->child_model_names[i]), &(this->st_child_model_names), sizeof(char*)); 00281 } 00282 union { 00283 bool real; 00284 uint8_t base; 00285 } u_is_static; 00286 u_is_static.base = 0; 00287 u_is_static.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); 00288 this->is_static = u_is_static.real; 00289 offset += sizeof(this->is_static); 00290 union { 00291 bool real; 00292 uint8_t base; 00293 } u_success; 00294 u_success.base = 0; 00295 u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); 00296 this->success = u_success.real; 00297 offset += sizeof(this->success); 00298 uint32_t length_status_message; 00299 arrToVar(length_status_message, (inbuffer + offset)); 00300 offset += 4; 00301 for(unsigned int k= offset; k< offset+length_status_message; ++k){ 00302 inbuffer[k-1]=inbuffer[k]; 00303 } 00304 inbuffer[offset+length_status_message-1]=0; 00305 this->status_message = (char *)(inbuffer + offset-1); 00306 offset += length_status_message; 00307 return offset; 00308 } 00309 00310 const char * getType(){ return GETMODELPROPERTIES; }; 00311 const char * getMD5(){ return "b7f370938ef77b464b95f1bab3ec5028"; }; 00312 00313 }; 00314 00315 class GetModelProperties { 00316 public: 00317 typedef GetModelPropertiesRequest Request; 00318 typedef GetModelPropertiesResponse Response; 00319 }; 00320 00321 } 00322 #endif
Generated on Wed Jul 13 2022 23:30:17 by
