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