00001 """autogenerated by genpy from tf2_msgs/LookupTransformResult.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import geometry_msgs.msg
00008 import tf2_msgs.msg
00009 import std_msgs.msg
00010
00011 class LookupTransformResult(genpy.Message):
00012 _md5sum = "3fe5db6a19ca9cfb675418c5ad875c36"
00013 _type = "tf2_msgs/LookupTransformResult"
00014 _has_header = False
00015 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00016 geometry_msgs/TransformStamped transform
00017 tf2_msgs/TF2Error error
00018
00019 ================================================================================
00020 MSG: geometry_msgs/TransformStamped
00021 # This expresses a transform from coordinate frame header.frame_id
00022 # to the coordinate frame child_frame_id
00023 #
00024 # This message is mostly used by the
00025 # <a href="http://www.ros.org/wiki/tf">tf</a> package.
00026 # See it's documentation for more information.
00027
00028 Header header
00029 string child_frame_id # the frame id of the child frame
00030 Transform transform
00031
00032 ================================================================================
00033 MSG: std_msgs/Header
00034 # Standard metadata for higher-level stamped data types.
00035 # This is generally used to communicate timestamped data
00036 # in a particular coordinate frame.
00037 #
00038 # sequence ID: consecutively increasing ID
00039 uint32 seq
00040 #Two-integer timestamp that is expressed as:
00041 # * stamp.secs: seconds (stamp_secs) since epoch
00042 # * stamp.nsecs: nanoseconds since stamp_secs
00043 # time-handling sugar is provided by the client library
00044 time stamp
00045 #Frame this data is associated with
00046 # 0: no frame
00047 # 1: global frame
00048 string frame_id
00049
00050 ================================================================================
00051 MSG: geometry_msgs/Transform
00052 # This represents the transform between two coordinate frames in free space.
00053
00054 Vector3 translation
00055 Quaternion rotation
00056
00057 ================================================================================
00058 MSG: geometry_msgs/Vector3
00059 # This represents a vector in free space.
00060
00061 float64 x
00062 float64 y
00063 float64 z
00064 ================================================================================
00065 MSG: geometry_msgs/Quaternion
00066 # This represents an orientation in free space in quaternion form.
00067
00068 float64 x
00069 float64 y
00070 float64 z
00071 float64 w
00072
00073 ================================================================================
00074 MSG: tf2_msgs/TF2Error
00075 uint8 NO_ERROR = 0
00076 uint8 LOOKUP_ERROR = 1
00077 uint8 CONNECTIVITY_ERROR = 2
00078 uint8 EXTRAPOLATION_ERROR = 3
00079 uint8 INVALID_ARGUMENT_ERROR = 4
00080 uint8 TIMEOUT_ERROR = 5
00081 uint8 TRANSFORM_ERROR = 6
00082
00083 uint8 error
00084 string error_string
00085
00086 """
00087 __slots__ = ['transform','error']
00088 _slot_types = ['geometry_msgs/TransformStamped','tf2_msgs/TF2Error']
00089
00090 def __init__(self, *args, **kwds):
00091 """
00092 Constructor. Any message fields that are implicitly/explicitly
00093 set to None will be assigned a default value. The recommend
00094 use is keyword arguments as this is more robust to future message
00095 changes. You cannot mix in-order arguments and keyword arguments.
00096
00097 The available fields are:
00098 transform,error
00099
00100 :param args: complete set of field values, in .msg order
00101 :param kwds: use keyword arguments corresponding to message field names
00102 to set specific fields.
00103 """
00104 if args or kwds:
00105 super(LookupTransformResult, self).__init__(*args, **kwds)
00106
00107 if self.transform is None:
00108 self.transform = geometry_msgs.msg.TransformStamped()
00109 if self.error is None:
00110 self.error = tf2_msgs.msg.TF2Error()
00111 else:
00112 self.transform = geometry_msgs.msg.TransformStamped()
00113 self.error = tf2_msgs.msg.TF2Error()
00114
00115 def _get_types(self):
00116 """
00117 internal API method
00118 """
00119 return self._slot_types
00120
00121 def serialize(self, buff):
00122 """
00123 serialize message into buffer
00124 :param buff: buffer, ``StringIO``
00125 """
00126 try:
00127 _x = self
00128 buff.write(_struct_3I.pack(_x.transform.header.seq, _x.transform.header.stamp.secs, _x.transform.header.stamp.nsecs))
00129 _x = self.transform.header.frame_id
00130 length = len(_x)
00131 if python3 or type(_x) == unicode:
00132 _x = _x.encode('utf-8')
00133 length = len(_x)
00134 buff.write(struct.pack('<I%ss'%length, length, _x))
00135 _x = self.transform.child_frame_id
00136 length = len(_x)
00137 if python3 or type(_x) == unicode:
00138 _x = _x.encode('utf-8')
00139 length = len(_x)
00140 buff.write(struct.pack('<I%ss'%length, length, _x))
00141 _x = self
00142 buff.write(_struct_7dB.pack(_x.transform.transform.translation.x, _x.transform.transform.translation.y, _x.transform.transform.translation.z, _x.transform.transform.rotation.x, _x.transform.transform.rotation.y, _x.transform.transform.rotation.z, _x.transform.transform.rotation.w, _x.error.error))
00143 _x = self.error.error_string
00144 length = len(_x)
00145 if python3 or type(_x) == unicode:
00146 _x = _x.encode('utf-8')
00147 length = len(_x)
00148 buff.write(struct.pack('<I%ss'%length, length, _x))
00149 except struct.error as se: self._check_types(se)
00150 except TypeError as te: self._check_types(te)
00151
00152 def deserialize(self, str):
00153 """
00154 unpack serialized message in str into this message instance
00155 :param str: byte array of serialized message, ``str``
00156 """
00157 try:
00158 if self.transform is None:
00159 self.transform = geometry_msgs.msg.TransformStamped()
00160 if self.error is None:
00161 self.error = tf2_msgs.msg.TF2Error()
00162 end = 0
00163 _x = self
00164 start = end
00165 end += 12
00166 (_x.transform.header.seq, _x.transform.header.stamp.secs, _x.transform.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 if python3:
00173 self.transform.header.frame_id = str[start:end].decode('utf-8')
00174 else:
00175 self.transform.header.frame_id = str[start:end]
00176 start = end
00177 end += 4
00178 (length,) = _struct_I.unpack(str[start:end])
00179 start = end
00180 end += length
00181 if python3:
00182 self.transform.child_frame_id = str[start:end].decode('utf-8')
00183 else:
00184 self.transform.child_frame_id = str[start:end]
00185 _x = self
00186 start = end
00187 end += 57
00188 (_x.transform.transform.translation.x, _x.transform.transform.translation.y, _x.transform.transform.translation.z, _x.transform.transform.rotation.x, _x.transform.transform.rotation.y, _x.transform.transform.rotation.z, _x.transform.transform.rotation.w, _x.error.error,) = _struct_7dB.unpack(str[start:end])
00189 start = end
00190 end += 4
00191 (length,) = _struct_I.unpack(str[start:end])
00192 start = end
00193 end += length
00194 if python3:
00195 self.error.error_string = str[start:end].decode('utf-8')
00196 else:
00197 self.error.error_string = str[start:end]
00198 return self
00199 except struct.error as e:
00200 raise genpy.DeserializationError(e)
00201
00202
00203 def serialize_numpy(self, buff, numpy):
00204 """
00205 serialize message with numpy array types into buffer
00206 :param buff: buffer, ``StringIO``
00207 :param numpy: numpy python module
00208 """
00209 try:
00210 _x = self
00211 buff.write(_struct_3I.pack(_x.transform.header.seq, _x.transform.header.stamp.secs, _x.transform.header.stamp.nsecs))
00212 _x = self.transform.header.frame_id
00213 length = len(_x)
00214 if python3 or type(_x) == unicode:
00215 _x = _x.encode('utf-8')
00216 length = len(_x)
00217 buff.write(struct.pack('<I%ss'%length, length, _x))
00218 _x = self.transform.child_frame_id
00219 length = len(_x)
00220 if python3 or type(_x) == unicode:
00221 _x = _x.encode('utf-8')
00222 length = len(_x)
00223 buff.write(struct.pack('<I%ss'%length, length, _x))
00224 _x = self
00225 buff.write(_struct_7dB.pack(_x.transform.transform.translation.x, _x.transform.transform.translation.y, _x.transform.transform.translation.z, _x.transform.transform.rotation.x, _x.transform.transform.rotation.y, _x.transform.transform.rotation.z, _x.transform.transform.rotation.w, _x.error.error))
00226 _x = self.error.error_string
00227 length = len(_x)
00228 if python3 or type(_x) == unicode:
00229 _x = _x.encode('utf-8')
00230 length = len(_x)
00231 buff.write(struct.pack('<I%ss'%length, length, _x))
00232 except struct.error as se: self._check_types(se)
00233 except TypeError as te: self._check_types(te)
00234
00235 def deserialize_numpy(self, str, numpy):
00236 """
00237 unpack serialized message in str into this message instance using numpy for array types
00238 :param str: byte array of serialized message, ``str``
00239 :param numpy: numpy python module
00240 """
00241 try:
00242 if self.transform is None:
00243 self.transform = geometry_msgs.msg.TransformStamped()
00244 if self.error is None:
00245 self.error = tf2_msgs.msg.TF2Error()
00246 end = 0
00247 _x = self
00248 start = end
00249 end += 12
00250 (_x.transform.header.seq, _x.transform.header.stamp.secs, _x.transform.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00251 start = end
00252 end += 4
00253 (length,) = _struct_I.unpack(str[start:end])
00254 start = end
00255 end += length
00256 if python3:
00257 self.transform.header.frame_id = str[start:end].decode('utf-8')
00258 else:
00259 self.transform.header.frame_id = str[start:end]
00260 start = end
00261 end += 4
00262 (length,) = _struct_I.unpack(str[start:end])
00263 start = end
00264 end += length
00265 if python3:
00266 self.transform.child_frame_id = str[start:end].decode('utf-8')
00267 else:
00268 self.transform.child_frame_id = str[start:end]
00269 _x = self
00270 start = end
00271 end += 57
00272 (_x.transform.transform.translation.x, _x.transform.transform.translation.y, _x.transform.transform.translation.z, _x.transform.transform.rotation.x, _x.transform.transform.rotation.y, _x.transform.transform.rotation.z, _x.transform.transform.rotation.w, _x.error.error,) = _struct_7dB.unpack(str[start:end])
00273 start = end
00274 end += 4
00275 (length,) = _struct_I.unpack(str[start:end])
00276 start = end
00277 end += length
00278 if python3:
00279 self.error.error_string = str[start:end].decode('utf-8')
00280 else:
00281 self.error.error_string = str[start:end]
00282 return self
00283 except struct.error as e:
00284 raise genpy.DeserializationError(e)
00285
00286 _struct_I = genpy.struct_I
00287 _struct_3I = struct.Struct("<3I")
00288 _struct_7dB = struct.Struct("<7dB")