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


point_cloud_server
Author(s): Adam Leeper
autogenerated on Mon Oct 6 2014 03:01:14