$search
00001 """autogenerated by genmsg_py from PosePercept.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 import worldmodel_msgs.msg 00007 import std_msgs.msg 00008 00009 class PosePercept(roslib.message.Message): 00010 _md5sum = "3b0c987b9e39c7b12b9e71be97a0c021" 00011 _type = "worldmodel_msgs/PosePercept" 00012 _has_header = True #flag to mark the presence of a Header object 00013 _full_text = """# This message represents an observation of an object in a single image. 00014 00015 # The header should equal the header of the corresponding image. 00016 Header header 00017 00018 # The estimated pose of the object with its covariance 00019 geometry_msgs/PoseWithCovariance pose 00020 00021 # Additional information about the percept 00022 worldmodel_msgs/PerceptInfo info 00023 00024 ================================================================================ 00025 MSG: std_msgs/Header 00026 # Standard metadata for higher-level stamped data types. 00027 # This is generally used to communicate timestamped data 00028 # in a particular coordinate frame. 00029 # 00030 # sequence ID: consecutively increasing ID 00031 uint32 seq 00032 #Two-integer timestamp that is expressed as: 00033 # * stamp.secs: seconds (stamp_secs) since epoch 00034 # * stamp.nsecs: nanoseconds since stamp_secs 00035 # time-handling sugar is provided by the client library 00036 time stamp 00037 #Frame this data is associated with 00038 # 0: no frame 00039 # 1: global frame 00040 string frame_id 00041 00042 ================================================================================ 00043 MSG: geometry_msgs/PoseWithCovariance 00044 # This represents a pose in free space with uncertainty. 00045 00046 Pose pose 00047 00048 # Row-major representation of the 6x6 covariance matrix 00049 # The orientation parameters use a fixed-axis representation. 00050 # In order, the parameters are: 00051 # (x, y, z, rotation about X axis, rotation about Y axis, rotation about Z axis) 00052 float64[36] covariance 00053 00054 ================================================================================ 00055 MSG: geometry_msgs/Pose 00056 # A representation of pose in free space, composed of postion and orientation. 00057 Point position 00058 Quaternion orientation 00059 00060 ================================================================================ 00061 MSG: geometry_msgs/Point 00062 # This contains the position of a point in free space 00063 float64 x 00064 float64 y 00065 float64 z 00066 00067 ================================================================================ 00068 MSG: geometry_msgs/Quaternion 00069 # This represents an orientation in free space in quaternion form. 00070 00071 float64 x 00072 float64 y 00073 float64 z 00074 float64 w 00075 00076 ================================================================================ 00077 MSG: worldmodel_msgs/PerceptInfo 00078 # This message contains information about the estimated class and object identity 00079 00080 # A string identifying the object's class (all objects of a class look the same) 00081 string class_id 00082 00083 # The class association support of the observation 00084 # The support is the log odd likelihood ratio given by log(p(y/observation y belongs to object of class class_id) / p(y/observation y is a false positive)) 00085 float32 class_support 00086 00087 # A string identifying a specific object 00088 string object_id 00089 00090 # The object association support of the observation 00091 # The support is the log odd likelihood ratio given by log(p(observation belongs to object object_id) / p(observation is false positive or belongs to another object)) 00092 float32 object_support 00093 00094 # A string that contains the name or a description of the specific object 00095 string name 00096 00097 """ 00098 __slots__ = ['header','pose','info'] 00099 _slot_types = ['Header','geometry_msgs/PoseWithCovariance','worldmodel_msgs/PerceptInfo'] 00100 00101 def __init__(self, *args, **kwds): 00102 """ 00103 Constructor. Any message fields that are implicitly/explicitly 00104 set to None will be assigned a default value. The recommend 00105 use is keyword arguments as this is more robust to future message 00106 changes. You cannot mix in-order arguments and keyword arguments. 00107 00108 The available fields are: 00109 header,pose,info 00110 00111 @param args: complete set of field values, in .msg order 00112 @param kwds: use keyword arguments corresponding to message field names 00113 to set specific fields. 00114 """ 00115 if args or kwds: 00116 super(PosePercept, self).__init__(*args, **kwds) 00117 #message fields cannot be None, assign default values for those that are 00118 if self.header is None: 00119 self.header = std_msgs.msg._Header.Header() 00120 if self.pose is None: 00121 self.pose = geometry_msgs.msg.PoseWithCovariance() 00122 if self.info is None: 00123 self.info = worldmodel_msgs.msg.PerceptInfo() 00124 else: 00125 self.header = std_msgs.msg._Header.Header() 00126 self.pose = geometry_msgs.msg.PoseWithCovariance() 00127 self.info = worldmodel_msgs.msg.PerceptInfo() 00128 00129 def _get_types(self): 00130 """ 00131 internal API method 00132 """ 00133 return self._slot_types 00134 00135 def serialize(self, buff): 00136 """ 00137 serialize message into buffer 00138 @param buff: buffer 00139 @type buff: StringIO 00140 """ 00141 try: 00142 _x = self 00143 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00144 _x = self.header.frame_id 00145 length = len(_x) 00146 buff.write(struct.pack('<I%ss'%length, length, _x)) 00147 _x = self 00148 buff.write(_struct_7d.pack(_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w)) 00149 buff.write(_struct_36d.pack(*self.pose.covariance)) 00150 _x = self.info.class_id 00151 length = len(_x) 00152 buff.write(struct.pack('<I%ss'%length, length, _x)) 00153 buff.write(_struct_f.pack(self.info.class_support)) 00154 _x = self.info.object_id 00155 length = len(_x) 00156 buff.write(struct.pack('<I%ss'%length, length, _x)) 00157 buff.write(_struct_f.pack(self.info.object_support)) 00158 _x = self.info.name 00159 length = len(_x) 00160 buff.write(struct.pack('<I%ss'%length, length, _x)) 00161 except struct.error as se: self._check_types(se) 00162 except TypeError as te: self._check_types(te) 00163 00164 def deserialize(self, str): 00165 """ 00166 unpack serialized message in str into this message instance 00167 @param str: byte array of serialized message 00168 @type str: str 00169 """ 00170 try: 00171 if self.header is None: 00172 self.header = std_msgs.msg._Header.Header() 00173 if self.pose is None: 00174 self.pose = geometry_msgs.msg.PoseWithCovariance() 00175 if self.info is None: 00176 self.info = worldmodel_msgs.msg.PerceptInfo() 00177 end = 0 00178 _x = self 00179 start = end 00180 end += 12 00181 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00182 start = end 00183 end += 4 00184 (length,) = _struct_I.unpack(str[start:end]) 00185 start = end 00186 end += length 00187 self.header.frame_id = str[start:end] 00188 _x = self 00189 start = end 00190 end += 56 00191 (_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w,) = _struct_7d.unpack(str[start:end]) 00192 start = end 00193 end += 288 00194 self.pose.covariance = _struct_36d.unpack(str[start:end]) 00195 start = end 00196 end += 4 00197 (length,) = _struct_I.unpack(str[start:end]) 00198 start = end 00199 end += length 00200 self.info.class_id = str[start:end] 00201 start = end 00202 end += 4 00203 (self.info.class_support,) = _struct_f.unpack(str[start:end]) 00204 start = end 00205 end += 4 00206 (length,) = _struct_I.unpack(str[start:end]) 00207 start = end 00208 end += length 00209 self.info.object_id = str[start:end] 00210 start = end 00211 end += 4 00212 (self.info.object_support,) = _struct_f.unpack(str[start:end]) 00213 start = end 00214 end += 4 00215 (length,) = _struct_I.unpack(str[start:end]) 00216 start = end 00217 end += length 00218 self.info.name = str[start:end] 00219 return self 00220 except struct.error as e: 00221 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00222 00223 00224 def serialize_numpy(self, buff, numpy): 00225 """ 00226 serialize message with numpy array types into buffer 00227 @param buff: buffer 00228 @type buff: StringIO 00229 @param numpy: numpy python module 00230 @type numpy module 00231 """ 00232 try: 00233 _x = self 00234 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00235 _x = self.header.frame_id 00236 length = len(_x) 00237 buff.write(struct.pack('<I%ss'%length, length, _x)) 00238 _x = self 00239 buff.write(_struct_7d.pack(_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w)) 00240 buff.write(self.pose.covariance.tostring()) 00241 _x = self.info.class_id 00242 length = len(_x) 00243 buff.write(struct.pack('<I%ss'%length, length, _x)) 00244 buff.write(_struct_f.pack(self.info.class_support)) 00245 _x = self.info.object_id 00246 length = len(_x) 00247 buff.write(struct.pack('<I%ss'%length, length, _x)) 00248 buff.write(_struct_f.pack(self.info.object_support)) 00249 _x = self.info.name 00250 length = len(_x) 00251 buff.write(struct.pack('<I%ss'%length, length, _x)) 00252 except struct.error as se: self._check_types(se) 00253 except TypeError as te: self._check_types(te) 00254 00255 def deserialize_numpy(self, str, numpy): 00256 """ 00257 unpack serialized message in str into this message instance using numpy for array types 00258 @param str: byte array of serialized message 00259 @type str: str 00260 @param numpy: numpy python module 00261 @type numpy: module 00262 """ 00263 try: 00264 if self.header is None: 00265 self.header = std_msgs.msg._Header.Header() 00266 if self.pose is None: 00267 self.pose = geometry_msgs.msg.PoseWithCovariance() 00268 if self.info is None: 00269 self.info = worldmodel_msgs.msg.PerceptInfo() 00270 end = 0 00271 _x = self 00272 start = end 00273 end += 12 00274 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00275 start = end 00276 end += 4 00277 (length,) = _struct_I.unpack(str[start:end]) 00278 start = end 00279 end += length 00280 self.header.frame_id = str[start:end] 00281 _x = self 00282 start = end 00283 end += 56 00284 (_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w,) = _struct_7d.unpack(str[start:end]) 00285 start = end 00286 end += 288 00287 self.pose.covariance = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=36) 00288 start = end 00289 end += 4 00290 (length,) = _struct_I.unpack(str[start:end]) 00291 start = end 00292 end += length 00293 self.info.class_id = str[start:end] 00294 start = end 00295 end += 4 00296 (self.info.class_support,) = _struct_f.unpack(str[start:end]) 00297 start = end 00298 end += 4 00299 (length,) = _struct_I.unpack(str[start:end]) 00300 start = end 00301 end += length 00302 self.info.object_id = str[start:end] 00303 start = end 00304 end += 4 00305 (self.info.object_support,) = _struct_f.unpack(str[start:end]) 00306 start = end 00307 end += 4 00308 (length,) = _struct_I.unpack(str[start:end]) 00309 start = end 00310 end += length 00311 self.info.name = str[start:end] 00312 return self 00313 except struct.error as e: 00314 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00315 00316 _struct_I = roslib.message.struct_I 00317 _struct_3I = struct.Struct("<3I") 00318 _struct_7d = struct.Struct("<7d") 00319 _struct_36d = struct.Struct("<36d") 00320 _struct_f = struct.Struct("<f")