00001 """autogenerated by genmsg_py from TwistStamped.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 TwistStamped(roslib.message.Message):
00009 _md5sum = "98d34b0043a2093cf9d9345ab6eef12e"
00010 _type = "geometry_msgs/TwistStamped"
00011 _has_header = True
00012 _full_text = """# A twist with reference coordinate frame and timestamp
00013 Header header
00014 Twist 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/Twist
00036 # This expresses velocity in free space broken into it's linear and angular parts.
00037 Vector3 linear
00038 Vector3 angular
00039
00040 ================================================================================
00041 MSG: geometry_msgs/Vector3
00042 # This represents a vector in free space.
00043
00044 float64 x
00045 float64 y
00046 float64 z
00047 """
00048 __slots__ = ['header','twist']
00049 _slot_types = ['Header','geometry_msgs/Twist']
00050
00051 def __init__(self, *args, **kwds):
00052 """
00053 Constructor. Any message fields that are implicitly/explicitly
00054 set to None will be assigned a default value. The recommend
00055 use is keyword arguments as this is more robust to future message
00056 changes. You cannot mix in-order arguments and keyword arguments.
00057
00058 The available fields are:
00059 header,twist
00060
00061 @param args: complete set of field values, in .msg order
00062 @param kwds: use keyword arguments corresponding to message field names
00063 to set specific fields.
00064 """
00065 if args or kwds:
00066 super(TwistStamped, self).__init__(*args, **kwds)
00067
00068 if self.header is None:
00069 self.header = std_msgs.msg._Header.Header()
00070 if self.twist is None:
00071 self.twist = geometry_msgs.msg.Twist()
00072 else:
00073 self.header = std_msgs.msg._Header.Header()
00074 self.twist = geometry_msgs.msg.Twist()
00075
00076 def _get_types(self):
00077 """
00078 internal API method
00079 """
00080 return self._slot_types
00081
00082 def serialize(self, buff):
00083 """
00084 serialize message into buffer
00085 @param buff: buffer
00086 @type buff: StringIO
00087 """
00088 try:
00089 _x = self
00090 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00091 _x = self.header.frame_id
00092 length = len(_x)
00093 buff.write(struct.pack('<I%ss'%length, length, _x))
00094 _x = self
00095 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))
00096 except struct.error, se: self._check_types(se)
00097 except TypeError, te: self._check_types(te)
00098
00099 def deserialize(self, str):
00100 """
00101 unpack serialized message in str into this message instance
00102 @param str: byte array of serialized message
00103 @type str: str
00104 """
00105 try:
00106 if self.header is None:
00107 self.header = std_msgs.msg._Header.Header()
00108 if self.twist is None:
00109 self.twist = geometry_msgs.msg.Twist()
00110 end = 0
00111 _x = self
00112 start = end
00113 end += 12
00114 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00115 start = end
00116 end += 4
00117 (length,) = _struct_I.unpack(str[start:end])
00118 start = end
00119 end += length
00120 self.header.frame_id = str[start:end]
00121 _x = self
00122 start = end
00123 end += 48
00124 (_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])
00125 return self
00126 except struct.error, e:
00127 raise roslib.message.DeserializationError(e)
00128
00129
00130 def serialize_numpy(self, buff, numpy):
00131 """
00132 serialize message with numpy array types into buffer
00133 @param buff: buffer
00134 @type buff: StringIO
00135 @param numpy: numpy python module
00136 @type numpy module
00137 """
00138 try:
00139 _x = self
00140 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00141 _x = self.header.frame_id
00142 length = len(_x)
00143 buff.write(struct.pack('<I%ss'%length, length, _x))
00144 _x = self
00145 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))
00146 except struct.error, se: self._check_types(se)
00147 except TypeError, te: self._check_types(te)
00148
00149 def deserialize_numpy(self, str, numpy):
00150 """
00151 unpack serialized message in str into this message instance using numpy for array types
00152 @param str: byte array of serialized message
00153 @type str: str
00154 @param numpy: numpy python module
00155 @type numpy: module
00156 """
00157 try:
00158 if self.header is None:
00159 self.header = std_msgs.msg._Header.Header()
00160 if self.twist is None:
00161 self.twist = geometry_msgs.msg.Twist()
00162 end = 0
00163 _x = self
00164 start = end
00165 end += 12
00166 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00167 start = end
00168 end += 4
00169 (length,) = _struct_I.unpack(str[start:end])
00170 start = end
00171 end += length
00172 self.header.frame_id = str[start:end]
00173 _x = self
00174 start = end
00175 end += 48
00176 (_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])
00177 return self
00178 except struct.error, e:
00179 raise roslib.message.DeserializationError(e)
00180
00181 _struct_I = roslib.message.struct_I
00182 _struct_3I = struct.Struct("<3I")
00183 _struct_6d = struct.Struct("<6d")