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


force_torque
Author(s): Advait Jain, Cressel Anderson, Hai Nguyen, Advisor: Prof. Charlie Kemp, Lab: Healthcare Robotics Lab at Georgia Tech
autogenerated on Wed Nov 27 2013 11:58:12