$search
00001 """autogenerated by genmsg_py from surf.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 import std_msgs.msg 00007 import sensor_msgs.msg 00008 00009 class surf(roslib.message.Message): 00010 _md5sum = "0faab423389dc07fa3f21ffd5950aa25" 00011 _type = "srs_object_database_msgs/surf" 00012 _has_header = False #flag to mark the presence of a Header object 00013 _full_text = """int32 objectId 00014 sensor_msgs/PointCloud2 surf 00015 sensor_msgs/PointCloud2 bounding_box 00016 geometry_msgs/Pose coord_frame 00017 00018 ================================================================================ 00019 MSG: sensor_msgs/PointCloud2 00020 # This message holds a collection of N-dimensional points, which may 00021 # contain additional information such as normals, intensity, etc. The 00022 # point data is stored as a binary blob, its layout described by the 00023 # contents of the "fields" array. 00024 00025 # The point cloud data may be organized 2d (image-like) or 1d 00026 # (unordered). Point clouds organized as 2d images may be produced by 00027 # camera depth sensors such as stereo or time-of-flight. 00028 00029 # Time of sensor data acquisition, and the coordinate frame ID (for 3d 00030 # points). 00031 Header header 00032 00033 # 2D structure of the point cloud. If the cloud is unordered, height is 00034 # 1 and width is the length of the point cloud. 00035 uint32 height 00036 uint32 width 00037 00038 # Describes the channels and their layout in the binary data blob. 00039 PointField[] fields 00040 00041 bool is_bigendian # Is this data bigendian? 00042 uint32 point_step # Length of a point in bytes 00043 uint32 row_step # Length of a row in bytes 00044 uint8[] data # Actual point data, size is (row_step*height) 00045 00046 bool is_dense # True if there are no invalid points 00047 00048 ================================================================================ 00049 MSG: std_msgs/Header 00050 # Standard metadata for higher-level stamped data types. 00051 # This is generally used to communicate timestamped data 00052 # in a particular coordinate frame. 00053 # 00054 # sequence ID: consecutively increasing ID 00055 uint32 seq 00056 #Two-integer timestamp that is expressed as: 00057 # * stamp.secs: seconds (stamp_secs) since epoch 00058 # * stamp.nsecs: nanoseconds since stamp_secs 00059 # time-handling sugar is provided by the client library 00060 time stamp 00061 #Frame this data is associated with 00062 # 0: no frame 00063 # 1: global frame 00064 string frame_id 00065 00066 ================================================================================ 00067 MSG: sensor_msgs/PointField 00068 # This message holds the description of one point entry in the 00069 # PointCloud2 message format. 00070 uint8 INT8 = 1 00071 uint8 UINT8 = 2 00072 uint8 INT16 = 3 00073 uint8 UINT16 = 4 00074 uint8 INT32 = 5 00075 uint8 UINT32 = 6 00076 uint8 FLOAT32 = 7 00077 uint8 FLOAT64 = 8 00078 00079 string name # Name of field 00080 uint32 offset # Offset from start of point struct 00081 uint8 datatype # Datatype enumeration, see above 00082 uint32 count # How many elements in the field 00083 00084 ================================================================================ 00085 MSG: geometry_msgs/Pose 00086 # A representation of pose in free space, composed of postion and orientation. 00087 Point position 00088 Quaternion orientation 00089 00090 ================================================================================ 00091 MSG: geometry_msgs/Point 00092 # This contains the position of a point in free space 00093 float64 x 00094 float64 y 00095 float64 z 00096 00097 ================================================================================ 00098 MSG: geometry_msgs/Quaternion 00099 # This represents an orientation in free space in quaternion form. 00100 00101 float64 x 00102 float64 y 00103 float64 z 00104 float64 w 00105 00106 """ 00107 __slots__ = ['objectId','surf','bounding_box','coord_frame'] 00108 _slot_types = ['int32','sensor_msgs/PointCloud2','sensor_msgs/PointCloud2','geometry_msgs/Pose'] 00109 00110 def __init__(self, *args, **kwds): 00111 """ 00112 Constructor. Any message fields that are implicitly/explicitly 00113 set to None will be assigned a default value. The recommend 00114 use is keyword arguments as this is more robust to future message 00115 changes. You cannot mix in-order arguments and keyword arguments. 00116 00117 The available fields are: 00118 objectId,surf,bounding_box,coord_frame 00119 00120 @param args: complete set of field values, in .msg order 00121 @param kwds: use keyword arguments corresponding to message field names 00122 to set specific fields. 00123 """ 00124 if args or kwds: 00125 super(surf, self).__init__(*args, **kwds) 00126 #message fields cannot be None, assign default values for those that are 00127 if self.objectId is None: 00128 self.objectId = 0 00129 if self.surf is None: 00130 self.surf = sensor_msgs.msg.PointCloud2() 00131 if self.bounding_box is None: 00132 self.bounding_box = sensor_msgs.msg.PointCloud2() 00133 if self.coord_frame is None: 00134 self.coord_frame = geometry_msgs.msg.Pose() 00135 else: 00136 self.objectId = 0 00137 self.surf = sensor_msgs.msg.PointCloud2() 00138 self.bounding_box = sensor_msgs.msg.PointCloud2() 00139 self.coord_frame = geometry_msgs.msg.Pose() 00140 00141 def _get_types(self): 00142 """ 00143 internal API method 00144 """ 00145 return self._slot_types 00146 00147 def serialize(self, buff): 00148 """ 00149 serialize message into buffer 00150 @param buff: buffer 00151 @type buff: StringIO 00152 """ 00153 try: 00154 _x = self 00155 buff.write(_struct_i3I.pack(_x.objectId, _x.surf.header.seq, _x.surf.header.stamp.secs, _x.surf.header.stamp.nsecs)) 00156 _x = self.surf.header.frame_id 00157 length = len(_x) 00158 buff.write(struct.pack('<I%ss'%length, length, _x)) 00159 _x = self 00160 buff.write(_struct_2I.pack(_x.surf.height, _x.surf.width)) 00161 length = len(self.surf.fields) 00162 buff.write(_struct_I.pack(length)) 00163 for val1 in self.surf.fields: 00164 _x = val1.name 00165 length = len(_x) 00166 buff.write(struct.pack('<I%ss'%length, length, _x)) 00167 _x = val1 00168 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00169 _x = self 00170 buff.write(_struct_B2I.pack(_x.surf.is_bigendian, _x.surf.point_step, _x.surf.row_step)) 00171 _x = self.surf.data 00172 length = len(_x) 00173 # - if encoded as a list instead, serialize as bytes instead of string 00174 if type(_x) in [list, tuple]: 00175 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00176 else: 00177 buff.write(struct.pack('<I%ss'%length, length, _x)) 00178 _x = self 00179 buff.write(_struct_B3I.pack(_x.surf.is_dense, _x.bounding_box.header.seq, _x.bounding_box.header.stamp.secs, _x.bounding_box.header.stamp.nsecs)) 00180 _x = self.bounding_box.header.frame_id 00181 length = len(_x) 00182 buff.write(struct.pack('<I%ss'%length, length, _x)) 00183 _x = self 00184 buff.write(_struct_2I.pack(_x.bounding_box.height, _x.bounding_box.width)) 00185 length = len(self.bounding_box.fields) 00186 buff.write(_struct_I.pack(length)) 00187 for val1 in self.bounding_box.fields: 00188 _x = val1.name 00189 length = len(_x) 00190 buff.write(struct.pack('<I%ss'%length, length, _x)) 00191 _x = val1 00192 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00193 _x = self 00194 buff.write(_struct_B2I.pack(_x.bounding_box.is_bigendian, _x.bounding_box.point_step, _x.bounding_box.row_step)) 00195 _x = self.bounding_box.data 00196 length = len(_x) 00197 # - if encoded as a list instead, serialize as bytes instead of string 00198 if type(_x) in [list, tuple]: 00199 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00200 else: 00201 buff.write(struct.pack('<I%ss'%length, length, _x)) 00202 _x = self 00203 buff.write(_struct_B7d.pack(_x.bounding_box.is_dense, _x.coord_frame.position.x, _x.coord_frame.position.y, _x.coord_frame.position.z, _x.coord_frame.orientation.x, _x.coord_frame.orientation.y, _x.coord_frame.orientation.z, _x.coord_frame.orientation.w)) 00204 except struct.error as se: self._check_types(se) 00205 except TypeError as te: self._check_types(te) 00206 00207 def deserialize(self, str): 00208 """ 00209 unpack serialized message in str into this message instance 00210 @param str: byte array of serialized message 00211 @type str: str 00212 """ 00213 try: 00214 if self.surf is None: 00215 self.surf = sensor_msgs.msg.PointCloud2() 00216 if self.bounding_box is None: 00217 self.bounding_box = sensor_msgs.msg.PointCloud2() 00218 if self.coord_frame is None: 00219 self.coord_frame = geometry_msgs.msg.Pose() 00220 end = 0 00221 _x = self 00222 start = end 00223 end += 16 00224 (_x.objectId, _x.surf.header.seq, _x.surf.header.stamp.secs, _x.surf.header.stamp.nsecs,) = _struct_i3I.unpack(str[start:end]) 00225 start = end 00226 end += 4 00227 (length,) = _struct_I.unpack(str[start:end]) 00228 start = end 00229 end += length 00230 self.surf.header.frame_id = str[start:end] 00231 _x = self 00232 start = end 00233 end += 8 00234 (_x.surf.height, _x.surf.width,) = _struct_2I.unpack(str[start:end]) 00235 start = end 00236 end += 4 00237 (length,) = _struct_I.unpack(str[start:end]) 00238 self.surf.fields = [] 00239 for i in range(0, length): 00240 val1 = sensor_msgs.msg.PointField() 00241 start = end 00242 end += 4 00243 (length,) = _struct_I.unpack(str[start:end]) 00244 start = end 00245 end += length 00246 val1.name = str[start:end] 00247 _x = val1 00248 start = end 00249 end += 9 00250 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00251 self.surf.fields.append(val1) 00252 _x = self 00253 start = end 00254 end += 9 00255 (_x.surf.is_bigendian, _x.surf.point_step, _x.surf.row_step,) = _struct_B2I.unpack(str[start:end]) 00256 self.surf.is_bigendian = bool(self.surf.is_bigendian) 00257 start = end 00258 end += 4 00259 (length,) = _struct_I.unpack(str[start:end]) 00260 start = end 00261 end += length 00262 self.surf.data = str[start:end] 00263 _x = self 00264 start = end 00265 end += 13 00266 (_x.surf.is_dense, _x.bounding_box.header.seq, _x.bounding_box.header.stamp.secs, _x.bounding_box.header.stamp.nsecs,) = _struct_B3I.unpack(str[start:end]) 00267 self.surf.is_dense = bool(self.surf.is_dense) 00268 start = end 00269 end += 4 00270 (length,) = _struct_I.unpack(str[start:end]) 00271 start = end 00272 end += length 00273 self.bounding_box.header.frame_id = str[start:end] 00274 _x = self 00275 start = end 00276 end += 8 00277 (_x.bounding_box.height, _x.bounding_box.width,) = _struct_2I.unpack(str[start:end]) 00278 start = end 00279 end += 4 00280 (length,) = _struct_I.unpack(str[start:end]) 00281 self.bounding_box.fields = [] 00282 for i in range(0, length): 00283 val1 = sensor_msgs.msg.PointField() 00284 start = end 00285 end += 4 00286 (length,) = _struct_I.unpack(str[start:end]) 00287 start = end 00288 end += length 00289 val1.name = str[start:end] 00290 _x = val1 00291 start = end 00292 end += 9 00293 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00294 self.bounding_box.fields.append(val1) 00295 _x = self 00296 start = end 00297 end += 9 00298 (_x.bounding_box.is_bigendian, _x.bounding_box.point_step, _x.bounding_box.row_step,) = _struct_B2I.unpack(str[start:end]) 00299 self.bounding_box.is_bigendian = bool(self.bounding_box.is_bigendian) 00300 start = end 00301 end += 4 00302 (length,) = _struct_I.unpack(str[start:end]) 00303 start = end 00304 end += length 00305 self.bounding_box.data = str[start:end] 00306 _x = self 00307 start = end 00308 end += 57 00309 (_x.bounding_box.is_dense, _x.coord_frame.position.x, _x.coord_frame.position.y, _x.coord_frame.position.z, _x.coord_frame.orientation.x, _x.coord_frame.orientation.y, _x.coord_frame.orientation.z, _x.coord_frame.orientation.w,) = _struct_B7d.unpack(str[start:end]) 00310 self.bounding_box.is_dense = bool(self.bounding_box.is_dense) 00311 return self 00312 except struct.error as e: 00313 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00314 00315 00316 def serialize_numpy(self, buff, numpy): 00317 """ 00318 serialize message with numpy array types into buffer 00319 @param buff: buffer 00320 @type buff: StringIO 00321 @param numpy: numpy python module 00322 @type numpy module 00323 """ 00324 try: 00325 _x = self 00326 buff.write(_struct_i3I.pack(_x.objectId, _x.surf.header.seq, _x.surf.header.stamp.secs, _x.surf.header.stamp.nsecs)) 00327 _x = self.surf.header.frame_id 00328 length = len(_x) 00329 buff.write(struct.pack('<I%ss'%length, length, _x)) 00330 _x = self 00331 buff.write(_struct_2I.pack(_x.surf.height, _x.surf.width)) 00332 length = len(self.surf.fields) 00333 buff.write(_struct_I.pack(length)) 00334 for val1 in self.surf.fields: 00335 _x = val1.name 00336 length = len(_x) 00337 buff.write(struct.pack('<I%ss'%length, length, _x)) 00338 _x = val1 00339 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00340 _x = self 00341 buff.write(_struct_B2I.pack(_x.surf.is_bigendian, _x.surf.point_step, _x.surf.row_step)) 00342 _x = self.surf.data 00343 length = len(_x) 00344 # - if encoded as a list instead, serialize as bytes instead of string 00345 if type(_x) in [list, tuple]: 00346 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00347 else: 00348 buff.write(struct.pack('<I%ss'%length, length, _x)) 00349 _x = self 00350 buff.write(_struct_B3I.pack(_x.surf.is_dense, _x.bounding_box.header.seq, _x.bounding_box.header.stamp.secs, _x.bounding_box.header.stamp.nsecs)) 00351 _x = self.bounding_box.header.frame_id 00352 length = len(_x) 00353 buff.write(struct.pack('<I%ss'%length, length, _x)) 00354 _x = self 00355 buff.write(_struct_2I.pack(_x.bounding_box.height, _x.bounding_box.width)) 00356 length = len(self.bounding_box.fields) 00357 buff.write(_struct_I.pack(length)) 00358 for val1 in self.bounding_box.fields: 00359 _x = val1.name 00360 length = len(_x) 00361 buff.write(struct.pack('<I%ss'%length, length, _x)) 00362 _x = val1 00363 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00364 _x = self 00365 buff.write(_struct_B2I.pack(_x.bounding_box.is_bigendian, _x.bounding_box.point_step, _x.bounding_box.row_step)) 00366 _x = self.bounding_box.data 00367 length = len(_x) 00368 # - if encoded as a list instead, serialize as bytes instead of string 00369 if type(_x) in [list, tuple]: 00370 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00371 else: 00372 buff.write(struct.pack('<I%ss'%length, length, _x)) 00373 _x = self 00374 buff.write(_struct_B7d.pack(_x.bounding_box.is_dense, _x.coord_frame.position.x, _x.coord_frame.position.y, _x.coord_frame.position.z, _x.coord_frame.orientation.x, _x.coord_frame.orientation.y, _x.coord_frame.orientation.z, _x.coord_frame.orientation.w)) 00375 except struct.error as se: self._check_types(se) 00376 except TypeError as te: self._check_types(te) 00377 00378 def deserialize_numpy(self, str, numpy): 00379 """ 00380 unpack serialized message in str into this message instance using numpy for array types 00381 @param str: byte array of serialized message 00382 @type str: str 00383 @param numpy: numpy python module 00384 @type numpy: module 00385 """ 00386 try: 00387 if self.surf is None: 00388 self.surf = sensor_msgs.msg.PointCloud2() 00389 if self.bounding_box is None: 00390 self.bounding_box = sensor_msgs.msg.PointCloud2() 00391 if self.coord_frame is None: 00392 self.coord_frame = geometry_msgs.msg.Pose() 00393 end = 0 00394 _x = self 00395 start = end 00396 end += 16 00397 (_x.objectId, _x.surf.header.seq, _x.surf.header.stamp.secs, _x.surf.header.stamp.nsecs,) = _struct_i3I.unpack(str[start:end]) 00398 start = end 00399 end += 4 00400 (length,) = _struct_I.unpack(str[start:end]) 00401 start = end 00402 end += length 00403 self.surf.header.frame_id = str[start:end] 00404 _x = self 00405 start = end 00406 end += 8 00407 (_x.surf.height, _x.surf.width,) = _struct_2I.unpack(str[start:end]) 00408 start = end 00409 end += 4 00410 (length,) = _struct_I.unpack(str[start:end]) 00411 self.surf.fields = [] 00412 for i in range(0, length): 00413 val1 = sensor_msgs.msg.PointField() 00414 start = end 00415 end += 4 00416 (length,) = _struct_I.unpack(str[start:end]) 00417 start = end 00418 end += length 00419 val1.name = str[start:end] 00420 _x = val1 00421 start = end 00422 end += 9 00423 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00424 self.surf.fields.append(val1) 00425 _x = self 00426 start = end 00427 end += 9 00428 (_x.surf.is_bigendian, _x.surf.point_step, _x.surf.row_step,) = _struct_B2I.unpack(str[start:end]) 00429 self.surf.is_bigendian = bool(self.surf.is_bigendian) 00430 start = end 00431 end += 4 00432 (length,) = _struct_I.unpack(str[start:end]) 00433 start = end 00434 end += length 00435 self.surf.data = str[start:end] 00436 _x = self 00437 start = end 00438 end += 13 00439 (_x.surf.is_dense, _x.bounding_box.header.seq, _x.bounding_box.header.stamp.secs, _x.bounding_box.header.stamp.nsecs,) = _struct_B3I.unpack(str[start:end]) 00440 self.surf.is_dense = bool(self.surf.is_dense) 00441 start = end 00442 end += 4 00443 (length,) = _struct_I.unpack(str[start:end]) 00444 start = end 00445 end += length 00446 self.bounding_box.header.frame_id = str[start:end] 00447 _x = self 00448 start = end 00449 end += 8 00450 (_x.bounding_box.height, _x.bounding_box.width,) = _struct_2I.unpack(str[start:end]) 00451 start = end 00452 end += 4 00453 (length,) = _struct_I.unpack(str[start:end]) 00454 self.bounding_box.fields = [] 00455 for i in range(0, length): 00456 val1 = sensor_msgs.msg.PointField() 00457 start = end 00458 end += 4 00459 (length,) = _struct_I.unpack(str[start:end]) 00460 start = end 00461 end += length 00462 val1.name = str[start:end] 00463 _x = val1 00464 start = end 00465 end += 9 00466 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00467 self.bounding_box.fields.append(val1) 00468 _x = self 00469 start = end 00470 end += 9 00471 (_x.bounding_box.is_bigendian, _x.bounding_box.point_step, _x.bounding_box.row_step,) = _struct_B2I.unpack(str[start:end]) 00472 self.bounding_box.is_bigendian = bool(self.bounding_box.is_bigendian) 00473 start = end 00474 end += 4 00475 (length,) = _struct_I.unpack(str[start:end]) 00476 start = end 00477 end += length 00478 self.bounding_box.data = str[start:end] 00479 _x = self 00480 start = end 00481 end += 57 00482 (_x.bounding_box.is_dense, _x.coord_frame.position.x, _x.coord_frame.position.y, _x.coord_frame.position.z, _x.coord_frame.orientation.x, _x.coord_frame.orientation.y, _x.coord_frame.orientation.z, _x.coord_frame.orientation.w,) = _struct_B7d.unpack(str[start:end]) 00483 self.bounding_box.is_dense = bool(self.bounding_box.is_dense) 00484 return self 00485 except struct.error as e: 00486 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00487 00488 _struct_I = roslib.message.struct_I 00489 _struct_IBI = struct.Struct("<IBI") 00490 _struct_i3I = struct.Struct("<i3I") 00491 _struct_B7d = struct.Struct("<B7d") 00492 _struct_B3I = struct.Struct("<B3I") 00493 _struct_B2I = struct.Struct("<B2I") 00494 _struct_2I = struct.Struct("<2I")