00001 """autogenerated by genmsg_py from TwistWithCovarianceStamped.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 TwistWithCovarianceStamped(roslib.message.Message):
00009 _md5sum = "8927a1a12fb2607ceea095b2dc440a96"
00010 _type = "geometry_msgs/TwistWithCovarianceStamped"
00011 _has_header = True
00012 _full_text = """# This represents an estimate twist with reference coordinate frame and timestamp.
00013 Header header
00014 TwistWithCovariance twist
00015
00016 ================================================================================
00017 MSG: std_msgs/Header
00018 # Standard metadata for higher-level stamped data types.
00019 # This is generally used to communicate timestamped data
00020 # in a particular coordinate frame.
00021 #
00022 # sequence ID: consecutively increasing ID
00023 uint32 seq
00024 #Two-integer timestamp that is expressed as:
00025 # * stamp.secs: seconds (stamp_secs) since epoch
00026 # * stamp.nsecs: nanoseconds since stamp_secs
00027 # time-handling sugar is provided by the client library
00028 time stamp
00029 #Frame this data is associated with
00030 # 0: no frame
00031 # 1: global frame
00032 string frame_id
00033
00034 ================================================================================
00035 MSG: geometry_msgs/TwistWithCovariance
00036 # This expresses velocity in free space with uncertianty.
00037
00038 Twist twist
00039
00040 # Row-major representation of the 6x6 covariance matrix
00041 # The orientation parameters use a fixed-axis representation.
00042 # In order, the parameters are:
00043 # (x, y, z, rotation about X axis, rotation about Y axis, rotation about Z axis)
00044 float64[36] covariance
00045
00046 ================================================================================
00047 MSG: geometry_msgs/Twist
00048 # This expresses velocity in free space broken into it's linear and angular parts.
00049 Vector3 linear
00050 Vector3 angular
00051
00052 ================================================================================
00053 MSG: geometry_msgs/Vector3
00054 # This represents a vector in free space.
00055
00056 float64 x
00057 float64 y
00058 float64 z
00059 """
00060 __slots__ = ['header','twist']
00061 _slot_types = ['Header','geometry_msgs/TwistWithCovariance']
00062
00063 def __init__(self, *args, **kwds):
00064 """
00065 Constructor. Any message fields that are implicitly/explicitly
00066 set to None will be assigned a default value. The recommend
00067 use is keyword arguments as this is more robust to future message
00068 changes. You cannot mix in-order arguments and keyword arguments.
00069
00070 The available fields are:
00071 header,twist
00072
00073 @param args: complete set of field values, in .msg order
00074 @param kwds: use keyword arguments corresponding to message field names
00075 to set specific fields.
00076 """
00077 if args or kwds:
00078 super(TwistWithCovarianceStamped, self).__init__(*args, **kwds)
00079
00080 if self.header is None:
00081 self.header = std_msgs.msg._Header.Header()
00082 if self.twist is None:
00083 self.twist = geometry_msgs.msg.TwistWithCovariance()
00084 else:
00085 self.header = std_msgs.msg._Header.Header()
00086 self.twist = geometry_msgs.msg.TwistWithCovariance()
00087
00088 def _get_types(self):
00089 """
00090 internal API method
00091 """
00092 return self._slot_types
00093
00094 def serialize(self, buff):
00095 """
00096 serialize message into buffer
00097 @param buff: buffer
00098 @type buff: StringIO
00099 """
00100 try:
00101 _x = self
00102 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00103 _x = self.header.frame_id
00104 length = len(_x)
00105 buff.write(struct.pack('<I%ss'%length, length, _x))
00106 _x = self
00107 buff.write(_struct_6d.pack(_x.twist.twist.linear.x, _x.twist.twist.linear.y, _x.twist.twist.linear.z, _x.twist.twist.angular.x, _x.twist.twist.angular.y, _x.twist.twist.angular.z))
00108 buff.write(_struct_36d.pack(*self.twist.covariance))
00109 except struct.error, se: self._check_types(se)
00110 except TypeError, te: self._check_types(te)
00111
00112 def deserialize(self, str):
00113 """
00114 unpack serialized message in str into this message instance
00115 @param str: byte array of serialized message
00116 @type str: str
00117 """
00118 try:
00119 if self.header is None:
00120 self.header = std_msgs.msg._Header.Header()
00121 if self.twist is None:
00122 self.twist = geometry_msgs.msg.TwistWithCovariance()
00123 end = 0
00124 _x = self
00125 start = end
00126 end += 12
00127 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00128 start = end
00129 end += 4
00130 (length,) = _struct_I.unpack(str[start:end])
00131 start = end
00132 end += length
00133 self.header.frame_id = str[start:end]
00134 _x = self
00135 start = end
00136 end += 48
00137 (_x.twist.twist.linear.x, _x.twist.twist.linear.y, _x.twist.twist.linear.z, _x.twist.twist.angular.x, _x.twist.twist.angular.y, _x.twist.twist.angular.z,) = _struct_6d.unpack(str[start:end])
00138 start = end
00139 end += 288
00140 self.twist.covariance = _struct_36d.unpack(str[start:end])
00141 return self
00142 except struct.error, e:
00143 raise roslib.message.DeserializationError(e)
00144
00145
00146 def serialize_numpy(self, buff, numpy):
00147 """
00148 serialize message with numpy array types into buffer
00149 @param buff: buffer
00150 @type buff: StringIO
00151 @param numpy: numpy python module
00152 @type numpy module
00153 """
00154 try:
00155 _x = self
00156 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00157 _x = self.header.frame_id
00158 length = len(_x)
00159 buff.write(struct.pack('<I%ss'%length, length, _x))
00160 _x = self
00161 buff.write(_struct_6d.pack(_x.twist.twist.linear.x, _x.twist.twist.linear.y, _x.twist.twist.linear.z, _x.twist.twist.angular.x, _x.twist.twist.angular.y, _x.twist.twist.angular.z))
00162 buff.write(self.twist.covariance.tostring())
00163 except struct.error, se: self._check_types(se)
00164 except TypeError, te: self._check_types(te)
00165
00166 def deserialize_numpy(self, str, numpy):
00167 """
00168 unpack serialized message in str into this message instance using numpy for array types
00169 @param str: byte array of serialized message
00170 @type str: str
00171 @param numpy: numpy python module
00172 @type numpy: module
00173 """
00174 try:
00175 if self.header is None:
00176 self.header = std_msgs.msg._Header.Header()
00177 if self.twist is None:
00178 self.twist = geometry_msgs.msg.TwistWithCovariance()
00179 end = 0
00180 _x = self
00181 start = end
00182 end += 12
00183 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00184 start = end
00185 end += 4
00186 (length,) = _struct_I.unpack(str[start:end])
00187 start = end
00188 end += length
00189 self.header.frame_id = str[start:end]
00190 _x = self
00191 start = end
00192 end += 48
00193 (_x.twist.twist.linear.x, _x.twist.twist.linear.y, _x.twist.twist.linear.z, _x.twist.twist.angular.x, _x.twist.twist.angular.y, _x.twist.twist.angular.z,) = _struct_6d.unpack(str[start:end])
00194 start = end
00195 end += 288
00196 self.twist.covariance = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=36)
00197 return self
00198 except struct.error, e:
00199 raise roslib.message.DeserializationError(e)
00200
00201 _struct_I = roslib.message.struct_I
00202 _struct_3I = struct.Struct("<3I")
00203 _struct_6d = struct.Struct("<6d")
00204 _struct_36d = struct.Struct("<36d")