00001 """autogenerated by genpy from normal_descriptor_node/ndesc.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
00009 class ndesc(genpy.Message):
00010 _md5sum = "6efcdd88f5aa9024bcc7df7fd26a0f88"
00011 _type = "normal_descriptor_node/ndesc"
00012 _has_header = False
00013 _full_text = """float32[] descriptor
00014 geometry_msgs/Vector3 point3d
00015 int32 u
00016 int32 v
00017 float32 ori
00018 ================================================================================
00019 MSG: geometry_msgs/Vector3
00020 # This represents a vector in free space.
00021
00022 float64 x
00023 float64 y
00024 float64 z
00025 """
00026 __slots__ = ['descriptor','point3d','u','v','ori']
00027 _slot_types = ['float32[]','geometry_msgs/Vector3','int32','int32','float32']
00028
00029 def __init__(self, *args, **kwds):
00030 """
00031 Constructor. Any message fields that are implicitly/explicitly
00032 set to None will be assigned a default value. The recommend
00033 use is keyword arguments as this is more robust to future message
00034 changes. You cannot mix in-order arguments and keyword arguments.
00035
00036 The available fields are:
00037 descriptor,point3d,u,v,ori
00038
00039 :param args: complete set of field values, in .msg order
00040 :param kwds: use keyword arguments corresponding to message field names
00041 to set specific fields.
00042 """
00043 if args or kwds:
00044 super(ndesc, self).__init__(*args, **kwds)
00045
00046 if self.descriptor is None:
00047 self.descriptor = []
00048 if self.point3d is None:
00049 self.point3d = geometry_msgs.msg.Vector3()
00050 if self.u is None:
00051 self.u = 0
00052 if self.v is None:
00053 self.v = 0
00054 if self.ori is None:
00055 self.ori = 0.
00056 else:
00057 self.descriptor = []
00058 self.point3d = geometry_msgs.msg.Vector3()
00059 self.u = 0
00060 self.v = 0
00061 self.ori = 0.
00062
00063 def _get_types(self):
00064 """
00065 internal API method
00066 """
00067 return self._slot_types
00068
00069 def serialize(self, buff):
00070 """
00071 serialize message into buffer
00072 :param buff: buffer, ``StringIO``
00073 """
00074 try:
00075 length = len(self.descriptor)
00076 buff.write(_struct_I.pack(length))
00077 pattern = '<%sf'%length
00078 buff.write(struct.pack(pattern, *self.descriptor))
00079 _x = self
00080 buff.write(_struct_3d2if.pack(_x.point3d.x, _x.point3d.y, _x.point3d.z, _x.u, _x.v, _x.ori))
00081 except struct.error as se: self._check_types(se)
00082 except TypeError as te: self._check_types(te)
00083
00084 def deserialize(self, str):
00085 """
00086 unpack serialized message in str into this message instance
00087 :param str: byte array of serialized message, ``str``
00088 """
00089 try:
00090 if self.point3d is None:
00091 self.point3d = geometry_msgs.msg.Vector3()
00092 end = 0
00093 start = end
00094 end += 4
00095 (length,) = _struct_I.unpack(str[start:end])
00096 pattern = '<%sf'%length
00097 start = end
00098 end += struct.calcsize(pattern)
00099 self.descriptor = struct.unpack(pattern, str[start:end])
00100 _x = self
00101 start = end
00102 end += 36
00103 (_x.point3d.x, _x.point3d.y, _x.point3d.z, _x.u, _x.v, _x.ori,) = _struct_3d2if.unpack(str[start:end])
00104 return self
00105 except struct.error as e:
00106 raise genpy.DeserializationError(e)
00107
00108
00109 def serialize_numpy(self, buff, numpy):
00110 """
00111 serialize message with numpy array types into buffer
00112 :param buff: buffer, ``StringIO``
00113 :param numpy: numpy python module
00114 """
00115 try:
00116 length = len(self.descriptor)
00117 buff.write(_struct_I.pack(length))
00118 pattern = '<%sf'%length
00119 buff.write(self.descriptor.tostring())
00120 _x = self
00121 buff.write(_struct_3d2if.pack(_x.point3d.x, _x.point3d.y, _x.point3d.z, _x.u, _x.v, _x.ori))
00122 except struct.error as se: self._check_types(se)
00123 except TypeError as te: self._check_types(te)
00124
00125 def deserialize_numpy(self, str, numpy):
00126 """
00127 unpack serialized message in str into this message instance using numpy for array types
00128 :param str: byte array of serialized message, ``str``
00129 :param numpy: numpy python module
00130 """
00131 try:
00132 if self.point3d is None:
00133 self.point3d = geometry_msgs.msg.Vector3()
00134 end = 0
00135 start = end
00136 end += 4
00137 (length,) = _struct_I.unpack(str[start:end])
00138 pattern = '<%sf'%length
00139 start = end
00140 end += struct.calcsize(pattern)
00141 self.descriptor = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00142 _x = self
00143 start = end
00144 end += 36
00145 (_x.point3d.x, _x.point3d.y, _x.point3d.z, _x.u, _x.v, _x.ori,) = _struct_3d2if.unpack(str[start:end])
00146 return self
00147 except struct.error as e:
00148 raise genpy.DeserializationError(e)
00149
00150 _struct_I = genpy.struct_I
00151 _struct_3d2if = struct.Struct("<3d2if")