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