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


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