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