_GetObjectsOnWorkspace.py
Go to the documentation of this file.
00001 """autogenerated by genpy from srs_knowledge/GetObjectsOnWorkspaceRequest.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 genpy
00008 
00009 class GetObjectsOnWorkspaceRequest(genpy.Message):
00010   _md5sum = "9af7080b172b4e34bc59169cf8be84e0"
00011   _type = "srs_knowledge/GetObjectsOnWorkspaceRequest"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """
00014 
00015 uint32 objectID
00016 
00017 duration period
00018 
00019 """
00020   __slots__ = ['objectID','period']
00021   _slot_types = ['uint32','duration']
00022 
00023   def __init__(self, *args, **kwds):
00024     """
00025     Constructor. Any message fields that are implicitly/explicitly
00026     set to None will be assigned a default value. The recommend
00027     use is keyword arguments as this is more robust to future message
00028     changes.  You cannot mix in-order arguments and keyword arguments.
00029 
00030     The available fields are:
00031        objectID,period
00032 
00033     :param args: complete set of field values, in .msg order
00034     :param kwds: use keyword arguments corresponding to message field names
00035     to set specific fields.
00036     """
00037     if args or kwds:
00038       super(GetObjectsOnWorkspaceRequest, self).__init__(*args, **kwds)
00039       #message fields cannot be None, assign default values for those that are
00040       if self.objectID is None:
00041         self.objectID = 0
00042       if self.period is None:
00043         self.period = genpy.Duration()
00044     else:
00045       self.objectID = 0
00046       self.period = genpy.Duration()
00047 
00048   def _get_types(self):
00049     """
00050     internal API method
00051     """
00052     return self._slot_types
00053 
00054   def serialize(self, buff):
00055     """
00056     serialize message into buffer
00057     :param buff: buffer, ``StringIO``
00058     """
00059     try:
00060       _x = self
00061       buff.write(_struct_I2i.pack(_x.objectID, _x.period.secs, _x.period.nsecs))
00062     except struct.error as se: self._check_types(se)
00063     except TypeError as te: self._check_types(te)
00064 
00065   def deserialize(self, str):
00066     """
00067     unpack serialized message in str into this message instance
00068     :param str: byte array of serialized message, ``str``
00069     """
00070     try:
00071       if self.period is None:
00072         self.period = genpy.Duration()
00073       end = 0
00074       _x = self
00075       start = end
00076       end += 12
00077       (_x.objectID, _x.period.secs, _x.period.nsecs,) = _struct_I2i.unpack(str[start:end])
00078       self.period.canon()
00079       return self
00080     except struct.error as e:
00081       raise genpy.DeserializationError(e) #most likely buffer underfill
00082 
00083 
00084   def serialize_numpy(self, buff, numpy):
00085     """
00086     serialize message with numpy array types into buffer
00087     :param buff: buffer, ``StringIO``
00088     :param numpy: numpy python module
00089     """
00090     try:
00091       _x = self
00092       buff.write(_struct_I2i.pack(_x.objectID, _x.period.secs, _x.period.nsecs))
00093     except struct.error as se: self._check_types(se)
00094     except TypeError as te: self._check_types(te)
00095 
00096   def deserialize_numpy(self, str, numpy):
00097     """
00098     unpack serialized message in str into this message instance using numpy for array types
00099     :param str: byte array of serialized message, ``str``
00100     :param numpy: numpy python module
00101     """
00102     try:
00103       if self.period is None:
00104         self.period = genpy.Duration()
00105       end = 0
00106       _x = self
00107       start = end
00108       end += 12
00109       (_x.objectID, _x.period.secs, _x.period.nsecs,) = _struct_I2i.unpack(str[start:end])
00110       self.period.canon()
00111       return self
00112     except struct.error as e:
00113       raise genpy.DeserializationError(e) #most likely buffer underfill
00114 
00115 _struct_I = genpy.struct_I
00116 _struct_I2i = struct.Struct("<I2i")
00117 """autogenerated by genpy from srs_knowledge/GetObjectsOnWorkspaceResponse.msg. Do not edit."""
00118 import sys
00119 python3 = True if sys.hexversion > 0x03000000 else False
00120 import genpy
00121 import struct
00122 
00123 
00124 class GetObjectsOnWorkspaceResponse(genpy.Message):
00125   _md5sum = "684a0f5cb6a10c10450acfcddc117976"
00126   _type = "srs_knowledge/GetObjectsOnWorkspaceResponse"
00127   _has_header = False #flag to mark the presence of a Header object
00128   _full_text = """
00129 uint32[] objectID
00130 
00131 uint32[] classID
00132 
00133 """
00134   __slots__ = ['objectID','classID']
00135   _slot_types = ['uint32[]','uint32[]']
00136 
00137   def __init__(self, *args, **kwds):
00138     """
00139     Constructor. Any message fields that are implicitly/explicitly
00140     set to None will be assigned a default value. The recommend
00141     use is keyword arguments as this is more robust to future message
00142     changes.  You cannot mix in-order arguments and keyword arguments.
00143 
00144     The available fields are:
00145        objectID,classID
00146 
00147     :param args: complete set of field values, in .msg order
00148     :param kwds: use keyword arguments corresponding to message field names
00149     to set specific fields.
00150     """
00151     if args or kwds:
00152       super(GetObjectsOnWorkspaceResponse, self).__init__(*args, **kwds)
00153       #message fields cannot be None, assign default values for those that are
00154       if self.objectID is None:
00155         self.objectID = []
00156       if self.classID is None:
00157         self.classID = []
00158     else:
00159       self.objectID = []
00160       self.classID = []
00161 
00162   def _get_types(self):
00163     """
00164     internal API method
00165     """
00166     return self._slot_types
00167 
00168   def serialize(self, buff):
00169     """
00170     serialize message into buffer
00171     :param buff: buffer, ``StringIO``
00172     """
00173     try:
00174       length = len(self.objectID)
00175       buff.write(_struct_I.pack(length))
00176       pattern = '<%sI'%length
00177       buff.write(struct.pack(pattern, *self.objectID))
00178       length = len(self.classID)
00179       buff.write(_struct_I.pack(length))
00180       pattern = '<%sI'%length
00181       buff.write(struct.pack(pattern, *self.classID))
00182     except struct.error as se: self._check_types(se)
00183     except TypeError as te: self._check_types(te)
00184 
00185   def deserialize(self, str):
00186     """
00187     unpack serialized message in str into this message instance
00188     :param str: byte array of serialized message, ``str``
00189     """
00190     try:
00191       end = 0
00192       start = end
00193       end += 4
00194       (length,) = _struct_I.unpack(str[start:end])
00195       pattern = '<%sI'%length
00196       start = end
00197       end += struct.calcsize(pattern)
00198       self.objectID = struct.unpack(pattern, str[start:end])
00199       start = end
00200       end += 4
00201       (length,) = _struct_I.unpack(str[start:end])
00202       pattern = '<%sI'%length
00203       start = end
00204       end += struct.calcsize(pattern)
00205       self.classID = struct.unpack(pattern, str[start:end])
00206       return self
00207     except struct.error as e:
00208       raise genpy.DeserializationError(e) #most likely buffer underfill
00209 
00210 
00211   def serialize_numpy(self, buff, numpy):
00212     """
00213     serialize message with numpy array types into buffer
00214     :param buff: buffer, ``StringIO``
00215     :param numpy: numpy python module
00216     """
00217     try:
00218       length = len(self.objectID)
00219       buff.write(_struct_I.pack(length))
00220       pattern = '<%sI'%length
00221       buff.write(self.objectID.tostring())
00222       length = len(self.classID)
00223       buff.write(_struct_I.pack(length))
00224       pattern = '<%sI'%length
00225       buff.write(self.classID.tostring())
00226     except struct.error as se: self._check_types(se)
00227     except TypeError as te: self._check_types(te)
00228 
00229   def deserialize_numpy(self, str, numpy):
00230     """
00231     unpack serialized message in str into this message instance using numpy for array types
00232     :param str: byte array of serialized message, ``str``
00233     :param numpy: numpy python module
00234     """
00235     try:
00236       end = 0
00237       start = end
00238       end += 4
00239       (length,) = _struct_I.unpack(str[start:end])
00240       pattern = '<%sI'%length
00241       start = end
00242       end += struct.calcsize(pattern)
00243       self.objectID = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
00244       start = end
00245       end += 4
00246       (length,) = _struct_I.unpack(str[start:end])
00247       pattern = '<%sI'%length
00248       start = end
00249       end += struct.calcsize(pattern)
00250       self.classID = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
00251       return self
00252     except struct.error as e:
00253       raise genpy.DeserializationError(e) #most likely buffer underfill
00254 
00255 _struct_I = genpy.struct_I
00256 class GetObjectsOnWorkspace(object):
00257   _type          = 'srs_knowledge/GetObjectsOnWorkspace'
00258   _md5sum = '5e500ec108cddc2dd57cc12861677d26'
00259   _request_class  = GetObjectsOnWorkspaceRequest
00260   _response_class = GetObjectsOnWorkspaceResponse


srs_knowledge
Author(s): Ze Ji
autogenerated on Sun Jan 5 2014 12:03:26