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