00001 """autogenerated by genpy from posedetection_msgs/ObjectDetection.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 posedetection_msgs.msg
00009 import std_msgs.msg
00010
00011 class ObjectDetection(genpy.Message):
00012 _md5sum = "929ffd2f5ec0aa7331e8e6ab09e43368"
00013 _type = "posedetection_msgs/ObjectDetection"
00014 _has_header = True
00015 _full_text = """Header header
00016 Object6DPose[] objects
00017 # unique image id these objects were taken from
00018
00019 ================================================================================
00020 MSG: std_msgs/Header
00021 # Standard metadata for higher-level stamped data types.
00022 # This is generally used to communicate timestamped data
00023 # in a particular coordinate frame.
00024 #
00025 # sequence ID: consecutively increasing ID
00026 uint32 seq
00027 #Two-integer timestamp that is expressed as:
00028 # * stamp.secs: seconds (stamp_secs) since epoch
00029 # * stamp.nsecs: nanoseconds since stamp_secs
00030 # time-handling sugar is provided by the client library
00031 time stamp
00032 #Frame this data is associated with
00033 # 0: no frame
00034 # 1: global frame
00035 string frame_id
00036
00037 ================================================================================
00038 MSG: posedetection_msgs/Object6DPose
00039 # 6D pose of object
00040 geometry_msgs/Pose pose
00041
00042 # type of object, usually contains the filename of the object that allows the receiving side to visualize it
00043 # can also be used as a unique type id
00044 string type
00045
00046 ================================================================================
00047 MSG: geometry_msgs/Pose
00048 # A representation of pose in free space, composed of postion and orientation.
00049 Point position
00050 Quaternion orientation
00051
00052 ================================================================================
00053 MSG: geometry_msgs/Point
00054 # This contains the position of a point in free space
00055 float64 x
00056 float64 y
00057 float64 z
00058
00059 ================================================================================
00060 MSG: geometry_msgs/Quaternion
00061 # This represents an orientation in free space in quaternion form.
00062
00063 float64 x
00064 float64 y
00065 float64 z
00066 float64 w
00067
00068 """
00069 __slots__ = ['header','objects']
00070 _slot_types = ['std_msgs/Header','posedetection_msgs/Object6DPose[]']
00071
00072 def __init__(self, *args, **kwds):
00073 """
00074 Constructor. Any message fields that are implicitly/explicitly
00075 set to None will be assigned a default value. The recommend
00076 use is keyword arguments as this is more robust to future message
00077 changes. You cannot mix in-order arguments and keyword arguments.
00078
00079 The available fields are:
00080 header,objects
00081
00082 :param args: complete set of field values, in .msg order
00083 :param kwds: use keyword arguments corresponding to message field names
00084 to set specific fields.
00085 """
00086 if args or kwds:
00087 super(ObjectDetection, self).__init__(*args, **kwds)
00088
00089 if self.header is None:
00090 self.header = std_msgs.msg.Header()
00091 if self.objects is None:
00092 self.objects = []
00093 else:
00094 self.header = std_msgs.msg.Header()
00095 self.objects = []
00096
00097 def _get_types(self):
00098 """
00099 internal API method
00100 """
00101 return self._slot_types
00102
00103 def serialize(self, buff):
00104 """
00105 serialize message into buffer
00106 :param buff: buffer, ``StringIO``
00107 """
00108 try:
00109 _x = self
00110 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00111 _x = self.header.frame_id
00112 length = len(_x)
00113 if python3 or type(_x) == unicode:
00114 _x = _x.encode('utf-8')
00115 length = len(_x)
00116 buff.write(struct.pack('<I%ss'%length, length, _x))
00117 length = len(self.objects)
00118 buff.write(_struct_I.pack(length))
00119 for val1 in self.objects:
00120 _v1 = val1.pose
00121 _v2 = _v1.position
00122 _x = _v2
00123 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00124 _v3 = _v1.orientation
00125 _x = _v3
00126 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00127 _x = val1.type
00128 length = len(_x)
00129 if python3 or type(_x) == unicode:
00130 _x = _x.encode('utf-8')
00131 length = len(_x)
00132 buff.write(struct.pack('<I%ss'%length, length, _x))
00133 except struct.error as se: self._check_types(se)
00134 except TypeError as te: self._check_types(te)
00135
00136 def deserialize(self, str):
00137 """
00138 unpack serialized message in str into this message instance
00139 :param str: byte array of serialized message, ``str``
00140 """
00141 try:
00142 if self.header is None:
00143 self.header = std_msgs.msg.Header()
00144 if self.objects is None:
00145 self.objects = None
00146 end = 0
00147 _x = self
00148 start = end
00149 end += 12
00150 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00151 start = end
00152 end += 4
00153 (length,) = _struct_I.unpack(str[start:end])
00154 start = end
00155 end += length
00156 if python3:
00157 self.header.frame_id = str[start:end].decode('utf-8')
00158 else:
00159 self.header.frame_id = str[start:end]
00160 start = end
00161 end += 4
00162 (length,) = _struct_I.unpack(str[start:end])
00163 self.objects = []
00164 for i in range(0, length):
00165 val1 = posedetection_msgs.msg.Object6DPose()
00166 _v4 = val1.pose
00167 _v5 = _v4.position
00168 _x = _v5
00169 start = end
00170 end += 24
00171 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00172 _v6 = _v4.orientation
00173 _x = _v6
00174 start = end
00175 end += 32
00176 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00177 start = end
00178 end += 4
00179 (length,) = _struct_I.unpack(str[start:end])
00180 start = end
00181 end += length
00182 if python3:
00183 val1.type = str[start:end].decode('utf-8')
00184 else:
00185 val1.type = str[start:end]
00186 self.objects.append(val1)
00187 return self
00188 except struct.error as e:
00189 raise genpy.DeserializationError(e)
00190
00191
00192 def serialize_numpy(self, buff, numpy):
00193 """
00194 serialize message with numpy array types into buffer
00195 :param buff: buffer, ``StringIO``
00196 :param numpy: numpy python module
00197 """
00198 try:
00199 _x = self
00200 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00201 _x = self.header.frame_id
00202 length = len(_x)
00203 if python3 or type(_x) == unicode:
00204 _x = _x.encode('utf-8')
00205 length = len(_x)
00206 buff.write(struct.pack('<I%ss'%length, length, _x))
00207 length = len(self.objects)
00208 buff.write(_struct_I.pack(length))
00209 for val1 in self.objects:
00210 _v7 = val1.pose
00211 _v8 = _v7.position
00212 _x = _v8
00213 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00214 _v9 = _v7.orientation
00215 _x = _v9
00216 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00217 _x = val1.type
00218 length = len(_x)
00219 if python3 or type(_x) == unicode:
00220 _x = _x.encode('utf-8')
00221 length = len(_x)
00222 buff.write(struct.pack('<I%ss'%length, length, _x))
00223 except struct.error as se: self._check_types(se)
00224 except TypeError as te: self._check_types(te)
00225
00226 def deserialize_numpy(self, str, numpy):
00227 """
00228 unpack serialized message in str into this message instance using numpy for array types
00229 :param str: byte array of serialized message, ``str``
00230 :param numpy: numpy python module
00231 """
00232 try:
00233 if self.header is None:
00234 self.header = std_msgs.msg.Header()
00235 if self.objects is None:
00236 self.objects = None
00237 end = 0
00238 _x = self
00239 start = end
00240 end += 12
00241 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00242 start = end
00243 end += 4
00244 (length,) = _struct_I.unpack(str[start:end])
00245 start = end
00246 end += length
00247 if python3:
00248 self.header.frame_id = str[start:end].decode('utf-8')
00249 else:
00250 self.header.frame_id = str[start:end]
00251 start = end
00252 end += 4
00253 (length,) = _struct_I.unpack(str[start:end])
00254 self.objects = []
00255 for i in range(0, length):
00256 val1 = posedetection_msgs.msg.Object6DPose()
00257 _v10 = val1.pose
00258 _v11 = _v10.position
00259 _x = _v11
00260 start = end
00261 end += 24
00262 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00263 _v12 = _v10.orientation
00264 _x = _v12
00265 start = end
00266 end += 32
00267 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00268 start = end
00269 end += 4
00270 (length,) = _struct_I.unpack(str[start:end])
00271 start = end
00272 end += length
00273 if python3:
00274 val1.type = str[start:end].decode('utf-8')
00275 else:
00276 val1.type = str[start:end]
00277 self.objects.append(val1)
00278 return self
00279 except struct.error as e:
00280 raise genpy.DeserializationError(e)
00281
00282 _struct_I = genpy.struct_I
00283 _struct_3I = struct.Struct("<3I")
00284 _struct_4d = struct.Struct("<4d")
00285 _struct_3d = struct.Struct("<3d")