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


srs_object_database_msgs
Author(s): Georg Arbeiter
autogenerated on Wed Nov 27 2013 14:14:38