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


pr2_collision_monitor
Author(s): Kelsey Hawkins, Advisor: Prof. Charlie Kemp (Healthcare Robotics Lab at Georgia Tech)
autogenerated on Wed Nov 27 2013 11:40:10