_LookupTransformGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from tf2_msgs/LookupTransformGoal.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 genpy
00008 
00009 class LookupTransformGoal(genpy.Message):
00010   _md5sum = "35e3720468131d675a18bb6f3e5f22f8"
00011   _type = "tf2_msgs/LookupTransformGoal"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00014 #Simple API
00015 string target_frame
00016 string source_frame
00017 time source_time
00018 duration timeout
00019 
00020 #Advanced API
00021 time target_time
00022 string fixed_frame
00023 
00024 #Whether or not to use the advanced API
00025 bool advanced
00026 
00027 
00028 """
00029   __slots__ = ['target_frame','source_frame','source_time','timeout','target_time','fixed_frame','advanced']
00030   _slot_types = ['string','string','time','duration','time','string','bool']
00031 
00032   def __init__(self, *args, **kwds):
00033     """
00034     Constructor. Any message fields that are implicitly/explicitly
00035     set to None will be assigned a default value. The recommend
00036     use is keyword arguments as this is more robust to future message
00037     changes.  You cannot mix in-order arguments and keyword arguments.
00038 
00039     The available fields are:
00040        target_frame,source_frame,source_time,timeout,target_time,fixed_frame,advanced
00041 
00042     :param args: complete set of field values, in .msg order
00043     :param kwds: use keyword arguments corresponding to message field names
00044     to set specific fields.
00045     """
00046     if args or kwds:
00047       super(LookupTransformGoal, self).__init__(*args, **kwds)
00048       #message fields cannot be None, assign default values for those that are
00049       if self.target_frame is None:
00050         self.target_frame = ''
00051       if self.source_frame is None:
00052         self.source_frame = ''
00053       if self.source_time is None:
00054         self.source_time = genpy.Time()
00055       if self.timeout is None:
00056         self.timeout = genpy.Duration()
00057       if self.target_time is None:
00058         self.target_time = genpy.Time()
00059       if self.fixed_frame is None:
00060         self.fixed_frame = ''
00061       if self.advanced is None:
00062         self.advanced = False
00063     else:
00064       self.target_frame = ''
00065       self.source_frame = ''
00066       self.source_time = genpy.Time()
00067       self.timeout = genpy.Duration()
00068       self.target_time = genpy.Time()
00069       self.fixed_frame = ''
00070       self.advanced = False
00071 
00072   def _get_types(self):
00073     """
00074     internal API method
00075     """
00076     return self._slot_types
00077 
00078   def serialize(self, buff):
00079     """
00080     serialize message into buffer
00081     :param buff: buffer, ``StringIO``
00082     """
00083     try:
00084       _x = self.target_frame
00085       length = len(_x)
00086       if python3 or type(_x) == unicode:
00087         _x = _x.encode('utf-8')
00088         length = len(_x)
00089       buff.write(struct.pack('<I%ss'%length, length, _x))
00090       _x = self.source_frame
00091       length = len(_x)
00092       if python3 or type(_x) == unicode:
00093         _x = _x.encode('utf-8')
00094         length = len(_x)
00095       buff.write(struct.pack('<I%ss'%length, length, _x))
00096       _x = self
00097       buff.write(_struct_2I2i2I.pack(_x.source_time.secs, _x.source_time.nsecs, _x.timeout.secs, _x.timeout.nsecs, _x.target_time.secs, _x.target_time.nsecs))
00098       _x = self.fixed_frame
00099       length = len(_x)
00100       if python3 or type(_x) == unicode:
00101         _x = _x.encode('utf-8')
00102         length = len(_x)
00103       buff.write(struct.pack('<I%ss'%length, length, _x))
00104       buff.write(_struct_B.pack(self.advanced))
00105     except struct.error as se: self._check_types(se)
00106     except TypeError as te: self._check_types(te)
00107 
00108   def deserialize(self, str):
00109     """
00110     unpack serialized message in str into this message instance
00111     :param str: byte array of serialized message, ``str``
00112     """
00113     try:
00114       if self.source_time is None:
00115         self.source_time = genpy.Time()
00116       if self.timeout is None:
00117         self.timeout = genpy.Duration()
00118       if self.target_time is None:
00119         self.target_time = genpy.Time()
00120       end = 0
00121       start = end
00122       end += 4
00123       (length,) = _struct_I.unpack(str[start:end])
00124       start = end
00125       end += length
00126       if python3:
00127         self.target_frame = str[start:end].decode('utf-8')
00128       else:
00129         self.target_frame = str[start:end]
00130       start = end
00131       end += 4
00132       (length,) = _struct_I.unpack(str[start:end])
00133       start = end
00134       end += length
00135       if python3:
00136         self.source_frame = str[start:end].decode('utf-8')
00137       else:
00138         self.source_frame = str[start:end]
00139       _x = self
00140       start = end
00141       end += 24
00142       (_x.source_time.secs, _x.source_time.nsecs, _x.timeout.secs, _x.timeout.nsecs, _x.target_time.secs, _x.target_time.nsecs,) = _struct_2I2i2I.unpack(str[start:end])
00143       start = end
00144       end += 4
00145       (length,) = _struct_I.unpack(str[start:end])
00146       start = end
00147       end += length
00148       if python3:
00149         self.fixed_frame = str[start:end].decode('utf-8')
00150       else:
00151         self.fixed_frame = str[start:end]
00152       start = end
00153       end += 1
00154       (self.advanced,) = _struct_B.unpack(str[start:end])
00155       self.advanced = bool(self.advanced)
00156       self.source_time.canon()
00157       self.timeout.canon()
00158       self.target_time.canon()
00159       return self
00160     except struct.error as e:
00161       raise genpy.DeserializationError(e) #most likely buffer underfill
00162 
00163 
00164   def serialize_numpy(self, buff, numpy):
00165     """
00166     serialize message with numpy array types into buffer
00167     :param buff: buffer, ``StringIO``
00168     :param numpy: numpy python module
00169     """
00170     try:
00171       _x = self.target_frame
00172       length = len(_x)
00173       if python3 or type(_x) == unicode:
00174         _x = _x.encode('utf-8')
00175         length = len(_x)
00176       buff.write(struct.pack('<I%ss'%length, length, _x))
00177       _x = self.source_frame
00178       length = len(_x)
00179       if python3 or type(_x) == unicode:
00180         _x = _x.encode('utf-8')
00181         length = len(_x)
00182       buff.write(struct.pack('<I%ss'%length, length, _x))
00183       _x = self
00184       buff.write(_struct_2I2i2I.pack(_x.source_time.secs, _x.source_time.nsecs, _x.timeout.secs, _x.timeout.nsecs, _x.target_time.secs, _x.target_time.nsecs))
00185       _x = self.fixed_frame
00186       length = len(_x)
00187       if python3 or type(_x) == unicode:
00188         _x = _x.encode('utf-8')
00189         length = len(_x)
00190       buff.write(struct.pack('<I%ss'%length, length, _x))
00191       buff.write(_struct_B.pack(self.advanced))
00192     except struct.error as se: self._check_types(se)
00193     except TypeError as te: self._check_types(te)
00194 
00195   def deserialize_numpy(self, str, numpy):
00196     """
00197     unpack serialized message in str into this message instance using numpy for array types
00198     :param str: byte array of serialized message, ``str``
00199     :param numpy: numpy python module
00200     """
00201     try:
00202       if self.source_time is None:
00203         self.source_time = genpy.Time()
00204       if self.timeout is None:
00205         self.timeout = genpy.Duration()
00206       if self.target_time is None:
00207         self.target_time = genpy.Time()
00208       end = 0
00209       start = end
00210       end += 4
00211       (length,) = _struct_I.unpack(str[start:end])
00212       start = end
00213       end += length
00214       if python3:
00215         self.target_frame = str[start:end].decode('utf-8')
00216       else:
00217         self.target_frame = str[start:end]
00218       start = end
00219       end += 4
00220       (length,) = _struct_I.unpack(str[start:end])
00221       start = end
00222       end += length
00223       if python3:
00224         self.source_frame = str[start:end].decode('utf-8')
00225       else:
00226         self.source_frame = str[start:end]
00227       _x = self
00228       start = end
00229       end += 24
00230       (_x.source_time.secs, _x.source_time.nsecs, _x.timeout.secs, _x.timeout.nsecs, _x.target_time.secs, _x.target_time.nsecs,) = _struct_2I2i2I.unpack(str[start:end])
00231       start = end
00232       end += 4
00233       (length,) = _struct_I.unpack(str[start:end])
00234       start = end
00235       end += length
00236       if python3:
00237         self.fixed_frame = str[start:end].decode('utf-8')
00238       else:
00239         self.fixed_frame = str[start:end]
00240       start = end
00241       end += 1
00242       (self.advanced,) = _struct_B.unpack(str[start:end])
00243       self.advanced = bool(self.advanced)
00244       self.source_time.canon()
00245       self.timeout.canon()
00246       self.target_time.canon()
00247       return self
00248     except struct.error as e:
00249       raise genpy.DeserializationError(e) #most likely buffer underfill
00250 
00251 _struct_I = genpy.struct_I
00252 _struct_B = struct.Struct("<B")
00253 _struct_2I2i2I = struct.Struct("<2I2i2I")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends


tf2_msgs
Author(s): Eitan Marder-Eppstein
autogenerated on Mon Aug 19 2013 10:26:46