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


phidget_motor
Author(s): Bill Mania/bmania@coroware.com, Morgan Cormier/mcormier@coroware.com
autogenerated on Wed Aug 26 2015 11:09:55