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