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


phidget_servo
Author(s):
autogenerated on Wed Aug 26 2015 11:09:46