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