_SetupChannel.py
Go to the documentation of this file.
00001 """autogenerated by genpy from arbotix_msgs/SetupChannelRequest.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 SetupChannelRequest(genpy.Message):
00009   _md5sum = "c65e58d8b3b4d406126f6dc829a6011f"
00010   _type = "arbotix_msgs/SetupChannelRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 string topic_name
00014 uint8 pin
00015 uint8 value
00016 uint8 rate
00017 
00018 """
00019   __slots__ = ['topic_name','pin','value','rate']
00020   _slot_types = ['string','uint8','uint8','uint8']
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        topic_name,pin,value,rate
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(SetupChannelRequest, self).__init__(*args, **kwds)
00038       #message fields cannot be None, assign default values for those that are
00039       if self.topic_name is None:
00040         self.topic_name = ''
00041       if self.pin is None:
00042         self.pin = 0
00043       if self.value is None:
00044         self.value = 0
00045       if self.rate is None:
00046         self.rate = 0
00047     else:
00048       self.topic_name = ''
00049       self.pin = 0
00050       self.value = 0
00051       self.rate = 0
00052 
00053   def _get_types(self):
00054     """
00055     internal API method
00056     """
00057     return self._slot_types
00058 
00059   def serialize(self, buff):
00060     """
00061     serialize message into buffer
00062     :param buff: buffer, ``StringIO``
00063     """
00064     try:
00065       _x = self.topic_name
00066       length = len(_x)
00067       if python3 or type(_x) == unicode:
00068         _x = _x.encode('utf-8')
00069         length = len(_x)
00070       buff.write(struct.pack('<I%ss'%length, length, _x))
00071       _x = self
00072       buff.write(_struct_3B.pack(_x.pin, _x.value, _x.rate))
00073     except struct.error as se: self._check_types(se)
00074     except TypeError as te: self._check_types(te)
00075 
00076   def deserialize(self, str):
00077     """
00078     unpack serialized message in str into this message instance
00079     :param str: byte array of serialized message, ``str``
00080     """
00081     try:
00082       end = 0
00083       start = end
00084       end += 4
00085       (length,) = _struct_I.unpack(str[start:end])
00086       start = end
00087       end += length
00088       if python3:
00089         self.topic_name = str[start:end].decode('utf-8')
00090       else:
00091         self.topic_name = str[start:end]
00092       _x = self
00093       start = end
00094       end += 3
00095       (_x.pin, _x.value, _x.rate,) = _struct_3B.unpack(str[start:end])
00096       return self
00097     except struct.error as e:
00098       raise genpy.DeserializationError(e) #most likely buffer underfill
00099 
00100 
00101   def serialize_numpy(self, buff, numpy):
00102     """
00103     serialize message with numpy array types into buffer
00104     :param buff: buffer, ``StringIO``
00105     :param numpy: numpy python module
00106     """
00107     try:
00108       _x = self.topic_name
00109       length = len(_x)
00110       if python3 or type(_x) == unicode:
00111         _x = _x.encode('utf-8')
00112         length = len(_x)
00113       buff.write(struct.pack('<I%ss'%length, length, _x))
00114       _x = self
00115       buff.write(_struct_3B.pack(_x.pin, _x.value, _x.rate))
00116     except struct.error as se: self._check_types(se)
00117     except TypeError as te: self._check_types(te)
00118 
00119   def deserialize_numpy(self, str, numpy):
00120     """
00121     unpack serialized message in str into this message instance using numpy for array types
00122     :param str: byte array of serialized message, ``str``
00123     :param numpy: numpy python module
00124     """
00125     try:
00126       end = 0
00127       start = end
00128       end += 4
00129       (length,) = _struct_I.unpack(str[start:end])
00130       start = end
00131       end += length
00132       if python3:
00133         self.topic_name = str[start:end].decode('utf-8')
00134       else:
00135         self.topic_name = str[start:end]
00136       _x = self
00137       start = end
00138       end += 3
00139       (_x.pin, _x.value, _x.rate,) = _struct_3B.unpack(str[start:end])
00140       return self
00141     except struct.error as e:
00142       raise genpy.DeserializationError(e) #most likely buffer underfill
00143 
00144 _struct_I = genpy.struct_I
00145 _struct_3B = struct.Struct("<3B")
00146 """autogenerated by genpy from arbotix_msgs/SetupChannelResponse.msg. Do not edit."""
00147 import sys
00148 python3 = True if sys.hexversion > 0x03000000 else False
00149 import genpy
00150 import struct
00151 
00152 
00153 class SetupChannelResponse(genpy.Message):
00154   _md5sum = "d41d8cd98f00b204e9800998ecf8427e"
00155   _type = "arbotix_msgs/SetupChannelResponse"
00156   _has_header = False #flag to mark the presence of a Header object
00157   _full_text = """
00158 
00159 
00160 """
00161   __slots__ = []
00162   _slot_types = []
00163 
00164   def __init__(self, *args, **kwds):
00165     """
00166     Constructor. Any message fields that are implicitly/explicitly
00167     set to None will be assigned a default value. The recommend
00168     use is keyword arguments as this is more robust to future message
00169     changes.  You cannot mix in-order arguments and keyword arguments.
00170 
00171     The available fields are:
00172        
00173 
00174     :param args: complete set of field values, in .msg order
00175     :param kwds: use keyword arguments corresponding to message field names
00176     to set specific fields.
00177     """
00178     if args or kwds:
00179       super(SetupChannelResponse, self).__init__(*args, **kwds)
00180 
00181   def _get_types(self):
00182     """
00183     internal API method
00184     """
00185     return self._slot_types
00186 
00187   def serialize(self, buff):
00188     """
00189     serialize message into buffer
00190     :param buff: buffer, ``StringIO``
00191     """
00192     try:
00193       pass
00194     except struct.error as se: self._check_types(se)
00195     except TypeError as te: self._check_types(te)
00196 
00197   def deserialize(self, str):
00198     """
00199     unpack serialized message in str into this message instance
00200     :param str: byte array of serialized message, ``str``
00201     """
00202     try:
00203       end = 0
00204       return self
00205     except struct.error as e:
00206       raise genpy.DeserializationError(e) #most likely buffer underfill
00207 
00208 
00209   def serialize_numpy(self, buff, numpy):
00210     """
00211     serialize message with numpy array types into buffer
00212     :param buff: buffer, ``StringIO``
00213     :param numpy: numpy python module
00214     """
00215     try:
00216       pass
00217     except struct.error as se: self._check_types(se)
00218     except TypeError as te: self._check_types(te)
00219 
00220   def deserialize_numpy(self, str, numpy):
00221     """
00222     unpack serialized message in str into this message instance using numpy for array types
00223     :param str: byte array of serialized message, ``str``
00224     :param numpy: numpy python module
00225     """
00226     try:
00227       end = 0
00228       return self
00229     except struct.error as e:
00230       raise genpy.DeserializationError(e) #most likely buffer underfill
00231 
00232 _struct_I = genpy.struct_I
00233 class SetupChannel(object):
00234   _type          = 'arbotix_msgs/SetupChannel'
00235   _md5sum = 'c65e58d8b3b4d406126f6dc829a6011f'
00236   _request_class  = SetupChannelRequest
00237   _response_class = SetupChannelResponse


arbotix_msgs
Author(s): Michael Ferguson
autogenerated on Sat Dec 28 2013 16:46:08