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