_SetDrivePower.py
Go to the documentation of this file.
00001 """autogenerated by genpy from industrial_msgs/SetDrivePowerRequest.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 SetDrivePowerRequest(genpy.Message):
00009   _md5sum = "ad0065fa1febb42851b8c0a0493a1234"
00010   _type = "industrial_msgs/SetDrivePowerRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 
00014 
00015 
00016 bool drive_power
00017 
00018 """
00019   __slots__ = ['drive_power']
00020   _slot_types = ['bool']
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        drive_power
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(SetDrivePowerRequest, self).__init__(*args, **kwds)
00038       #message fields cannot be None, assign default values for those that are
00039       if self.drive_power is None:
00040         self.drive_power = False
00041     else:
00042       self.drive_power = False
00043 
00044   def _get_types(self):
00045     """
00046     internal API method
00047     """
00048     return self._slot_types
00049 
00050   def serialize(self, buff):
00051     """
00052     serialize message into buffer
00053     :param buff: buffer, ``StringIO``
00054     """
00055     try:
00056       buff.write(_struct_B.pack(self.drive_power))
00057     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00058     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00059 
00060   def deserialize(self, str):
00061     """
00062     unpack serialized message in str into this message instance
00063     :param str: byte array of serialized message, ``str``
00064     """
00065     try:
00066       end = 0
00067       start = end
00068       end += 1
00069       (self.drive_power,) = _struct_B.unpack(str[start:end])
00070       self.drive_power = bool(self.drive_power)
00071       return self
00072     except struct.error as e:
00073       raise genpy.DeserializationError(e) #most likely buffer underfill
00074 
00075 
00076   def serialize_numpy(self, buff, numpy):
00077     """
00078     serialize message with numpy array types into buffer
00079     :param buff: buffer, ``StringIO``
00080     :param numpy: numpy python module
00081     """
00082     try:
00083       buff.write(_struct_B.pack(self.drive_power))
00084     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00085     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00086 
00087   def deserialize_numpy(self, str, numpy):
00088     """
00089     unpack serialized message in str into this message instance using numpy for array types
00090     :param str: byte array of serialized message, ``str``
00091     :param numpy: numpy python module
00092     """
00093     try:
00094       end = 0
00095       start = end
00096       end += 1
00097       (self.drive_power,) = _struct_B.unpack(str[start:end])
00098       self.drive_power = bool(self.drive_power)
00099       return self
00100     except struct.error as e:
00101       raise genpy.DeserializationError(e) #most likely buffer underfill
00102 
00103 _struct_I = genpy.struct_I
00104 _struct_B = struct.Struct("<B")
00105 """autogenerated by genpy from industrial_msgs/SetDrivePowerResponse.msg. Do not edit."""
00106 import sys
00107 python3 = True if sys.hexversion > 0x03000000 else False
00108 import genpy
00109 import struct
00110 
00111 import industrial_msgs.msg
00112 
00113 class SetDrivePowerResponse(genpy.Message):
00114   _md5sum = "50b1f38f75f5677e5692f3b3e7e1ea48"
00115   _type = "industrial_msgs/SetDrivePowerResponse"
00116   _has_header = False #flag to mark the presence of a Header object
00117   _full_text = """industrial_msgs/ServiceReturnCode code
00118 
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__ = ['code']
00133   _slot_types = ['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        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(SetDrivePowerResponse, self).__init__(*args, **kwds)
00151       #message fields cannot be None, assign default values for those that are
00152       if self.code is None:
00153         self.code = industrial_msgs.msg.ServiceReturnCode()
00154     else:
00155       self.code = industrial_msgs.msg.ServiceReturnCode()
00156 
00157   def _get_types(self):
00158     """
00159     internal API method
00160     """
00161     return self._slot_types
00162 
00163   def serialize(self, buff):
00164     """
00165     serialize message into buffer
00166     :param buff: buffer, ``StringIO``
00167     """
00168     try:
00169       buff.write(_struct_b.pack(self.code.val))
00170     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00171     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00172 
00173   def deserialize(self, str):
00174     """
00175     unpack serialized message in str into this message instance
00176     :param str: byte array of serialized message, ``str``
00177     """
00178     try:
00179       if self.code is None:
00180         self.code = industrial_msgs.msg.ServiceReturnCode()
00181       end = 0
00182       start = end
00183       end += 1
00184       (self.code.val,) = _struct_b.unpack(str[start:end])
00185       return self
00186     except struct.error as e:
00187       raise genpy.DeserializationError(e) #most likely buffer underfill
00188 
00189 
00190   def serialize_numpy(self, buff, numpy):
00191     """
00192     serialize message with numpy array types into buffer
00193     :param buff: buffer, ``StringIO``
00194     :param numpy: numpy python module
00195     """
00196     try:
00197       buff.write(_struct_b.pack(self.code.val))
00198     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00199     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00200 
00201   def deserialize_numpy(self, str, numpy):
00202     """
00203     unpack serialized message in str into this message instance using numpy for array types
00204     :param str: byte array of serialized message, ``str``
00205     :param numpy: numpy python module
00206     """
00207     try:
00208       if self.code is None:
00209         self.code = industrial_msgs.msg.ServiceReturnCode()
00210       end = 0
00211       start = end
00212       end += 1
00213       (self.code.val,) = _struct_b.unpack(str[start:end])
00214       return self
00215     except struct.error as e:
00216       raise genpy.DeserializationError(e) #most likely buffer underfill
00217 
00218 _struct_I = genpy.struct_I
00219 _struct_b = struct.Struct("<b")
00220 class SetDrivePower(object):
00221   _type          = 'industrial_msgs/SetDrivePower'
00222   _md5sum = '89dc29b38aedf0d168daa33da97de48a'
00223   _request_class  = SetDrivePowerRequest
00224   _response_class = SetDrivePowerResponse


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