_PanoCaptureResult.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pano_ros/PanoCaptureResult.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 PanoCaptureResult(genpy.Message):
00009   _md5sum = "7d1ff824dbed21bb16f220c4d06a45fb"
00010   _type = "pano_ros/PanoCaptureResult"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00013 # Define the result
00014 uint32 pano_id
00015 uint32 n_captures
00016 string bag_filename
00017 
00018 """
00019   __slots__ = ['pano_id','n_captures','bag_filename']
00020   _slot_types = ['uint32','uint32','string']
00021 
00022   def __init__(self, *args, **kwds):
00023     """
00024     Constructor. Any message fields that are implicitly/explicitly
00025     set to None will be assigned a default value. The recommend
00026     use is keyword arguments as this is more robust to future message
00027     changes.  You cannot mix in-order arguments and keyword arguments.
00028 
00029     The available fields are:
00030        pano_id,n_captures,bag_filename
00031 
00032     :param args: complete set of field values, in .msg order
00033     :param kwds: use keyword arguments corresponding to message field names
00034     to set specific fields.
00035     """
00036     if args or kwds:
00037       super(PanoCaptureResult, self).__init__(*args, **kwds)
00038       #message fields cannot be None, assign default values for those that are
00039       if self.pano_id is None:
00040         self.pano_id = 0
00041       if self.n_captures is None:
00042         self.n_captures = 0
00043       if self.bag_filename is None:
00044         self.bag_filename = ''
00045     else:
00046       self.pano_id = 0
00047       self.n_captures = 0
00048       self.bag_filename = ''
00049 
00050   def _get_types(self):
00051     """
00052     internal API method
00053     """
00054     return self._slot_types
00055 
00056   def serialize(self, buff):
00057     """
00058     serialize message into buffer
00059     :param buff: buffer, ``StringIO``
00060     """
00061     try:
00062       _x = self
00063       buff.write(_struct_2I.pack(_x.pano_id, _x.n_captures))
00064       _x = self.bag_filename
00065       length = len(_x)
00066       if python3 or type(_x) == unicode:
00067         _x = _x.encode('utf-8')
00068         length = len(_x)
00069       buff.write(struct.pack('<I%ss'%length, length, _x))
00070     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00071     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00072 
00073   def deserialize(self, str):
00074     """
00075     unpack serialized message in str into this message instance
00076     :param str: byte array of serialized message, ``str``
00077     """
00078     try:
00079       end = 0
00080       _x = self
00081       start = end
00082       end += 8
00083       (_x.pano_id, _x.n_captures,) = _struct_2I.unpack(str[start:end])
00084       start = end
00085       end += 4
00086       (length,) = _struct_I.unpack(str[start:end])
00087       start = end
00088       end += length
00089       if python3:
00090         self.bag_filename = str[start:end].decode('utf-8')
00091       else:
00092         self.bag_filename = str[start:end]
00093       return self
00094     except struct.error as e:
00095       raise genpy.DeserializationError(e) #most likely buffer underfill
00096 
00097 
00098   def serialize_numpy(self, buff, numpy):
00099     """
00100     serialize message with numpy array types into buffer
00101     :param buff: buffer, ``StringIO``
00102     :param numpy: numpy python module
00103     """
00104     try:
00105       _x = self
00106       buff.write(_struct_2I.pack(_x.pano_id, _x.n_captures))
00107       _x = self.bag_filename
00108       length = len(_x)
00109       if python3 or type(_x) == unicode:
00110         _x = _x.encode('utf-8')
00111         length = len(_x)
00112       buff.write(struct.pack('<I%ss'%length, length, _x))
00113     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00114     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00115 
00116   def deserialize_numpy(self, str, numpy):
00117     """
00118     unpack serialized message in str into this message instance using numpy for array types
00119     :param str: byte array of serialized message, ``str``
00120     :param numpy: numpy python module
00121     """
00122     try:
00123       end = 0
00124       _x = self
00125       start = end
00126       end += 8
00127       (_x.pano_id, _x.n_captures,) = _struct_2I.unpack(str[start:end])
00128       start = end
00129       end += 4
00130       (length,) = _struct_I.unpack(str[start:end])
00131       start = end
00132       end += length
00133       if python3:
00134         self.bag_filename = str[start:end].decode('utf-8')
00135       else:
00136         self.bag_filename = str[start:end]
00137       return self
00138     except struct.error as e:
00139       raise genpy.DeserializationError(e) #most likely buffer underfill
00140 
00141 _struct_I = genpy.struct_I
00142 _struct_2I = struct.Struct("<2I")


pano_ros
Author(s): Ethan Rublee, Ken Conley
autogenerated on Mon Oct 6 2014 08:06:11