$search
00001 """autogenerated by genmsg_py from PoseWithCovariance.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 00007 class PoseWithCovariance(roslib.message.Message): 00008 _md5sum = "c23e848cf1b7533a8d7c259073a97e6f" 00009 _type = "geometry_msgs/PoseWithCovariance" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """# This represents a pose in free space with uncertainty. 00012 00013 Pose pose 00014 00015 # Row-major representation of the 6x6 covariance matrix 00016 # The orientation parameters use a fixed-axis representation. 00017 # In order, the parameters are: 00018 # (x, y, z, rotation about X axis, rotation about Y axis, rotation about Z axis) 00019 float64[36] covariance 00020 00021 ================================================================================ 00022 MSG: geometry_msgs/Pose 00023 # A representation of pose in free space, composed of postion and orientation. 00024 Point position 00025 Quaternion orientation 00026 00027 ================================================================================ 00028 MSG: geometry_msgs/Point 00029 # This contains the position of a point in free space 00030 float64 x 00031 float64 y 00032 float64 z 00033 00034 ================================================================================ 00035 MSG: geometry_msgs/Quaternion 00036 # This represents an orientation in free space in quaternion form. 00037 00038 float64 x 00039 float64 y 00040 float64 z 00041 float64 w 00042 00043 """ 00044 __slots__ = ['pose','covariance'] 00045 _slot_types = ['geometry_msgs/Pose','float64[36]'] 00046 00047 def __init__(self, *args, **kwds): 00048 """ 00049 Constructor. Any message fields that are implicitly/explicitly 00050 set to None will be assigned a default value. The recommend 00051 use is keyword arguments as this is more robust to future message 00052 changes. You cannot mix in-order arguments and keyword arguments. 00053 00054 The available fields are: 00055 pose,covariance 00056 00057 @param args: complete set of field values, in .msg order 00058 @param kwds: use keyword arguments corresponding to message field names 00059 to set specific fields. 00060 """ 00061 if args or kwds: 00062 super(PoseWithCovariance, self).__init__(*args, **kwds) 00063 #message fields cannot be None, assign default values for those that are 00064 if self.pose is None: 00065 self.pose = geometry_msgs.msg.Pose() 00066 if self.covariance is None: 00067 self.covariance = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.] 00068 else: 00069 self.pose = geometry_msgs.msg.Pose() 00070 self.covariance = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.] 00071 00072 def _get_types(self): 00073 """ 00074 internal API method 00075 """ 00076 return self._slot_types 00077 00078 def serialize(self, buff): 00079 """ 00080 serialize message into buffer 00081 @param buff: buffer 00082 @type buff: StringIO 00083 """ 00084 try: 00085 _x = self 00086 buff.write(_struct_7d.pack(_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w)) 00087 buff.write(_struct_36d.pack(*self.covariance)) 00088 except struct.error as se: self._check_types(se) 00089 except TypeError as te: self._check_types(te) 00090 00091 def deserialize(self, str): 00092 """ 00093 unpack serialized message in str into this message instance 00094 @param str: byte array of serialized message 00095 @type str: str 00096 """ 00097 try: 00098 if self.pose is None: 00099 self.pose = geometry_msgs.msg.Pose() 00100 end = 0 00101 _x = self 00102 start = end 00103 end += 56 00104 (_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w,) = _struct_7d.unpack(str[start:end]) 00105 start = end 00106 end += 288 00107 self.covariance = _struct_36d.unpack(str[start:end]) 00108 return self 00109 except struct.error as e: 00110 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00111 00112 00113 def serialize_numpy(self, buff, numpy): 00114 """ 00115 serialize message with numpy array types into buffer 00116 @param buff: buffer 00117 @type buff: StringIO 00118 @param numpy: numpy python module 00119 @type numpy module 00120 """ 00121 try: 00122 _x = self 00123 buff.write(_struct_7d.pack(_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w)) 00124 buff.write(self.covariance.tostring()) 00125 except struct.error as se: self._check_types(se) 00126 except TypeError as te: self._check_types(te) 00127 00128 def deserialize_numpy(self, str, numpy): 00129 """ 00130 unpack serialized message in str into this message instance using numpy for array types 00131 @param str: byte array of serialized message 00132 @type str: str 00133 @param numpy: numpy python module 00134 @type numpy: module 00135 """ 00136 try: 00137 if self.pose is None: 00138 self.pose = geometry_msgs.msg.Pose() 00139 end = 0 00140 _x = self 00141 start = end 00142 end += 56 00143 (_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w,) = _struct_7d.unpack(str[start:end]) 00144 start = end 00145 end += 288 00146 self.covariance = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=36) 00147 return self 00148 except struct.error as e: 00149 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00150 00151 _struct_I = roslib.message.struct_I 00152 _struct_36d = struct.Struct("<36d") 00153 _struct_7d = struct.Struct("<7d")