Just changed OUTPUT_SIZE and INPUT_SIZE in ros/node_handle.h
Dependents: WRS2020_mecanum_node
SetLightProperties.h
00001 #ifndef _ROS_SERVICE_SetLightProperties_h 00002 #define _ROS_SERVICE_SetLightProperties_h 00003 #include <stdint.h> 00004 #include <string.h> 00005 #include <stdlib.h> 00006 #include "ros/msg.h" 00007 #include "std_msgs/ColorRGBA.h" 00008 00009 namespace gazebo_msgs 00010 { 00011 00012 static const char SETLIGHTPROPERTIES[] = "gazebo_msgs/SetLightProperties"; 00013 00014 class SetLightPropertiesRequest : public ros::Msg 00015 { 00016 public: 00017 typedef const char* _light_name_type; 00018 _light_name_type light_name; 00019 typedef std_msgs::ColorRGBA _diffuse_type; 00020 _diffuse_type diffuse; 00021 typedef double _attenuation_constant_type; 00022 _attenuation_constant_type attenuation_constant; 00023 typedef double _attenuation_linear_type; 00024 _attenuation_linear_type attenuation_linear; 00025 typedef double _attenuation_quadratic_type; 00026 _attenuation_quadratic_type attenuation_quadratic; 00027 00028 SetLightPropertiesRequest(): 00029 light_name(""), 00030 diffuse(), 00031 attenuation_constant(0), 00032 attenuation_linear(0), 00033 attenuation_quadratic(0) 00034 { 00035 } 00036 00037 virtual int serialize(unsigned char *outbuffer) const 00038 { 00039 int offset = 0; 00040 uint32_t length_light_name = strlen(this->light_name); 00041 varToArr(outbuffer + offset, length_light_name); 00042 offset += 4; 00043 memcpy(outbuffer + offset, this->light_name, length_light_name); 00044 offset += length_light_name; 00045 offset += this->diffuse.serialize(outbuffer + offset); 00046 union { 00047 double real; 00048 uint64_t base; 00049 } u_attenuation_constant; 00050 u_attenuation_constant.real = this->attenuation_constant; 00051 *(outbuffer + offset + 0) = (u_attenuation_constant.base >> (8 * 0)) & 0xFF; 00052 *(outbuffer + offset + 1) = (u_attenuation_constant.base >> (8 * 1)) & 0xFF; 00053 *(outbuffer + offset + 2) = (u_attenuation_constant.base >> (8 * 2)) & 0xFF; 00054 *(outbuffer + offset + 3) = (u_attenuation_constant.base >> (8 * 3)) & 0xFF; 00055 *(outbuffer + offset + 4) = (u_attenuation_constant.base >> (8 * 4)) & 0xFF; 00056 *(outbuffer + offset + 5) = (u_attenuation_constant.base >> (8 * 5)) & 0xFF; 00057 *(outbuffer + offset + 6) = (u_attenuation_constant.base >> (8 * 6)) & 0xFF; 00058 *(outbuffer + offset + 7) = (u_attenuation_constant.base >> (8 * 7)) & 0xFF; 00059 offset += sizeof(this->attenuation_constant); 00060 union { 00061 double real; 00062 uint64_t base; 00063 } u_attenuation_linear; 00064 u_attenuation_linear.real = this->attenuation_linear; 00065 *(outbuffer + offset + 0) = (u_attenuation_linear.base >> (8 * 0)) & 0xFF; 00066 *(outbuffer + offset + 1) = (u_attenuation_linear.base >> (8 * 1)) & 0xFF; 00067 *(outbuffer + offset + 2) = (u_attenuation_linear.base >> (8 * 2)) & 0xFF; 00068 *(outbuffer + offset + 3) = (u_attenuation_linear.base >> (8 * 3)) & 0xFF; 00069 *(outbuffer + offset + 4) = (u_attenuation_linear.base >> (8 * 4)) & 0xFF; 00070 *(outbuffer + offset + 5) = (u_attenuation_linear.base >> (8 * 5)) & 0xFF; 00071 *(outbuffer + offset + 6) = (u_attenuation_linear.base >> (8 * 6)) & 0xFF; 00072 *(outbuffer + offset + 7) = (u_attenuation_linear.base >> (8 * 7)) & 0xFF; 00073 offset += sizeof(this->attenuation_linear); 00074 union { 00075 double real; 00076 uint64_t base; 00077 } u_attenuation_quadratic; 00078 u_attenuation_quadratic.real = this->attenuation_quadratic; 00079 *(outbuffer + offset + 0) = (u_attenuation_quadratic.base >> (8 * 0)) & 0xFF; 00080 *(outbuffer + offset + 1) = (u_attenuation_quadratic.base >> (8 * 1)) & 0xFF; 00081 *(outbuffer + offset + 2) = (u_attenuation_quadratic.base >> (8 * 2)) & 0xFF; 00082 *(outbuffer + offset + 3) = (u_attenuation_quadratic.base >> (8 * 3)) & 0xFF; 00083 *(outbuffer + offset + 4) = (u_attenuation_quadratic.base >> (8 * 4)) & 0xFF; 00084 *(outbuffer + offset + 5) = (u_attenuation_quadratic.base >> (8 * 5)) & 0xFF; 00085 *(outbuffer + offset + 6) = (u_attenuation_quadratic.base >> (8 * 6)) & 0xFF; 00086 *(outbuffer + offset + 7) = (u_attenuation_quadratic.base >> (8 * 7)) & 0xFF; 00087 offset += sizeof(this->attenuation_quadratic); 00088 return offset; 00089 } 00090 00091 virtual int deserialize(unsigned char *inbuffer) 00092 { 00093 int offset = 0; 00094 uint32_t length_light_name; 00095 arrToVar(length_light_name, (inbuffer + offset)); 00096 offset += 4; 00097 for(unsigned int k= offset; k< offset+length_light_name; ++k){ 00098 inbuffer[k-1]=inbuffer[k]; 00099 } 00100 inbuffer[offset+length_light_name-1]=0; 00101 this->light_name = (char *)(inbuffer + offset-1); 00102 offset += length_light_name; 00103 offset += this->diffuse.deserialize(inbuffer + offset); 00104 union { 00105 double real; 00106 uint64_t base; 00107 } u_attenuation_constant; 00108 u_attenuation_constant.base = 0; 00109 u_attenuation_constant.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); 00110 u_attenuation_constant.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); 00111 u_attenuation_constant.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); 00112 u_attenuation_constant.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); 00113 u_attenuation_constant.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); 00114 u_attenuation_constant.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); 00115 u_attenuation_constant.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); 00116 u_attenuation_constant.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); 00117 this->attenuation_constant = u_attenuation_constant.real; 00118 offset += sizeof(this->attenuation_constant); 00119 union { 00120 double real; 00121 uint64_t base; 00122 } u_attenuation_linear; 00123 u_attenuation_linear.base = 0; 00124 u_attenuation_linear.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); 00125 u_attenuation_linear.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); 00126 u_attenuation_linear.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); 00127 u_attenuation_linear.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); 00128 u_attenuation_linear.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); 00129 u_attenuation_linear.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); 00130 u_attenuation_linear.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); 00131 u_attenuation_linear.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); 00132 this->attenuation_linear = u_attenuation_linear.real; 00133 offset += sizeof(this->attenuation_linear); 00134 union { 00135 double real; 00136 uint64_t base; 00137 } u_attenuation_quadratic; 00138 u_attenuation_quadratic.base = 0; 00139 u_attenuation_quadratic.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); 00140 u_attenuation_quadratic.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); 00141 u_attenuation_quadratic.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); 00142 u_attenuation_quadratic.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); 00143 u_attenuation_quadratic.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); 00144 u_attenuation_quadratic.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); 00145 u_attenuation_quadratic.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); 00146 u_attenuation_quadratic.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); 00147 this->attenuation_quadratic = u_attenuation_quadratic.real; 00148 offset += sizeof(this->attenuation_quadratic); 00149 return offset; 00150 } 00151 00152 const char * getType(){ return SETLIGHTPROPERTIES; }; 00153 const char * getMD5(){ return "73ad1ac5e9e312ddf7c74f38ad843f34"; }; 00154 00155 }; 00156 00157 class SetLightPropertiesResponse : public ros::Msg 00158 { 00159 public: 00160 typedef bool _success_type; 00161 _success_type success; 00162 typedef const char* _status_message_type; 00163 _status_message_type status_message; 00164 00165 SetLightPropertiesResponse(): 00166 success(0), 00167 status_message("") 00168 { 00169 } 00170 00171 virtual int serialize(unsigned char *outbuffer) const 00172 { 00173 int offset = 0; 00174 union { 00175 bool real; 00176 uint8_t base; 00177 } u_success; 00178 u_success.real = this->success; 00179 *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; 00180 offset += sizeof(this->success); 00181 uint32_t length_status_message = strlen(this->status_message); 00182 varToArr(outbuffer + offset, length_status_message); 00183 offset += 4; 00184 memcpy(outbuffer + offset, this->status_message, length_status_message); 00185 offset += length_status_message; 00186 return offset; 00187 } 00188 00189 virtual int deserialize(unsigned char *inbuffer) 00190 { 00191 int offset = 0; 00192 union { 00193 bool real; 00194 uint8_t base; 00195 } u_success; 00196 u_success.base = 0; 00197 u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); 00198 this->success = u_success.real; 00199 offset += sizeof(this->success); 00200 uint32_t length_status_message; 00201 arrToVar(length_status_message, (inbuffer + offset)); 00202 offset += 4; 00203 for(unsigned int k= offset; k< offset+length_status_message; ++k){ 00204 inbuffer[k-1]=inbuffer[k]; 00205 } 00206 inbuffer[offset+length_status_message-1]=0; 00207 this->status_message = (char *)(inbuffer + offset-1); 00208 offset += length_status_message; 00209 return offset; 00210 } 00211 00212 const char * getType(){ return SETLIGHTPROPERTIES; }; 00213 const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; 00214 00215 }; 00216 00217 class SetLightProperties { 00218 public: 00219 typedef SetLightPropertiesRequest Request; 00220 typedef SetLightPropertiesResponse Response; 00221 }; 00222 00223 } 00224 #endif
Generated on Tue Jul 12 2022 18:49:20 by 1.7.2