$search
00001 """autogenerated by genmsg_py from TestDataTypes.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import roslib.rostime 00006 import std_msgs.msg 00007 00008 class TestDataTypes(roslib.message.Message): 00009 _md5sum = "25bc379e8ef2913896f76e9ef8bedbdc" 00010 _type = "test_rosjava_jni/TestDataTypes" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """# Test all primitive types 00013 byte byte_ 00014 char char_ 00015 uint8 uint8_ 00016 int8 int8_ 00017 uint16 uint16_ 00018 int16 int16_ 00019 uint32 uint32_ 00020 int32 int32_ 00021 uint64 uint64_ 00022 int64 int64_ 00023 float32 float32_ 00024 float64 float64_ 00025 string string_ 00026 time time_ 00027 duration duration_ 00028 00029 # Test a smattering of array types 00030 byte[] byte_v 00031 byte[2] byte_f 00032 float64[] float64_v 00033 float64[2] float64_f 00034 string[] string_v 00035 string[2] string_f 00036 time[] time_v 00037 time[2] time_f 00038 00039 # Test submsgs, including both fixed and var length 00040 std_msgs/Byte Byte_ 00041 std_msgs/Byte[] Byte_v 00042 00043 std_msgs/ByteMultiArray ByteMultiArray_ 00044 std_msgs/ByteMultiArray[] ByteMultiArray_v 00045 00046 # Unfortunately, can't test these because roscpp message generation 00047 # is broken. Hopefully rosjava works correctly ... 00048 # TODO: put these back in. 00049 00050 # std_msgs/Byte[2] Byte_f 00051 # std_msgs/ByteMultiArray[2] ByteMultiArray_f 00052 00053 ================================================================================ 00054 MSG: std_msgs/Byte 00055 byte data 00056 00057 ================================================================================ 00058 MSG: std_msgs/ByteMultiArray 00059 # Please look at the MultiArrayLayout message definition for 00060 # documentation on all multiarrays. 00061 00062 MultiArrayLayout layout # specification of data layout 00063 byte[] data # array of data 00064 00065 00066 ================================================================================ 00067 MSG: std_msgs/MultiArrayLayout 00068 # The multiarray declares a generic multi-dimensional array of a 00069 # particular data type. Dimensions are ordered from outer most 00070 # to inner most. 00071 00072 MultiArrayDimension[] dim # Array of dimension properties 00073 uint32 data_offset # padding bytes at front of data 00074 00075 # Accessors should ALWAYS be written in terms of dimension stride 00076 # and specified outer-most dimension first. 00077 # 00078 # multiarray(i,j,k) = data[data_offset + dim_stride[1]*i + dim_stride[2]*j + k] 00079 # 00080 # A standard, 3-channel 640x480 image with interleaved color channels 00081 # would be specified as: 00082 # 00083 # dim[0].label = "height" 00084 # dim[0].size = 480 00085 # dim[0].stride = 3*640*480 = 921600 (note dim[0] stride is just size of image) 00086 # dim[1].label = "width" 00087 # dim[1].size = 640 00088 # dim[1].stride = 3*640 = 1920 00089 # dim[2].label = "channel" 00090 # dim[2].size = 3 00091 # dim[2].stride = 3 00092 # 00093 # multiarray(i,j,k) refers to the ith row, jth column, and kth channel. 00094 ================================================================================ 00095 MSG: std_msgs/MultiArrayDimension 00096 string label # label of given dimension 00097 uint32 size # size of given dimension (in type units) 00098 uint32 stride # stride of given dimension 00099 """ 00100 __slots__ = ['byte_','char_','uint8_','int8_','uint16_','int16_','uint32_','int32_','uint64_','int64_','float32_','float64_','string_','time_','duration_','byte_v','byte_f','float64_v','float64_f','string_v','string_f','time_v','time_f','Byte_','Byte_v','ByteMultiArray_','ByteMultiArray_v'] 00101 _slot_types = ['byte','char','uint8','int8','uint16','int16','uint32','int32','uint64','int64','float32','float64','string','time','duration','byte[]','byte[2]','float64[]','float64[2]','string[]','string[2]','time[]','time[2]','std_msgs/Byte','std_msgs/Byte[]','std_msgs/ByteMultiArray','std_msgs/ByteMultiArray[]'] 00102 00103 def __init__(self, *args, **kwds): 00104 """ 00105 Constructor. Any message fields that are implicitly/explicitly 00106 set to None will be assigned a default value. The recommend 00107 use is keyword arguments as this is more robust to future message 00108 changes. You cannot mix in-order arguments and keyword arguments. 00109 00110 The available fields are: 00111 byte_,char_,uint8_,int8_,uint16_,int16_,uint32_,int32_,uint64_,int64_,float32_,float64_,string_,time_,duration_,byte_v,byte_f,float64_v,float64_f,string_v,string_f,time_v,time_f,Byte_,Byte_v,ByteMultiArray_,ByteMultiArray_v 00112 00113 @param args: complete set of field values, in .msg order 00114 @param kwds: use keyword arguments corresponding to message field names 00115 to set specific fields. 00116 """ 00117 if args or kwds: 00118 super(TestDataTypes, self).__init__(*args, **kwds) 00119 #message fields cannot be None, assign default values for those that are 00120 if self.byte_ is None: 00121 self.byte_ = 0 00122 if self.char_ is None: 00123 self.char_ = 0 00124 if self.uint8_ is None: 00125 self.uint8_ = 0 00126 if self.int8_ is None: 00127 self.int8_ = 0 00128 if self.uint16_ is None: 00129 self.uint16_ = 0 00130 if self.int16_ is None: 00131 self.int16_ = 0 00132 if self.uint32_ is None: 00133 self.uint32_ = 0 00134 if self.int32_ is None: 00135 self.int32_ = 0 00136 if self.uint64_ is None: 00137 self.uint64_ = 0 00138 if self.int64_ is None: 00139 self.int64_ = 0 00140 if self.float32_ is None: 00141 self.float32_ = 0. 00142 if self.float64_ is None: 00143 self.float64_ = 0. 00144 if self.string_ is None: 00145 self.string_ = '' 00146 if self.time_ is None: 00147 self.time_ = roslib.rostime.Time() 00148 if self.duration_ is None: 00149 self.duration_ = roslib.rostime.Duration() 00150 if self.byte_v is None: 00151 self.byte_v = [] 00152 if self.byte_f is None: 00153 self.byte_f = [0,0] 00154 if self.float64_v is None: 00155 self.float64_v = [] 00156 if self.float64_f is None: 00157 self.float64_f = [0.,0.] 00158 if self.string_v is None: 00159 self.string_v = [] 00160 if self.string_f is None: 00161 self.string_f = ['',''] 00162 if self.time_v is None: 00163 self.time_v = [] 00164 if self.time_f is None: 00165 self.time_f = [roslib.rostime.Time(),roslib.rostime.Time()] 00166 if self.Byte_ is None: 00167 self.Byte_ = std_msgs.msg.Byte() 00168 if self.Byte_v is None: 00169 self.Byte_v = [] 00170 if self.ByteMultiArray_ is None: 00171 self.ByteMultiArray_ = std_msgs.msg.ByteMultiArray() 00172 if self.ByteMultiArray_v is None: 00173 self.ByteMultiArray_v = [] 00174 else: 00175 self.byte_ = 0 00176 self.char_ = 0 00177 self.uint8_ = 0 00178 self.int8_ = 0 00179 self.uint16_ = 0 00180 self.int16_ = 0 00181 self.uint32_ = 0 00182 self.int32_ = 0 00183 self.uint64_ = 0 00184 self.int64_ = 0 00185 self.float32_ = 0. 00186 self.float64_ = 0. 00187 self.string_ = '' 00188 self.time_ = roslib.rostime.Time() 00189 self.duration_ = roslib.rostime.Duration() 00190 self.byte_v = [] 00191 self.byte_f = [0,0] 00192 self.float64_v = [] 00193 self.float64_f = [0.,0.] 00194 self.string_v = [] 00195 self.string_f = ['',''] 00196 self.time_v = [] 00197 self.time_f = [roslib.rostime.Time(),roslib.rostime.Time()] 00198 self.Byte_ = std_msgs.msg.Byte() 00199 self.Byte_v = [] 00200 self.ByteMultiArray_ = std_msgs.msg.ByteMultiArray() 00201 self.ByteMultiArray_v = [] 00202 00203 def _get_types(self): 00204 """ 00205 internal API method 00206 """ 00207 return self._slot_types 00208 00209 def serialize(self, buff): 00210 """ 00211 serialize message into buffer 00212 @param buff: buffer 00213 @type buff: StringIO 00214 """ 00215 try: 00216 _x = self 00217 buff.write(_struct_b2BbHhIiQqfd.pack(_x.byte_, _x.char_, _x.uint8_, _x.int8_, _x.uint16_, _x.int16_, _x.uint32_, _x.int32_, _x.uint64_, _x.int64_, _x.float32_, _x.float64_)) 00218 _x = self.string_ 00219 length = len(_x) 00220 buff.write(struct.pack('<I%ss'%length, length, _x)) 00221 _x = self 00222 buff.write(_struct_2I2i.pack(_x.time_.secs, _x.time_.nsecs, _x.duration_.secs, _x.duration_.nsecs)) 00223 length = len(self.byte_v) 00224 buff.write(_struct_I.pack(length)) 00225 pattern = '<%sb'%length 00226 buff.write(struct.pack(pattern, *self.byte_v)) 00227 buff.write(_struct_2b.pack(*self.byte_f)) 00228 length = len(self.float64_v) 00229 buff.write(_struct_I.pack(length)) 00230 pattern = '<%sd'%length 00231 buff.write(struct.pack(pattern, *self.float64_v)) 00232 buff.write(_struct_2d.pack(*self.float64_f)) 00233 length = len(self.string_v) 00234 buff.write(_struct_I.pack(length)) 00235 for val1 in self.string_v: 00236 length = len(val1) 00237 buff.write(struct.pack('<I%ss'%length, length, val1)) 00238 for val1 in self.string_f: 00239 length = len(val1) 00240 buff.write(struct.pack('<I%ss'%length, length, val1)) 00241 length = len(self.time_v) 00242 buff.write(_struct_I.pack(length)) 00243 for val1 in self.time_v: 00244 _x = val1 00245 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00246 for val1 in self.time_f: 00247 _x = val1 00248 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00249 buff.write(_struct_b.pack(self.Byte_.data)) 00250 length = len(self.Byte_v) 00251 buff.write(_struct_I.pack(length)) 00252 for val1 in self.Byte_v: 00253 buff.write(_struct_b.pack(val1.data)) 00254 length = len(self.ByteMultiArray_.layout.dim) 00255 buff.write(_struct_I.pack(length)) 00256 for val1 in self.ByteMultiArray_.layout.dim: 00257 _x = val1.label 00258 length = len(_x) 00259 buff.write(struct.pack('<I%ss'%length, length, _x)) 00260 _x = val1 00261 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00262 buff.write(_struct_I.pack(self.ByteMultiArray_.layout.data_offset)) 00263 length = len(self.ByteMultiArray_.data) 00264 buff.write(_struct_I.pack(length)) 00265 pattern = '<%sb'%length 00266 buff.write(struct.pack(pattern, *self.ByteMultiArray_.data)) 00267 length = len(self.ByteMultiArray_v) 00268 buff.write(_struct_I.pack(length)) 00269 for val1 in self.ByteMultiArray_v: 00270 _v1 = val1.layout 00271 length = len(_v1.dim) 00272 buff.write(_struct_I.pack(length)) 00273 for val3 in _v1.dim: 00274 _x = val3.label 00275 length = len(_x) 00276 buff.write(struct.pack('<I%ss'%length, length, _x)) 00277 _x = val3 00278 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00279 buff.write(_struct_I.pack(_v1.data_offset)) 00280 length = len(val1.data) 00281 buff.write(_struct_I.pack(length)) 00282 pattern = '<%sb'%length 00283 buff.write(struct.pack(pattern, *val1.data)) 00284 except struct.error as se: self._check_types(se) 00285 except TypeError as te: self._check_types(te) 00286 00287 def deserialize(self, str): 00288 """ 00289 unpack serialized message in str into this message instance 00290 @param str: byte array of serialized message 00291 @type str: str 00292 """ 00293 try: 00294 if self.time_ is None: 00295 self.time_ = roslib.rostime.Time() 00296 if self.duration_ is None: 00297 self.duration_ = roslib.rostime.Duration() 00298 if self.Byte_ is None: 00299 self.Byte_ = std_msgs.msg.Byte() 00300 if self.ByteMultiArray_ is None: 00301 self.ByteMultiArray_ = std_msgs.msg.ByteMultiArray() 00302 end = 0 00303 _x = self 00304 start = end 00305 end += 44 00306 (_x.byte_, _x.char_, _x.uint8_, _x.int8_, _x.uint16_, _x.int16_, _x.uint32_, _x.int32_, _x.uint64_, _x.int64_, _x.float32_, _x.float64_,) = _struct_b2BbHhIiQqfd.unpack(str[start:end]) 00307 start = end 00308 end += 4 00309 (length,) = _struct_I.unpack(str[start:end]) 00310 start = end 00311 end += length 00312 self.string_ = str[start:end] 00313 _x = self 00314 start = end 00315 end += 16 00316 (_x.time_.secs, _x.time_.nsecs, _x.duration_.secs, _x.duration_.nsecs,) = _struct_2I2i.unpack(str[start:end]) 00317 start = end 00318 end += 4 00319 (length,) = _struct_I.unpack(str[start:end]) 00320 pattern = '<%sb'%length 00321 start = end 00322 end += struct.calcsize(pattern) 00323 self.byte_v = struct.unpack(pattern, str[start:end]) 00324 start = end 00325 end += 2 00326 self.byte_f = _struct_2b.unpack(str[start:end]) 00327 start = end 00328 end += 4 00329 (length,) = _struct_I.unpack(str[start:end]) 00330 pattern = '<%sd'%length 00331 start = end 00332 end += struct.calcsize(pattern) 00333 self.float64_v = struct.unpack(pattern, str[start:end]) 00334 start = end 00335 end += 16 00336 self.float64_f = _struct_2d.unpack(str[start:end]) 00337 start = end 00338 end += 4 00339 (length,) = _struct_I.unpack(str[start:end]) 00340 self.string_v = [] 00341 for i in range(0, length): 00342 start = end 00343 end += 4 00344 (length,) = _struct_I.unpack(str[start:end]) 00345 start = end 00346 end += length 00347 val1 = str[start:end] 00348 self.string_v.append(val1) 00349 self.string_f = [] 00350 for i in range(0, 2): 00351 start = end 00352 end += 4 00353 (length,) = _struct_I.unpack(str[start:end]) 00354 start = end 00355 end += length 00356 val1 = str[start:end] 00357 self.string_f.append(val1) 00358 start = end 00359 end += 4 00360 (length,) = _struct_I.unpack(str[start:end]) 00361 self.time_v = [] 00362 for i in range(0, length): 00363 val1 = roslib.rostime.Time() 00364 _x = val1 00365 start = end 00366 end += 8 00367 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00368 self.time_v.append(val1) 00369 self.time_f = [] 00370 for i in range(0, 2): 00371 val1 = roslib.rostime.Time() 00372 _x = val1 00373 start = end 00374 end += 8 00375 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00376 self.time_f.append(val1) 00377 start = end 00378 end += 1 00379 (self.Byte_.data,) = _struct_b.unpack(str[start:end]) 00380 start = end 00381 end += 4 00382 (length,) = _struct_I.unpack(str[start:end]) 00383 self.Byte_v = [] 00384 for i in range(0, length): 00385 val1 = std_msgs.msg.Byte() 00386 start = end 00387 end += 1 00388 (val1.data,) = _struct_b.unpack(str[start:end]) 00389 self.Byte_v.append(val1) 00390 start = end 00391 end += 4 00392 (length,) = _struct_I.unpack(str[start:end]) 00393 self.ByteMultiArray_.layout.dim = [] 00394 for i in range(0, length): 00395 val1 = std_msgs.msg.MultiArrayDimension() 00396 start = end 00397 end += 4 00398 (length,) = _struct_I.unpack(str[start:end]) 00399 start = end 00400 end += length 00401 val1.label = str[start:end] 00402 _x = val1 00403 start = end 00404 end += 8 00405 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00406 self.ByteMultiArray_.layout.dim.append(val1) 00407 start = end 00408 end += 4 00409 (self.ByteMultiArray_.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00410 start = end 00411 end += 4 00412 (length,) = _struct_I.unpack(str[start:end]) 00413 pattern = '<%sb'%length 00414 start = end 00415 end += struct.calcsize(pattern) 00416 self.ByteMultiArray_.data = struct.unpack(pattern, str[start:end]) 00417 start = end 00418 end += 4 00419 (length,) = _struct_I.unpack(str[start:end]) 00420 self.ByteMultiArray_v = [] 00421 for i in range(0, length): 00422 val1 = std_msgs.msg.ByteMultiArray() 00423 _v2 = val1.layout 00424 start = end 00425 end += 4 00426 (length,) = _struct_I.unpack(str[start:end]) 00427 _v2.dim = [] 00428 for i in range(0, length): 00429 val3 = std_msgs.msg.MultiArrayDimension() 00430 start = end 00431 end += 4 00432 (length,) = _struct_I.unpack(str[start:end]) 00433 start = end 00434 end += length 00435 val3.label = str[start:end] 00436 _x = val3 00437 start = end 00438 end += 8 00439 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00440 _v2.dim.append(val3) 00441 start = end 00442 end += 4 00443 (_v2.data_offset,) = _struct_I.unpack(str[start:end]) 00444 start = end 00445 end += 4 00446 (length,) = _struct_I.unpack(str[start:end]) 00447 pattern = '<%sb'%length 00448 start = end 00449 end += struct.calcsize(pattern) 00450 val1.data = struct.unpack(pattern, str[start:end]) 00451 self.ByteMultiArray_v.append(val1) 00452 self.time_.canon() 00453 self.duration_.canon() 00454 return self 00455 except struct.error as e: 00456 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00457 00458 00459 def serialize_numpy(self, buff, numpy): 00460 """ 00461 serialize message with numpy array types into buffer 00462 @param buff: buffer 00463 @type buff: StringIO 00464 @param numpy: numpy python module 00465 @type numpy module 00466 """ 00467 try: 00468 _x = self 00469 buff.write(_struct_b2BbHhIiQqfd.pack(_x.byte_, _x.char_, _x.uint8_, _x.int8_, _x.uint16_, _x.int16_, _x.uint32_, _x.int32_, _x.uint64_, _x.int64_, _x.float32_, _x.float64_)) 00470 _x = self.string_ 00471 length = len(_x) 00472 buff.write(struct.pack('<I%ss'%length, length, _x)) 00473 _x = self 00474 buff.write(_struct_2I2i.pack(_x.time_.secs, _x.time_.nsecs, _x.duration_.secs, _x.duration_.nsecs)) 00475 length = len(self.byte_v) 00476 buff.write(_struct_I.pack(length)) 00477 pattern = '<%sb'%length 00478 buff.write(self.byte_v.tostring()) 00479 buff.write(self.byte_f.tostring()) 00480 length = len(self.float64_v) 00481 buff.write(_struct_I.pack(length)) 00482 pattern = '<%sd'%length 00483 buff.write(self.float64_v.tostring()) 00484 buff.write(self.float64_f.tostring()) 00485 length = len(self.string_v) 00486 buff.write(_struct_I.pack(length)) 00487 for val1 in self.string_v: 00488 length = len(val1) 00489 buff.write(struct.pack('<I%ss'%length, length, val1)) 00490 for val1 in self.string_f: 00491 length = len(val1) 00492 buff.write(struct.pack('<I%ss'%length, length, val1)) 00493 length = len(self.time_v) 00494 buff.write(_struct_I.pack(length)) 00495 for val1 in self.time_v: 00496 _x = val1 00497 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00498 for val1 in self.time_f: 00499 _x = val1 00500 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00501 buff.write(_struct_b.pack(self.Byte_.data)) 00502 length = len(self.Byte_v) 00503 buff.write(_struct_I.pack(length)) 00504 for val1 in self.Byte_v: 00505 buff.write(_struct_b.pack(val1.data)) 00506 length = len(self.ByteMultiArray_.layout.dim) 00507 buff.write(_struct_I.pack(length)) 00508 for val1 in self.ByteMultiArray_.layout.dim: 00509 _x = val1.label 00510 length = len(_x) 00511 buff.write(struct.pack('<I%ss'%length, length, _x)) 00512 _x = val1 00513 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00514 buff.write(_struct_I.pack(self.ByteMultiArray_.layout.data_offset)) 00515 length = len(self.ByteMultiArray_.data) 00516 buff.write(_struct_I.pack(length)) 00517 pattern = '<%sb'%length 00518 buff.write(self.ByteMultiArray_.data.tostring()) 00519 length = len(self.ByteMultiArray_v) 00520 buff.write(_struct_I.pack(length)) 00521 for val1 in self.ByteMultiArray_v: 00522 _v3 = val1.layout 00523 length = len(_v3.dim) 00524 buff.write(_struct_I.pack(length)) 00525 for val3 in _v3.dim: 00526 _x = val3.label 00527 length = len(_x) 00528 buff.write(struct.pack('<I%ss'%length, length, _x)) 00529 _x = val3 00530 buff.write(_struct_2I.pack(_x.size, _x.stride)) 00531 buff.write(_struct_I.pack(_v3.data_offset)) 00532 length = len(val1.data) 00533 buff.write(_struct_I.pack(length)) 00534 pattern = '<%sb'%length 00535 buff.write(val1.data.tostring()) 00536 except struct.error as se: self._check_types(se) 00537 except TypeError as te: self._check_types(te) 00538 00539 def deserialize_numpy(self, str, numpy): 00540 """ 00541 unpack serialized message in str into this message instance using numpy for array types 00542 @param str: byte array of serialized message 00543 @type str: str 00544 @param numpy: numpy python module 00545 @type numpy: module 00546 """ 00547 try: 00548 if self.time_ is None: 00549 self.time_ = roslib.rostime.Time() 00550 if self.duration_ is None: 00551 self.duration_ = roslib.rostime.Duration() 00552 if self.Byte_ is None: 00553 self.Byte_ = std_msgs.msg.Byte() 00554 if self.ByteMultiArray_ is None: 00555 self.ByteMultiArray_ = std_msgs.msg.ByteMultiArray() 00556 end = 0 00557 _x = self 00558 start = end 00559 end += 44 00560 (_x.byte_, _x.char_, _x.uint8_, _x.int8_, _x.uint16_, _x.int16_, _x.uint32_, _x.int32_, _x.uint64_, _x.int64_, _x.float32_, _x.float64_,) = _struct_b2BbHhIiQqfd.unpack(str[start:end]) 00561 start = end 00562 end += 4 00563 (length,) = _struct_I.unpack(str[start:end]) 00564 start = end 00565 end += length 00566 self.string_ = str[start:end] 00567 _x = self 00568 start = end 00569 end += 16 00570 (_x.time_.secs, _x.time_.nsecs, _x.duration_.secs, _x.duration_.nsecs,) = _struct_2I2i.unpack(str[start:end]) 00571 start = end 00572 end += 4 00573 (length,) = _struct_I.unpack(str[start:end]) 00574 pattern = '<%sb'%length 00575 start = end 00576 end += struct.calcsize(pattern) 00577 self.byte_v = numpy.frombuffer(str[start:end], dtype=numpy.int8, count=length) 00578 start = end 00579 end += 2 00580 self.byte_f = numpy.frombuffer(str[start:end], dtype=numpy.int8, count=2) 00581 start = end 00582 end += 4 00583 (length,) = _struct_I.unpack(str[start:end]) 00584 pattern = '<%sd'%length 00585 start = end 00586 end += struct.calcsize(pattern) 00587 self.float64_v = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00588 start = end 00589 end += 16 00590 self.float64_f = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=2) 00591 start = end 00592 end += 4 00593 (length,) = _struct_I.unpack(str[start:end]) 00594 self.string_v = [] 00595 for i in range(0, length): 00596 start = end 00597 end += 4 00598 (length,) = _struct_I.unpack(str[start:end]) 00599 start = end 00600 end += length 00601 val1 = str[start:end] 00602 self.string_v.append(val1) 00603 self.string_f = [] 00604 for i in range(0, 2): 00605 start = end 00606 end += 4 00607 (length,) = _struct_I.unpack(str[start:end]) 00608 start = end 00609 end += length 00610 val1 = str[start:end] 00611 self.string_f.append(val1) 00612 start = end 00613 end += 4 00614 (length,) = _struct_I.unpack(str[start:end]) 00615 self.time_v = [] 00616 for i in range(0, length): 00617 val1 = roslib.rostime.Time() 00618 _x = val1 00619 start = end 00620 end += 8 00621 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00622 self.time_v.append(val1) 00623 self.time_f = [] 00624 for i in range(0, 2): 00625 val1 = roslib.rostime.Time() 00626 _x = val1 00627 start = end 00628 end += 8 00629 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00630 self.time_f.append(val1) 00631 start = end 00632 end += 1 00633 (self.Byte_.data,) = _struct_b.unpack(str[start:end]) 00634 start = end 00635 end += 4 00636 (length,) = _struct_I.unpack(str[start:end]) 00637 self.Byte_v = [] 00638 for i in range(0, length): 00639 val1 = std_msgs.msg.Byte() 00640 start = end 00641 end += 1 00642 (val1.data,) = _struct_b.unpack(str[start:end]) 00643 self.Byte_v.append(val1) 00644 start = end 00645 end += 4 00646 (length,) = _struct_I.unpack(str[start:end]) 00647 self.ByteMultiArray_.layout.dim = [] 00648 for i in range(0, length): 00649 val1 = std_msgs.msg.MultiArrayDimension() 00650 start = end 00651 end += 4 00652 (length,) = _struct_I.unpack(str[start:end]) 00653 start = end 00654 end += length 00655 val1.label = str[start:end] 00656 _x = val1 00657 start = end 00658 end += 8 00659 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00660 self.ByteMultiArray_.layout.dim.append(val1) 00661 start = end 00662 end += 4 00663 (self.ByteMultiArray_.layout.data_offset,) = _struct_I.unpack(str[start:end]) 00664 start = end 00665 end += 4 00666 (length,) = _struct_I.unpack(str[start:end]) 00667 pattern = '<%sb'%length 00668 start = end 00669 end += struct.calcsize(pattern) 00670 self.ByteMultiArray_.data = numpy.frombuffer(str[start:end], dtype=numpy.int8, count=length) 00671 start = end 00672 end += 4 00673 (length,) = _struct_I.unpack(str[start:end]) 00674 self.ByteMultiArray_v = [] 00675 for i in range(0, length): 00676 val1 = std_msgs.msg.ByteMultiArray() 00677 _v4 = val1.layout 00678 start = end 00679 end += 4 00680 (length,) = _struct_I.unpack(str[start:end]) 00681 _v4.dim = [] 00682 for i in range(0, length): 00683 val3 = std_msgs.msg.MultiArrayDimension() 00684 start = end 00685 end += 4 00686 (length,) = _struct_I.unpack(str[start:end]) 00687 start = end 00688 end += length 00689 val3.label = str[start:end] 00690 _x = val3 00691 start = end 00692 end += 8 00693 (_x.size, _x.stride,) = _struct_2I.unpack(str[start:end]) 00694 _v4.dim.append(val3) 00695 start = end 00696 end += 4 00697 (_v4.data_offset,) = _struct_I.unpack(str[start:end]) 00698 start = end 00699 end += 4 00700 (length,) = _struct_I.unpack(str[start:end]) 00701 pattern = '<%sb'%length 00702 start = end 00703 end += struct.calcsize(pattern) 00704 val1.data = numpy.frombuffer(str[start:end], dtype=numpy.int8, count=length) 00705 self.ByteMultiArray_v.append(val1) 00706 self.time_.canon() 00707 self.duration_.canon() 00708 return self 00709 except struct.error as e: 00710 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00711 00712 _struct_I = roslib.message.struct_I 00713 _struct_2I2i = struct.Struct("<2I2i") 00714 _struct_b = struct.Struct("<b") 00715 _struct_b2BbHhIiQqfd = struct.Struct("<b2BbHhIiQqfd") 00716 _struct_2d = struct.Struct("<2d") 00717 _struct_2b = struct.Struct("<2b") 00718 _struct_2I = struct.Struct("<2I")