00001 """autogenerated by genpy from vrep_common/ProximitySensorData.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import geometry_msgs.msg
00008 import std_msgs.msg
00009
00010 class ProximitySensorData(genpy.Message):
00011 _md5sum = "ca4cef31bef118238b22d9d3bc7e3089"
00012 _type = "vrep_common/ProximitySensorData"
00013 _has_header = False
00014 _full_text = """geometry_msgs/Point32 detectedPoint
00015 std_msgs/Int32 detectedObject
00016 geometry_msgs/Point32 normalVector
00017
00018 ================================================================================
00019 MSG: geometry_msgs/Point32
00020 # This contains the position of a point in free space(with 32 bits of precision).
00021 # It is recommeded to use Point wherever possible instead of Point32.
00022 #
00023 # This recommendation is to promote interoperability.
00024 #
00025 # This message is designed to take up less space when sending
00026 # lots of points at once, as in the case of a PointCloud.
00027
00028 float32 x
00029 float32 y
00030 float32 z
00031 ================================================================================
00032 MSG: std_msgs/Int32
00033 int32 data
00034 """
00035 __slots__ = ['detectedPoint','detectedObject','normalVector']
00036 _slot_types = ['geometry_msgs/Point32','std_msgs/Int32','geometry_msgs/Point32']
00037
00038 def __init__(self, *args, **kwds):
00039 """
00040 Constructor. Any message fields that are implicitly/explicitly
00041 set to None will be assigned a default value. The recommend
00042 use is keyword arguments as this is more robust to future message
00043 changes. You cannot mix in-order arguments and keyword arguments.
00044
00045 The available fields are:
00046 detectedPoint,detectedObject,normalVector
00047
00048 :param args: complete set of field values, in .msg order
00049 :param kwds: use keyword arguments corresponding to message field names
00050 to set specific fields.
00051 """
00052 if args or kwds:
00053 super(ProximitySensorData, self).__init__(*args, **kwds)
00054
00055 if self.detectedPoint is None:
00056 self.detectedPoint = geometry_msgs.msg.Point32()
00057 if self.detectedObject is None:
00058 self.detectedObject = std_msgs.msg.Int32()
00059 if self.normalVector is None:
00060 self.normalVector = geometry_msgs.msg.Point32()
00061 else:
00062 self.detectedPoint = geometry_msgs.msg.Point32()
00063 self.detectedObject = std_msgs.msg.Int32()
00064 self.normalVector = geometry_msgs.msg.Point32()
00065
00066 def _get_types(self):
00067 """
00068 internal API method
00069 """
00070 return self._slot_types
00071
00072 def serialize(self, buff):
00073 """
00074 serialize message into buffer
00075 :param buff: buffer, ``StringIO``
00076 """
00077 try:
00078 _x = self
00079 buff.write(_struct_3fi3f.pack(_x.detectedPoint.x, _x.detectedPoint.y, _x.detectedPoint.z, _x.detectedObject.data, _x.normalVector.x, _x.normalVector.y, _x.normalVector.z))
00080 except struct.error as se: self._check_types(se)
00081 except TypeError as te: self._check_types(te)
00082
00083 def deserialize(self, str):
00084 """
00085 unpack serialized message in str into this message instance
00086 :param str: byte array of serialized message, ``str``
00087 """
00088 try:
00089 if self.detectedPoint is None:
00090 self.detectedPoint = geometry_msgs.msg.Point32()
00091 if self.detectedObject is None:
00092 self.detectedObject = std_msgs.msg.Int32()
00093 if self.normalVector is None:
00094 self.normalVector = geometry_msgs.msg.Point32()
00095 end = 0
00096 _x = self
00097 start = end
00098 end += 28
00099 (_x.detectedPoint.x, _x.detectedPoint.y, _x.detectedPoint.z, _x.detectedObject.data, _x.normalVector.x, _x.normalVector.y, _x.normalVector.z,) = _struct_3fi3f.unpack(str[start:end])
00100 return self
00101 except struct.error as e:
00102 raise genpy.DeserializationError(e)
00103
00104
00105 def serialize_numpy(self, buff, numpy):
00106 """
00107 serialize message with numpy array types into buffer
00108 :param buff: buffer, ``StringIO``
00109 :param numpy: numpy python module
00110 """
00111 try:
00112 _x = self
00113 buff.write(_struct_3fi3f.pack(_x.detectedPoint.x, _x.detectedPoint.y, _x.detectedPoint.z, _x.detectedObject.data, _x.normalVector.x, _x.normalVector.y, _x.normalVector.z))
00114 except struct.error as se: self._check_types(se)
00115 except TypeError as te: self._check_types(te)
00116
00117 def deserialize_numpy(self, str, numpy):
00118 """
00119 unpack serialized message in str into this message instance using numpy for array types
00120 :param str: byte array of serialized message, ``str``
00121 :param numpy: numpy python module
00122 """
00123 try:
00124 if self.detectedPoint is None:
00125 self.detectedPoint = geometry_msgs.msg.Point32()
00126 if self.detectedObject is None:
00127 self.detectedObject = std_msgs.msg.Int32()
00128 if self.normalVector is None:
00129 self.normalVector = geometry_msgs.msg.Point32()
00130 end = 0
00131 _x = self
00132 start = end
00133 end += 28
00134 (_x.detectedPoint.x, _x.detectedPoint.y, _x.detectedPoint.z, _x.detectedObject.data, _x.normalVector.x, _x.normalVector.y, _x.normalVector.z,) = _struct_3fi3f.unpack(str[start:end])
00135 return self
00136 except struct.error as e:
00137 raise genpy.DeserializationError(e)
00138
00139 _struct_I = genpy.struct_I
00140 _struct_3fi3f = struct.Struct("<3fi3f")