_GetRobotInfo.py
Go to the documentation of this file.
00001 """autogenerated by genpy from industrial_msgs/GetRobotInfoRequest.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 GetRobotInfoRequest(genpy.Message):
00009   _md5sum = "d41d8cd98f00b204e9800998ecf8427e"
00010   _type = "industrial_msgs/GetRobotInfoRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 
00014 
00015 
00016 """
00017   __slots__ = []
00018   _slot_types = []
00019 
00020   def __init__(self, *args, **kwds):
00021     """
00022     Constructor. Any message fields that are implicitly/explicitly
00023     set to None will be assigned a default value. The recommend
00024     use is keyword arguments as this is more robust to future message
00025     changes.  You cannot mix in-order arguments and keyword arguments.
00026 
00027     The available fields are:
00028        
00029 
00030     :param args: complete set of field values, in .msg order
00031     :param kwds: use keyword arguments corresponding to message field names
00032     to set specific fields.
00033     """
00034     if args or kwds:
00035       super(GetRobotInfoRequest, self).__init__(*args, **kwds)
00036 
00037   def _get_types(self):
00038     """
00039     internal API method
00040     """
00041     return self._slot_types
00042 
00043   def serialize(self, buff):
00044     """
00045     serialize message into buffer
00046     :param buff: buffer, ``StringIO``
00047     """
00048     try:
00049       pass
00050     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00051     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00052 
00053   def deserialize(self, str):
00054     """
00055     unpack serialized message in str into this message instance
00056     :param str: byte array of serialized message, ``str``
00057     """
00058     try:
00059       end = 0
00060       return self
00061     except struct.error as e:
00062       raise genpy.DeserializationError(e) #most likely buffer underfill
00063 
00064 
00065   def serialize_numpy(self, buff, numpy):
00066     """
00067     serialize message with numpy array types into buffer
00068     :param buff: buffer, ``StringIO``
00069     :param numpy: numpy python module
00070     """
00071     try:
00072       pass
00073     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00074     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00075 
00076   def deserialize_numpy(self, str, numpy):
00077     """
00078     unpack serialized message in str into this message instance using numpy for array types
00079     :param str: byte array of serialized message, ``str``
00080     :param numpy: numpy python module
00081     """
00082     try:
00083       end = 0
00084       return self
00085     except struct.error as e:
00086       raise genpy.DeserializationError(e) #most likely buffer underfill
00087 
00088 _struct_I = genpy.struct_I
00089 """autogenerated by genpy from industrial_msgs/GetRobotInfoResponse.msg. Do not edit."""
00090 import sys
00091 python3 = True if sys.hexversion > 0x03000000 else False
00092 import genpy
00093 import struct
00094 
00095 import industrial_msgs.msg
00096 
00097 class GetRobotInfoResponse(genpy.Message):
00098   _md5sum = "5db3230b3e61c85a320b999ffd7f3b3f"
00099   _type = "industrial_msgs/GetRobotInfoResponse"
00100   _has_header = False #flag to mark the presence of a Header object
00101   _full_text = """industrial_msgs/DeviceInfo controller
00102 industrial_msgs/DeviceInfo[] robots
00103 industrial_msgs/ServiceReturnCode code
00104 
00105 
00106 ================================================================================
00107 MSG: industrial_msgs/DeviceInfo
00108 # Device info captures device agnostic information about a piece of hardware.
00109 # This message is meant as a generic as possible.  Items that don't apply should
00110 # be left blank.  This message is not meant to replace diagnostic messages, but
00111 # rather provide a standard service message that can be used to populate standard
00112 # components (like a GUI for example)
00113 
00114 string model
00115 string serial_number
00116 string hw_version
00117 string sw_version
00118 string address
00119 
00120 ================================================================================
00121 MSG: industrial_msgs/ServiceReturnCode
00122 # Service return codes for simple requests.  All ROS-Industrial service
00123 # replies are required to have a return code indicating success or failure
00124 # Specific return codes for different failure should be negative.
00125 int8 val
00126 
00127 int8 SUCCESS = 1
00128 int8 FAILURE = -1
00129 
00130 
00131 """
00132   __slots__ = ['controller','robots','code']
00133   _slot_types = ['industrial_msgs/DeviceInfo','industrial_msgs/DeviceInfo[]','industrial_msgs/ServiceReturnCode']
00134 
00135   def __init__(self, *args, **kwds):
00136     """
00137     Constructor. Any message fields that are implicitly/explicitly
00138     set to None will be assigned a default value. The recommend
00139     use is keyword arguments as this is more robust to future message
00140     changes.  You cannot mix in-order arguments and keyword arguments.
00141 
00142     The available fields are:
00143        controller,robots,code
00144 
00145     :param args: complete set of field values, in .msg order
00146     :param kwds: use keyword arguments corresponding to message field names
00147     to set specific fields.
00148     """
00149     if args or kwds:
00150       super(GetRobotInfoResponse, self).__init__(*args, **kwds)
00151       #message fields cannot be None, assign default values for those that are
00152       if self.controller is None:
00153         self.controller = industrial_msgs.msg.DeviceInfo()
00154       if self.robots is None:
00155         self.robots = []
00156       if self.code is None:
00157         self.code = industrial_msgs.msg.ServiceReturnCode()
00158     else:
00159       self.controller = industrial_msgs.msg.DeviceInfo()
00160       self.robots = []
00161       self.code = industrial_msgs.msg.ServiceReturnCode()
00162 
00163   def _get_types(self):
00164     """
00165     internal API method
00166     """
00167     return self._slot_types
00168 
00169   def serialize(self, buff):
00170     """
00171     serialize message into buffer
00172     :param buff: buffer, ``StringIO``
00173     """
00174     try:
00175       _x = self.controller.model
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.controller.serial_number
00182       length = len(_x)
00183       if python3 or type(_x) == unicode:
00184         _x = _x.encode('utf-8')
00185         length = len(_x)
00186       buff.write(struct.pack('<I%ss'%length, length, _x))
00187       _x = self.controller.hw_version
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.controller.sw_version
00194       length = len(_x)
00195       if python3 or type(_x) == unicode:
00196         _x = _x.encode('utf-8')
00197         length = len(_x)
00198       buff.write(struct.pack('<I%ss'%length, length, _x))
00199       _x = self.controller.address
00200       length = len(_x)
00201       if python3 or type(_x) == unicode:
00202         _x = _x.encode('utf-8')
00203         length = len(_x)
00204       buff.write(struct.pack('<I%ss'%length, length, _x))
00205       length = len(self.robots)
00206       buff.write(_struct_I.pack(length))
00207       for val1 in self.robots:
00208         _x = val1.model
00209         length = len(_x)
00210         if python3 or type(_x) == unicode:
00211           _x = _x.encode('utf-8')
00212           length = len(_x)
00213         buff.write(struct.pack('<I%ss'%length, length, _x))
00214         _x = val1.serial_number
00215         length = len(_x)
00216         if python3 or type(_x) == unicode:
00217           _x = _x.encode('utf-8')
00218           length = len(_x)
00219         buff.write(struct.pack('<I%ss'%length, length, _x))
00220         _x = val1.hw_version
00221         length = len(_x)
00222         if python3 or type(_x) == unicode:
00223           _x = _x.encode('utf-8')
00224           length = len(_x)
00225         buff.write(struct.pack('<I%ss'%length, length, _x))
00226         _x = val1.sw_version
00227         length = len(_x)
00228         if python3 or type(_x) == unicode:
00229           _x = _x.encode('utf-8')
00230           length = len(_x)
00231         buff.write(struct.pack('<I%ss'%length, length, _x))
00232         _x = val1.address
00233         length = len(_x)
00234         if python3 or type(_x) == unicode:
00235           _x = _x.encode('utf-8')
00236           length = len(_x)
00237         buff.write(struct.pack('<I%ss'%length, length, _x))
00238       buff.write(_struct_b.pack(self.code.val))
00239     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00240     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00241 
00242   def deserialize(self, str):
00243     """
00244     unpack serialized message in str into this message instance
00245     :param str: byte array of serialized message, ``str``
00246     """
00247     try:
00248       if self.controller is None:
00249         self.controller = industrial_msgs.msg.DeviceInfo()
00250       if self.robots is None:
00251         self.robots = None
00252       if self.code is None:
00253         self.code = industrial_msgs.msg.ServiceReturnCode()
00254       end = 0
00255       start = end
00256       end += 4
00257       (length,) = _struct_I.unpack(str[start:end])
00258       start = end
00259       end += length
00260       if python3:
00261         self.controller.model = str[start:end].decode('utf-8')
00262       else:
00263         self.controller.model = str[start:end]
00264       start = end
00265       end += 4
00266       (length,) = _struct_I.unpack(str[start:end])
00267       start = end
00268       end += length
00269       if python3:
00270         self.controller.serial_number = str[start:end].decode('utf-8')
00271       else:
00272         self.controller.serial_number = str[start:end]
00273       start = end
00274       end += 4
00275       (length,) = _struct_I.unpack(str[start:end])
00276       start = end
00277       end += length
00278       if python3:
00279         self.controller.hw_version = str[start:end].decode('utf-8')
00280       else:
00281         self.controller.hw_version = str[start:end]
00282       start = end
00283       end += 4
00284       (length,) = _struct_I.unpack(str[start:end])
00285       start = end
00286       end += length
00287       if python3:
00288         self.controller.sw_version = str[start:end].decode('utf-8')
00289       else:
00290         self.controller.sw_version = str[start:end]
00291       start = end
00292       end += 4
00293       (length,) = _struct_I.unpack(str[start:end])
00294       start = end
00295       end += length
00296       if python3:
00297         self.controller.address = str[start:end].decode('utf-8')
00298       else:
00299         self.controller.address = str[start:end]
00300       start = end
00301       end += 4
00302       (length,) = _struct_I.unpack(str[start:end])
00303       self.robots = []
00304       for i in range(0, length):
00305         val1 = industrial_msgs.msg.DeviceInfo()
00306         start = end
00307         end += 4
00308         (length,) = _struct_I.unpack(str[start:end])
00309         start = end
00310         end += length
00311         if python3:
00312           val1.model = str[start:end].decode('utf-8')
00313         else:
00314           val1.model = str[start:end]
00315         start = end
00316         end += 4
00317         (length,) = _struct_I.unpack(str[start:end])
00318         start = end
00319         end += length
00320         if python3:
00321           val1.serial_number = str[start:end].decode('utf-8')
00322         else:
00323           val1.serial_number = str[start:end]
00324         start = end
00325         end += 4
00326         (length,) = _struct_I.unpack(str[start:end])
00327         start = end
00328         end += length
00329         if python3:
00330           val1.hw_version = str[start:end].decode('utf-8')
00331         else:
00332           val1.hw_version = str[start:end]
00333         start = end
00334         end += 4
00335         (length,) = _struct_I.unpack(str[start:end])
00336         start = end
00337         end += length
00338         if python3:
00339           val1.sw_version = str[start:end].decode('utf-8')
00340         else:
00341           val1.sw_version = str[start:end]
00342         start = end
00343         end += 4
00344         (length,) = _struct_I.unpack(str[start:end])
00345         start = end
00346         end += length
00347         if python3:
00348           val1.address = str[start:end].decode('utf-8')
00349         else:
00350           val1.address = str[start:end]
00351         self.robots.append(val1)
00352       start = end
00353       end += 1
00354       (self.code.val,) = _struct_b.unpack(str[start:end])
00355       return self
00356     except struct.error as e:
00357       raise genpy.DeserializationError(e) #most likely buffer underfill
00358 
00359 
00360   def serialize_numpy(self, buff, numpy):
00361     """
00362     serialize message with numpy array types into buffer
00363     :param buff: buffer, ``StringIO``
00364     :param numpy: numpy python module
00365     """
00366     try:
00367       _x = self.controller.model
00368       length = len(_x)
00369       if python3 or type(_x) == unicode:
00370         _x = _x.encode('utf-8')
00371         length = len(_x)
00372       buff.write(struct.pack('<I%ss'%length, length, _x))
00373       _x = self.controller.serial_number
00374       length = len(_x)
00375       if python3 or type(_x) == unicode:
00376         _x = _x.encode('utf-8')
00377         length = len(_x)
00378       buff.write(struct.pack('<I%ss'%length, length, _x))
00379       _x = self.controller.hw_version
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.controller.sw_version
00386       length = len(_x)
00387       if python3 or type(_x) == unicode:
00388         _x = _x.encode('utf-8')
00389         length = len(_x)
00390       buff.write(struct.pack('<I%ss'%length, length, _x))
00391       _x = self.controller.address
00392       length = len(_x)
00393       if python3 or type(_x) == unicode:
00394         _x = _x.encode('utf-8')
00395         length = len(_x)
00396       buff.write(struct.pack('<I%ss'%length, length, _x))
00397       length = len(self.robots)
00398       buff.write(_struct_I.pack(length))
00399       for val1 in self.robots:
00400         _x = val1.model
00401         length = len(_x)
00402         if python3 or type(_x) == unicode:
00403           _x = _x.encode('utf-8')
00404           length = len(_x)
00405         buff.write(struct.pack('<I%ss'%length, length, _x))
00406         _x = val1.serial_number
00407         length = len(_x)
00408         if python3 or type(_x) == unicode:
00409           _x = _x.encode('utf-8')
00410           length = len(_x)
00411         buff.write(struct.pack('<I%ss'%length, length, _x))
00412         _x = val1.hw_version
00413         length = len(_x)
00414         if python3 or type(_x) == unicode:
00415           _x = _x.encode('utf-8')
00416           length = len(_x)
00417         buff.write(struct.pack('<I%ss'%length, length, _x))
00418         _x = val1.sw_version
00419         length = len(_x)
00420         if python3 or type(_x) == unicode:
00421           _x = _x.encode('utf-8')
00422           length = len(_x)
00423         buff.write(struct.pack('<I%ss'%length, length, _x))
00424         _x = val1.address
00425         length = len(_x)
00426         if python3 or type(_x) == unicode:
00427           _x = _x.encode('utf-8')
00428           length = len(_x)
00429         buff.write(struct.pack('<I%ss'%length, length, _x))
00430       buff.write(_struct_b.pack(self.code.val))
00431     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00432     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00433 
00434   def deserialize_numpy(self, str, numpy):
00435     """
00436     unpack serialized message in str into this message instance using numpy for array types
00437     :param str: byte array of serialized message, ``str``
00438     :param numpy: numpy python module
00439     """
00440     try:
00441       if self.controller is None:
00442         self.controller = industrial_msgs.msg.DeviceInfo()
00443       if self.robots is None:
00444         self.robots = None
00445       if self.code is None:
00446         self.code = industrial_msgs.msg.ServiceReturnCode()
00447       end = 0
00448       start = end
00449       end += 4
00450       (length,) = _struct_I.unpack(str[start:end])
00451       start = end
00452       end += length
00453       if python3:
00454         self.controller.model = str[start:end].decode('utf-8')
00455       else:
00456         self.controller.model = str[start:end]
00457       start = end
00458       end += 4
00459       (length,) = _struct_I.unpack(str[start:end])
00460       start = end
00461       end += length
00462       if python3:
00463         self.controller.serial_number = str[start:end].decode('utf-8')
00464       else:
00465         self.controller.serial_number = str[start:end]
00466       start = end
00467       end += 4
00468       (length,) = _struct_I.unpack(str[start:end])
00469       start = end
00470       end += length
00471       if python3:
00472         self.controller.hw_version = str[start:end].decode('utf-8')
00473       else:
00474         self.controller.hw_version = str[start:end]
00475       start = end
00476       end += 4
00477       (length,) = _struct_I.unpack(str[start:end])
00478       start = end
00479       end += length
00480       if python3:
00481         self.controller.sw_version = str[start:end].decode('utf-8')
00482       else:
00483         self.controller.sw_version = str[start:end]
00484       start = end
00485       end += 4
00486       (length,) = _struct_I.unpack(str[start:end])
00487       start = end
00488       end += length
00489       if python3:
00490         self.controller.address = str[start:end].decode('utf-8')
00491       else:
00492         self.controller.address = str[start:end]
00493       start = end
00494       end += 4
00495       (length,) = _struct_I.unpack(str[start:end])
00496       self.robots = []
00497       for i in range(0, length):
00498         val1 = industrial_msgs.msg.DeviceInfo()
00499         start = end
00500         end += 4
00501         (length,) = _struct_I.unpack(str[start:end])
00502         start = end
00503         end += length
00504         if python3:
00505           val1.model = str[start:end].decode('utf-8')
00506         else:
00507           val1.model = str[start:end]
00508         start = end
00509         end += 4
00510         (length,) = _struct_I.unpack(str[start:end])
00511         start = end
00512         end += length
00513         if python3:
00514           val1.serial_number = str[start:end].decode('utf-8')
00515         else:
00516           val1.serial_number = str[start:end]
00517         start = end
00518         end += 4
00519         (length,) = _struct_I.unpack(str[start:end])
00520         start = end
00521         end += length
00522         if python3:
00523           val1.hw_version = str[start:end].decode('utf-8')
00524         else:
00525           val1.hw_version = str[start:end]
00526         start = end
00527         end += 4
00528         (length,) = _struct_I.unpack(str[start:end])
00529         start = end
00530         end += length
00531         if python3:
00532           val1.sw_version = str[start:end].decode('utf-8')
00533         else:
00534           val1.sw_version = str[start:end]
00535         start = end
00536         end += 4
00537         (length,) = _struct_I.unpack(str[start:end])
00538         start = end
00539         end += length
00540         if python3:
00541           val1.address = str[start:end].decode('utf-8')
00542         else:
00543           val1.address = str[start:end]
00544         self.robots.append(val1)
00545       start = end
00546       end += 1
00547       (self.code.val,) = _struct_b.unpack(str[start:end])
00548       return self
00549     except struct.error as e:
00550       raise genpy.DeserializationError(e) #most likely buffer underfill
00551 
00552 _struct_I = genpy.struct_I
00553 _struct_b = struct.Struct("<b")
00554 class GetRobotInfo(object):
00555   _type          = 'industrial_msgs/GetRobotInfo'
00556   _md5sum = '5db3230b3e61c85a320b999ffd7f3b3f'
00557   _request_class  = GetRobotInfoRequest
00558   _response_class = GetRobotInfoResponse


industrial_msgs
Author(s): Shaun M. Edwards
autogenerated on Mon Oct 6 2014 00:53:40