00001 """autogenerated by genpy from vrep_common/simRosGetObjectGroupDataRequest.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007
00008 class simRosGetObjectGroupDataRequest(genpy.Message):
00009 _md5sum = "f25e144fb8e81818d3b3ee5f47698859"
00010 _type = "vrep_common/simRosGetObjectGroupDataRequest"
00011 _has_header = False
00012 _full_text = """
00013
00014
00015
00016 int32 objectType
00017 int32 dataType
00018
00019 """
00020 __slots__ = ['objectType','dataType']
00021 _slot_types = ['int32','int32']
00022
00023 def __init__(self, *args, **kwds):
00024 """
00025 Constructor. Any message fields that are implicitly/explicitly
00026 set to None will be assigned a default value. The recommend
00027 use is keyword arguments as this is more robust to future message
00028 changes. You cannot mix in-order arguments and keyword arguments.
00029
00030 The available fields are:
00031 objectType,dataType
00032
00033 :param args: complete set of field values, in .msg order
00034 :param kwds: use keyword arguments corresponding to message field names
00035 to set specific fields.
00036 """
00037 if args or kwds:
00038 super(simRosGetObjectGroupDataRequest, self).__init__(*args, **kwds)
00039
00040 if self.objectType is None:
00041 self.objectType = 0
00042 if self.dataType is None:
00043 self.dataType = 0
00044 else:
00045 self.objectType = 0
00046 self.dataType = 0
00047
00048 def _get_types(self):
00049 """
00050 internal API method
00051 """
00052 return self._slot_types
00053
00054 def serialize(self, buff):
00055 """
00056 serialize message into buffer
00057 :param buff: buffer, ``StringIO``
00058 """
00059 try:
00060 _x = self
00061 buff.write(_struct_2i.pack(_x.objectType, _x.dataType))
00062 except struct.error as se: self._check_types(se)
00063 except TypeError as te: self._check_types(te)
00064
00065 def deserialize(self, str):
00066 """
00067 unpack serialized message in str into this message instance
00068 :param str: byte array of serialized message, ``str``
00069 """
00070 try:
00071 end = 0
00072 _x = self
00073 start = end
00074 end += 8
00075 (_x.objectType, _x.dataType,) = _struct_2i.unpack(str[start:end])
00076 return self
00077 except struct.error as e:
00078 raise genpy.DeserializationError(e)
00079
00080
00081 def serialize_numpy(self, buff, numpy):
00082 """
00083 serialize message with numpy array types into buffer
00084 :param buff: buffer, ``StringIO``
00085 :param numpy: numpy python module
00086 """
00087 try:
00088 _x = self
00089 buff.write(_struct_2i.pack(_x.objectType, _x.dataType))
00090 except struct.error as se: self._check_types(se)
00091 except TypeError as te: self._check_types(te)
00092
00093 def deserialize_numpy(self, str, numpy):
00094 """
00095 unpack serialized message in str into this message instance using numpy for array types
00096 :param str: byte array of serialized message, ``str``
00097 :param numpy: numpy python module
00098 """
00099 try:
00100 end = 0
00101 _x = self
00102 start = end
00103 end += 8
00104 (_x.objectType, _x.dataType,) = _struct_2i.unpack(str[start:end])
00105 return self
00106 except struct.error as e:
00107 raise genpy.DeserializationError(e)
00108
00109 _struct_I = genpy.struct_I
00110 _struct_2i = struct.Struct("<2i")
00111 """autogenerated by genpy from vrep_common/simRosGetObjectGroupDataResponse.msg. Do not edit."""
00112 import sys
00113 python3 = True if sys.hexversion > 0x03000000 else False
00114 import genpy
00115 import struct
00116
00117
00118 class simRosGetObjectGroupDataResponse(genpy.Message):
00119 _md5sum = "072add4d453cc4563363975eb4c48cf2"
00120 _type = "vrep_common/simRosGetObjectGroupDataResponse"
00121 _has_header = False
00122 _full_text = """int32[] handles
00123 int32[] intData
00124 float32[] floatData
00125 string[] strings
00126
00127
00128 """
00129 __slots__ = ['handles','intData','floatData','strings']
00130 _slot_types = ['int32[]','int32[]','float32[]','string[]']
00131
00132 def __init__(self, *args, **kwds):
00133 """
00134 Constructor. Any message fields that are implicitly/explicitly
00135 set to None will be assigned a default value. The recommend
00136 use is keyword arguments as this is more robust to future message
00137 changes. You cannot mix in-order arguments and keyword arguments.
00138
00139 The available fields are:
00140 handles,intData,floatData,strings
00141
00142 :param args: complete set of field values, in .msg order
00143 :param kwds: use keyword arguments corresponding to message field names
00144 to set specific fields.
00145 """
00146 if args or kwds:
00147 super(simRosGetObjectGroupDataResponse, self).__init__(*args, **kwds)
00148
00149 if self.handles is None:
00150 self.handles = []
00151 if self.intData is None:
00152 self.intData = []
00153 if self.floatData is None:
00154 self.floatData = []
00155 if self.strings is None:
00156 self.strings = []
00157 else:
00158 self.handles = []
00159 self.intData = []
00160 self.floatData = []
00161 self.strings = []
00162
00163 def _get_types(self):
00164 """
00165 internal API method
00166 """
00167 return self._slot_types
00168
00169 def serialize(self, buff):
00170 """
00171 serialize message into buffer
00172 :param buff: buffer, ``StringIO``
00173 """
00174 try:
00175 length = len(self.handles)
00176 buff.write(_struct_I.pack(length))
00177 pattern = '<%si'%length
00178 buff.write(struct.pack(pattern, *self.handles))
00179 length = len(self.intData)
00180 buff.write(_struct_I.pack(length))
00181 pattern = '<%si'%length
00182 buff.write(struct.pack(pattern, *self.intData))
00183 length = len(self.floatData)
00184 buff.write(_struct_I.pack(length))
00185 pattern = '<%sf'%length
00186 buff.write(struct.pack(pattern, *self.floatData))
00187 length = len(self.strings)
00188 buff.write(_struct_I.pack(length))
00189 for val1 in self.strings:
00190 length = len(val1)
00191 if python3 or type(val1) == unicode:
00192 val1 = val1.encode('utf-8')
00193 length = len(val1)
00194 buff.write(struct.pack('<I%ss'%length, length, val1))
00195 except struct.error as se: self._check_types(se)
00196 except TypeError as te: self._check_types(te)
00197
00198 def deserialize(self, str):
00199 """
00200 unpack serialized message in str into this message instance
00201 :param str: byte array of serialized message, ``str``
00202 """
00203 try:
00204 end = 0
00205 start = end
00206 end += 4
00207 (length,) = _struct_I.unpack(str[start:end])
00208 pattern = '<%si'%length
00209 start = end
00210 end += struct.calcsize(pattern)
00211 self.handles = struct.unpack(pattern, str[start:end])
00212 start = end
00213 end += 4
00214 (length,) = _struct_I.unpack(str[start:end])
00215 pattern = '<%si'%length
00216 start = end
00217 end += struct.calcsize(pattern)
00218 self.intData = struct.unpack(pattern, str[start:end])
00219 start = end
00220 end += 4
00221 (length,) = _struct_I.unpack(str[start:end])
00222 pattern = '<%sf'%length
00223 start = end
00224 end += struct.calcsize(pattern)
00225 self.floatData = struct.unpack(pattern, str[start:end])
00226 start = end
00227 end += 4
00228 (length,) = _struct_I.unpack(str[start:end])
00229 self.strings = []
00230 for i in range(0, length):
00231 start = end
00232 end += 4
00233 (length,) = _struct_I.unpack(str[start:end])
00234 start = end
00235 end += length
00236 if python3:
00237 val1 = str[start:end].decode('utf-8')
00238 else:
00239 val1 = str[start:end]
00240 self.strings.append(val1)
00241 return self
00242 except struct.error as e:
00243 raise genpy.DeserializationError(e)
00244
00245
00246 def serialize_numpy(self, buff, numpy):
00247 """
00248 serialize message with numpy array types into buffer
00249 :param buff: buffer, ``StringIO``
00250 :param numpy: numpy python module
00251 """
00252 try:
00253 length = len(self.handles)
00254 buff.write(_struct_I.pack(length))
00255 pattern = '<%si'%length
00256 buff.write(self.handles.tostring())
00257 length = len(self.intData)
00258 buff.write(_struct_I.pack(length))
00259 pattern = '<%si'%length
00260 buff.write(self.intData.tostring())
00261 length = len(self.floatData)
00262 buff.write(_struct_I.pack(length))
00263 pattern = '<%sf'%length
00264 buff.write(self.floatData.tostring())
00265 length = len(self.strings)
00266 buff.write(_struct_I.pack(length))
00267 for val1 in self.strings:
00268 length = len(val1)
00269 if python3 or type(val1) == unicode:
00270 val1 = val1.encode('utf-8')
00271 length = len(val1)
00272 buff.write(struct.pack('<I%ss'%length, length, val1))
00273 except struct.error as se: self._check_types(se)
00274 except TypeError as te: self._check_types(te)
00275
00276 def deserialize_numpy(self, str, numpy):
00277 """
00278 unpack serialized message in str into this message instance using numpy for array types
00279 :param str: byte array of serialized message, ``str``
00280 :param numpy: numpy python module
00281 """
00282 try:
00283 end = 0
00284 start = end
00285 end += 4
00286 (length,) = _struct_I.unpack(str[start:end])
00287 pattern = '<%si'%length
00288 start = end
00289 end += struct.calcsize(pattern)
00290 self.handles = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00291 start = end
00292 end += 4
00293 (length,) = _struct_I.unpack(str[start:end])
00294 pattern = '<%si'%length
00295 start = end
00296 end += struct.calcsize(pattern)
00297 self.intData = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00298 start = end
00299 end += 4
00300 (length,) = _struct_I.unpack(str[start:end])
00301 pattern = '<%sf'%length
00302 start = end
00303 end += struct.calcsize(pattern)
00304 self.floatData = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00305 start = end
00306 end += 4
00307 (length,) = _struct_I.unpack(str[start:end])
00308 self.strings = []
00309 for i in range(0, length):
00310 start = end
00311 end += 4
00312 (length,) = _struct_I.unpack(str[start:end])
00313 start = end
00314 end += length
00315 if python3:
00316 val1 = str[start:end].decode('utf-8')
00317 else:
00318 val1 = str[start:end]
00319 self.strings.append(val1)
00320 return self
00321 except struct.error as e:
00322 raise genpy.DeserializationError(e)
00323
00324 _struct_I = genpy.struct_I
00325 class simRosGetObjectGroupData(object):
00326 _type = 'vrep_common/simRosGetObjectGroupData'
00327 _md5sum = '8d0534a840a5e37715f425228506250e'
00328 _request_class = simRosGetObjectGroupDataRequest
00329 _response_class = simRosGetObjectGroupDataResponse