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