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


sr_robot_msgs
Author(s): Ugo Cupcic/ugo@shadowrobot.com
autogenerated on Fri Jan 3 2014 12:01:40