_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 = "36741247c0d6032654e8e0ef56e7670f"
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 #used to query which control type we're using. won't change the control type
00023 int16 QUERY=-1
00024 """
00025   __slots__ = ['control_type']
00026   _slot_types = ['sr_robot_msgs/ControlType']
00027 
00028   def __init__(self, *args, **kwds):
00029     """
00030     Constructor. Any message fields that are implicitly/explicitly
00031     set to None will be assigned a default value. The recommend
00032     use is keyword arguments as this is more robust to future message
00033     changes.  You cannot mix in-order arguments and keyword arguments.
00034 
00035     The available fields are:
00036        control_type
00037 
00038     :param args: complete set of field values, in .msg order
00039     :param kwds: use keyword arguments corresponding to message field names
00040     to set specific fields.
00041     """
00042     if args or kwds:
00043       super(ChangeControlTypeRequest, self).__init__(*args, **kwds)
00044       #message fields cannot be None, assign default values for those that are
00045       if self.control_type is None:
00046         self.control_type = sr_robot_msgs.msg.ControlType()
00047     else:
00048       self.control_type = sr_robot_msgs.msg.ControlType()
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       buff.write(_struct_h.pack(self.control_type.control_type))
00063     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00064     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00065 
00066   def deserialize(self, str):
00067     """
00068     unpack serialized message in str into this message instance
00069     :param str: byte array of serialized message, ``str``
00070     """
00071     try:
00072       if self.control_type is None:
00073         self.control_type = sr_robot_msgs.msg.ControlType()
00074       end = 0
00075       start = end
00076       end += 2
00077       (self.control_type.control_type,) = _struct_h.unpack(str[start:end])
00078       return self
00079     except struct.error as e:
00080       raise genpy.DeserializationError(e) #most likely buffer underfill
00081 
00082 
00083   def serialize_numpy(self, buff, numpy):
00084     """
00085     serialize message with numpy array types into buffer
00086     :param buff: buffer, ``StringIO``
00087     :param numpy: numpy python module
00088     """
00089     try:
00090       buff.write(_struct_h.pack(self.control_type.control_type))
00091     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00092     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00093 
00094   def deserialize_numpy(self, str, numpy):
00095     """
00096     unpack serialized message in str into this message instance using numpy for array types
00097     :param str: byte array of serialized message, ``str``
00098     :param numpy: numpy python module
00099     """
00100     try:
00101       if self.control_type is None:
00102         self.control_type = sr_robot_msgs.msg.ControlType()
00103       end = 0
00104       start = end
00105       end += 2
00106       (self.control_type.control_type,) = _struct_h.unpack(str[start:end])
00107       return self
00108     except struct.error as e:
00109       raise genpy.DeserializationError(e) #most likely buffer underfill
00110 
00111 _struct_I = genpy.struct_I
00112 _struct_h = struct.Struct("<h")
00113 """autogenerated by genpy from sr_robot_msgs/ChangeControlTypeResponse.msg. Do not edit."""
00114 import sys
00115 python3 = True if sys.hexversion > 0x03000000 else False
00116 import genpy
00117 import struct
00118 
00119 import sr_robot_msgs.msg
00120 
00121 class ChangeControlTypeResponse(genpy.Message):
00122   _md5sum = "2a6d00c524e195eb671dbbbb7783aee1"
00123   _type = "sr_robot_msgs/ChangeControlTypeResponse"
00124   _has_header = False #flag to mark the presence of a Header object
00125   _full_text = """ControlType result
00126 
00127 ================================================================================
00128 MSG: sr_robot_msgs/ControlType
00129 int16 control_type
00130 
00131 int16 PWM=0
00132 int16 FORCE=1
00133 
00134 #used to query which control type we're using. won't change the control type
00135 int16 QUERY=-1
00136 """
00137   __slots__ = ['result']
00138   _slot_types = ['sr_robot_msgs/ControlType']
00139 
00140   def __init__(self, *args, **kwds):
00141     """
00142     Constructor. Any message fields that are implicitly/explicitly
00143     set to None will be assigned a default value. The recommend
00144     use is keyword arguments as this is more robust to future message
00145     changes.  You cannot mix in-order arguments and keyword arguments.
00146 
00147     The available fields are:
00148        result
00149 
00150     :param args: complete set of field values, in .msg order
00151     :param kwds: use keyword arguments corresponding to message field names
00152     to set specific fields.
00153     """
00154     if args or kwds:
00155       super(ChangeControlTypeResponse, self).__init__(*args, **kwds)
00156       #message fields cannot be None, assign default values for those that are
00157       if self.result is None:
00158         self.result = sr_robot_msgs.msg.ControlType()
00159     else:
00160       self.result = sr_robot_msgs.msg.ControlType()
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       buff.write(_struct_h.pack(self.result.control_type))
00175     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00176     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00177 
00178   def deserialize(self, str):
00179     """
00180     unpack serialized message in str into this message instance
00181     :param str: byte array of serialized message, ``str``
00182     """
00183     try:
00184       if self.result is None:
00185         self.result = sr_robot_msgs.msg.ControlType()
00186       end = 0
00187       start = end
00188       end += 2
00189       (self.result.control_type,) = _struct_h.unpack(str[start:end])
00190       return self
00191     except struct.error as e:
00192       raise genpy.DeserializationError(e) #most likely buffer underfill
00193 
00194 
00195   def serialize_numpy(self, buff, numpy):
00196     """
00197     serialize message with numpy array types into buffer
00198     :param buff: buffer, ``StringIO``
00199     :param numpy: numpy python module
00200     """
00201     try:
00202       buff.write(_struct_h.pack(self.result.control_type))
00203     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00204     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00205 
00206   def deserialize_numpy(self, str, numpy):
00207     """
00208     unpack serialized message in str into this message instance using numpy for array types
00209     :param str: byte array of serialized message, ``str``
00210     :param numpy: numpy python module
00211     """
00212     try:
00213       if self.result is None:
00214         self.result = sr_robot_msgs.msg.ControlType()
00215       end = 0
00216       start = end
00217       end += 2
00218       (self.result.control_type,) = _struct_h.unpack(str[start:end])
00219       return self
00220     except struct.error as e:
00221       raise genpy.DeserializationError(e) #most likely buffer underfill
00222 
00223 _struct_I = genpy.struct_I
00224 _struct_h = struct.Struct("<h")
00225 class ChangeControlType(object):
00226   _type          = 'sr_robot_msgs/ChangeControlType'
00227   _md5sum = '14cedf5030b722e2c8df2dc57f9cdb58'
00228   _request_class  = ChangeControlTypeRequest
00229   _response_class = ChangeControlTypeResponse


sr_robot_msgs
Author(s): Ugo Cupcic/ugo@shadowrobot.com
autogenerated on Mon Oct 6 2014 07:40:05