_which_fingers_are_touching.py
Go to the documentation of this file.
00001 """autogenerated by genpy from sr_robot_msgs/which_fingers_are_touchingRequest.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 which_fingers_are_touchingRequest(genpy.Message):
00009   _md5sum = "f0fd736c3daac04fcc02a89421c67ccd"
00010   _type = "sr_robot_msgs/which_fingers_are_touchingRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 
00014 
00015 
00016 float64[] force_thresholds
00017 
00018 """
00019   __slots__ = ['force_thresholds']
00020   _slot_types = ['float64[]']
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        force_thresholds
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(which_fingers_are_touchingRequest, self).__init__(*args, **kwds)
00038       #message fields cannot be None, assign default values for those that are
00039       if self.force_thresholds is None:
00040         self.force_thresholds = []
00041     else:
00042       self.force_thresholds = []
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       length = len(self.force_thresholds)
00057       buff.write(_struct_I.pack(length))
00058       pattern = '<%sd'%length
00059       buff.write(struct.pack(pattern, *self.force_thresholds))
00060     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00061     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00062 
00063   def deserialize(self, str):
00064     """
00065     unpack serialized message in str into this message instance
00066     :param str: byte array of serialized message, ``str``
00067     """
00068     try:
00069       end = 0
00070       start = end
00071       end += 4
00072       (length,) = _struct_I.unpack(str[start:end])
00073       pattern = '<%sd'%length
00074       start = end
00075       end += struct.calcsize(pattern)
00076       self.force_thresholds = struct.unpack(pattern, 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       length = len(self.force_thresholds)
00090       buff.write(_struct_I.pack(length))
00091       pattern = '<%sd'%length
00092       buff.write(self.force_thresholds.tostring())
00093     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00094     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00095 
00096   def deserialize_numpy(self, str, numpy):
00097     """
00098     unpack serialized message in str into this message instance using numpy for array types
00099     :param str: byte array of serialized message, ``str``
00100     :param numpy: numpy python module
00101     """
00102     try:
00103       end = 0
00104       start = end
00105       end += 4
00106       (length,) = _struct_I.unpack(str[start:end])
00107       pattern = '<%sd'%length
00108       start = end
00109       end += struct.calcsize(pattern)
00110       self.force_thresholds = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00111       return self
00112     except struct.error as e:
00113       raise genpy.DeserializationError(e) #most likely buffer underfill
00114 
00115 _struct_I = genpy.struct_I
00116 """autogenerated by genpy from sr_robot_msgs/which_fingers_are_touchingResponse.msg. Do not edit."""
00117 import sys
00118 python3 = True if sys.hexversion > 0x03000000 else False
00119 import genpy
00120 import struct
00121 
00122 
00123 class which_fingers_are_touchingResponse(genpy.Message):
00124   _md5sum = "f9d8b7193733b8133389d5ada08e713d"
00125   _type = "sr_robot_msgs/which_fingers_are_touchingResponse"
00126   _has_header = False #flag to mark the presence of a Header object
00127   _full_text = """float64[] touch_forces
00128 
00129 
00130 
00131 
00132 
00133 """
00134   __slots__ = ['touch_forces']
00135   _slot_types = ['float64[]']
00136 
00137   def __init__(self, *args, **kwds):
00138     """
00139     Constructor. Any message fields that are implicitly/explicitly
00140     set to None will be assigned a default value. The recommend
00141     use is keyword arguments as this is more robust to future message
00142     changes.  You cannot mix in-order arguments and keyword arguments.
00143 
00144     The available fields are:
00145        touch_forces
00146 
00147     :param args: complete set of field values, in .msg order
00148     :param kwds: use keyword arguments corresponding to message field names
00149     to set specific fields.
00150     """
00151     if args or kwds:
00152       super(which_fingers_are_touchingResponse, self).__init__(*args, **kwds)
00153       #message fields cannot be None, assign default values for those that are
00154       if self.touch_forces is None:
00155         self.touch_forces = []
00156     else:
00157       self.touch_forces = []
00158 
00159   def _get_types(self):
00160     """
00161     internal API method
00162     """
00163     return self._slot_types
00164 
00165   def serialize(self, buff):
00166     """
00167     serialize message into buffer
00168     :param buff: buffer, ``StringIO``
00169     """
00170     try:
00171       length = len(self.touch_forces)
00172       buff.write(_struct_I.pack(length))
00173       pattern = '<%sd'%length
00174       buff.write(struct.pack(pattern, *self.touch_forces))
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       end = 0
00185       start = end
00186       end += 4
00187       (length,) = _struct_I.unpack(str[start:end])
00188       pattern = '<%sd'%length
00189       start = end
00190       end += struct.calcsize(pattern)
00191       self.touch_forces = struct.unpack(pattern, str[start:end])
00192       return self
00193     except struct.error as e:
00194       raise genpy.DeserializationError(e) #most likely buffer underfill
00195 
00196 
00197   def serialize_numpy(self, buff, numpy):
00198     """
00199     serialize message with numpy array types into buffer
00200     :param buff: buffer, ``StringIO``
00201     :param numpy: numpy python module
00202     """
00203     try:
00204       length = len(self.touch_forces)
00205       buff.write(_struct_I.pack(length))
00206       pattern = '<%sd'%length
00207       buff.write(self.touch_forces.tostring())
00208     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00209     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00210 
00211   def deserialize_numpy(self, str, numpy):
00212     """
00213     unpack serialized message in str into this message instance using numpy for array types
00214     :param str: byte array of serialized message, ``str``
00215     :param numpy: numpy python module
00216     """
00217     try:
00218       end = 0
00219       start = end
00220       end += 4
00221       (length,) = _struct_I.unpack(str[start:end])
00222       pattern = '<%sd'%length
00223       start = end
00224       end += struct.calcsize(pattern)
00225       self.touch_forces = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00226       return self
00227     except struct.error as e:
00228       raise genpy.DeserializationError(e) #most likely buffer underfill
00229 
00230 _struct_I = genpy.struct_I
00231 class which_fingers_are_touching(object):
00232   _type          = 'sr_robot_msgs/which_fingers_are_touching'
00233   _md5sum = '5db90fdcbce6b7b34ac0a1f94863f7e2'
00234   _request_class  = which_fingers_are_touchingRequest
00235   _response_class = which_fingers_are_touchingResponse


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