_PlanPathGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from youbot_overhead_localization/PlanPathGoal.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class PlanPathGoal(genpy.Message):
00009   _md5sum = "c50bc79d9f349f1d008ebeae98c02beb"
00010   _type = "youbot_overhead_localization/PlanPathGoal"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00013 #goal definition
00014 string topic_name
00015 float32 x
00016 float32 y
00017 
00018 """
00019   __slots__ = ['topic_name','x','y']
00020   _slot_types = ['string','float32','float32']
00021 
00022   def __init__(self, *args, **kwds):
00023     """
00024     Constructor. Any message fields that are implicitly/explicitly
00025     set to None will be assigned a default value. The recommend
00026     use is keyword arguments as this is more robust to future message
00027     changes.  You cannot mix in-order arguments and keyword arguments.
00028 
00029     The available fields are:
00030        topic_name,x,y
00031 
00032     :param args: complete set of field values, in .msg order
00033     :param kwds: use keyword arguments corresponding to message field names
00034     to set specific fields.
00035     """
00036     if args or kwds:
00037       super(PlanPathGoal, self).__init__(*args, **kwds)
00038       #message fields cannot be None, assign default values for those that are
00039       if self.topic_name is None:
00040         self.topic_name = ''
00041       if self.x is None:
00042         self.x = 0.
00043       if self.y is None:
00044         self.y = 0.
00045     else:
00046       self.topic_name = ''
00047       self.x = 0.
00048       self.y = 0.
00049 
00050   def _get_types(self):
00051     """
00052     internal API method
00053     """
00054     return self._slot_types
00055 
00056   def serialize(self, buff):
00057     """
00058     serialize message into buffer
00059     :param buff: buffer, ``StringIO``
00060     """
00061     try:
00062       _x = self.topic_name
00063       length = len(_x)
00064       if python3 or type(_x) == unicode:
00065         _x = _x.encode('utf-8')
00066         length = len(_x)
00067       buff.write(struct.pack('<I%ss'%length, length, _x))
00068       _x = self
00069       buff.write(_struct_2f.pack(_x.x, _x.y))
00070     except struct.error as se: self._check_types(se)
00071     except TypeError as te: self._check_types(te)
00072 
00073   def deserialize(self, str):
00074     """
00075     unpack serialized message in str into this message instance
00076     :param str: byte array of serialized message, ``str``
00077     """
00078     try:
00079       end = 0
00080       start = end
00081       end += 4
00082       (length,) = _struct_I.unpack(str[start:end])
00083       start = end
00084       end += length
00085       if python3:
00086         self.topic_name = str[start:end].decode('utf-8')
00087       else:
00088         self.topic_name = str[start:end]
00089       _x = self
00090       start = end
00091       end += 8
00092       (_x.x, _x.y,) = _struct_2f.unpack(str[start:end])
00093       return self
00094     except struct.error as e:
00095       raise genpy.DeserializationError(e) #most likely buffer underfill
00096 
00097 
00098   def serialize_numpy(self, buff, numpy):
00099     """
00100     serialize message with numpy array types into buffer
00101     :param buff: buffer, ``StringIO``
00102     :param numpy: numpy python module
00103     """
00104     try:
00105       _x = self.topic_name
00106       length = len(_x)
00107       if python3 or type(_x) == unicode:
00108         _x = _x.encode('utf-8')
00109         length = len(_x)
00110       buff.write(struct.pack('<I%ss'%length, length, _x))
00111       _x = self
00112       buff.write(_struct_2f.pack(_x.x, _x.y))
00113     except struct.error as se: self._check_types(se)
00114     except TypeError as te: self._check_types(te)
00115 
00116   def deserialize_numpy(self, str, numpy):
00117     """
00118     unpack serialized message in str into this message instance using numpy for array types
00119     :param str: byte array of serialized message, ``str``
00120     :param numpy: numpy python module
00121     """
00122     try:
00123       end = 0
00124       start = end
00125       end += 4
00126       (length,) = _struct_I.unpack(str[start:end])
00127       start = end
00128       end += length
00129       if python3:
00130         self.topic_name = str[start:end].decode('utf-8')
00131       else:
00132         self.topic_name = str[start:end]
00133       _x = self
00134       start = end
00135       end += 8
00136       (_x.x, _x.y,) = _struct_2f.unpack(str[start:end])
00137       return self
00138     except struct.error as e:
00139       raise genpy.DeserializationError(e) #most likely buffer underfill
00140 
00141 _struct_I = genpy.struct_I
00142 _struct_2f = struct.Struct("<2f")


youbot_overhead_localization
Author(s): David Kent
autogenerated on Thu Jan 2 2014 12:14:20