$search
00001 """autogenerated by genmsg_py from PoseWithCovarianceStamped.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 import std_msgs.msg 00007 00008 class PoseWithCovarianceStamped(roslib.message.Message): 00009 _md5sum = "953b798c0f514ff060a53a3498ce6246" 00010 _type = "geometry_msgs/PoseWithCovarianceStamped" 00011 _has_header = True #flag to mark the presence of a Header object 00012 _full_text = """# This expresses an estimated pose with a reference coordinate frame and timestamp 00013 00014 Header header 00015 PoseWithCovariance pose 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: geometry_msgs/PoseWithCovariance 00037 # This represents a pose in free space with uncertainty. 00038 00039 Pose pose 00040 00041 # Row-major representation of the 6x6 covariance matrix 00042 # The orientation parameters use a fixed-axis representation. 00043 # In order, the parameters are: 00044 # (x, y, z, rotation about X axis, rotation about Y axis, rotation about Z axis) 00045 float64[36] covariance 00046 00047 ================================================================================ 00048 MSG: geometry_msgs/Pose 00049 # A representation of pose in free space, composed of postion and orientation. 00050 Point position 00051 Quaternion orientation 00052 00053 ================================================================================ 00054 MSG: geometry_msgs/Point 00055 # This contains the position of a point in free space 00056 float64 x 00057 float64 y 00058 float64 z 00059 00060 ================================================================================ 00061 MSG: geometry_msgs/Quaternion 00062 # This represents an orientation in free space in quaternion form. 00063 00064 float64 x 00065 float64 y 00066 float64 z 00067 float64 w 00068 00069 """ 00070 __slots__ = ['header','pose'] 00071 _slot_types = ['Header','geometry_msgs/PoseWithCovariance'] 00072 00073 def __init__(self, *args, **kwds): 00074 """ 00075 Constructor. Any message fields that are implicitly/explicitly 00076 set to None will be assigned a default value. The recommend 00077 use is keyword arguments as this is more robust to future message 00078 changes. You cannot mix in-order arguments and keyword arguments. 00079 00080 The available fields are: 00081 header,pose 00082 00083 @param args: complete set of field values, in .msg order 00084 @param kwds: use keyword arguments corresponding to message field names 00085 to set specific fields. 00086 """ 00087 if args or kwds: 00088 super(PoseWithCovarianceStamped, self).__init__(*args, **kwds) 00089 #message fields cannot be None, assign default values for those that are 00090 if self.header is None: 00091 self.header = std_msgs.msg._Header.Header() 00092 if self.pose is None: 00093 self.pose = geometry_msgs.msg.PoseWithCovariance() 00094 else: 00095 self.header = std_msgs.msg._Header.Header() 00096 self.pose = geometry_msgs.msg.PoseWithCovariance() 00097 00098 def _get_types(self): 00099 """ 00100 internal API method 00101 """ 00102 return self._slot_types 00103 00104 def serialize(self, buff): 00105 """ 00106 serialize message into buffer 00107 @param buff: buffer 00108 @type buff: StringIO 00109 """ 00110 try: 00111 _x = self 00112 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00113 _x = self.header.frame_id 00114 length = len(_x) 00115 buff.write(struct.pack('<I%ss'%length, length, _x)) 00116 _x = self 00117 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)) 00118 buff.write(_struct_36d.pack(*self.pose.covariance)) 00119 except struct.error as se: self._check_types(se) 00120 except TypeError as te: self._check_types(te) 00121 00122 def deserialize(self, str): 00123 """ 00124 unpack serialized message in str into this message instance 00125 @param str: byte array of serialized message 00126 @type str: str 00127 """ 00128 try: 00129 if self.header is None: 00130 self.header = std_msgs.msg._Header.Header() 00131 if self.pose is None: 00132 self.pose = geometry_msgs.msg.PoseWithCovariance() 00133 end = 0 00134 _x = self 00135 start = end 00136 end += 12 00137 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00138 start = end 00139 end += 4 00140 (length,) = _struct_I.unpack(str[start:end]) 00141 start = end 00142 end += length 00143 self.header.frame_id = str[start:end] 00144 _x = self 00145 start = end 00146 end += 56 00147 (_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]) 00148 start = end 00149 end += 288 00150 self.pose.covariance = _struct_36d.unpack(str[start:end]) 00151 return self 00152 except struct.error as e: 00153 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00154 00155 00156 def serialize_numpy(self, buff, numpy): 00157 """ 00158 serialize message with numpy array types into buffer 00159 @param buff: buffer 00160 @type buff: StringIO 00161 @param numpy: numpy python module 00162 @type numpy module 00163 """ 00164 try: 00165 _x = self 00166 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00167 _x = self.header.frame_id 00168 length = len(_x) 00169 buff.write(struct.pack('<I%ss'%length, length, _x)) 00170 _x = self 00171 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)) 00172 buff.write(self.pose.covariance.tostring()) 00173 except struct.error as se: self._check_types(se) 00174 except TypeError as te: self._check_types(te) 00175 00176 def deserialize_numpy(self, str, numpy): 00177 """ 00178 unpack serialized message in str into this message instance using numpy for array types 00179 @param str: byte array of serialized message 00180 @type str: str 00181 @param numpy: numpy python module 00182 @type numpy: module 00183 """ 00184 try: 00185 if self.header is None: 00186 self.header = std_msgs.msg._Header.Header() 00187 if self.pose is None: 00188 self.pose = geometry_msgs.msg.PoseWithCovariance() 00189 end = 0 00190 _x = self 00191 start = end 00192 end += 12 00193 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00194 start = end 00195 end += 4 00196 (length,) = _struct_I.unpack(str[start:end]) 00197 start = end 00198 end += length 00199 self.header.frame_id = str[start:end] 00200 _x = self 00201 start = end 00202 end += 56 00203 (_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]) 00204 start = end 00205 end += 288 00206 self.pose.covariance = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=36) 00207 return self 00208 except struct.error as e: 00209 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00210 00211 _struct_I = roslib.message.struct_I 00212 _struct_3I = struct.Struct("<3I") 00213 _struct_7d = struct.Struct("<7d") 00214 _struct_36d = struct.Struct("<36d")