_guideGoalGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from tibi_dabo_msgs/guideGoalGoal.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 guideGoalGoal(genpy.Message):
00009   _md5sum = "e0bc5509c1a0926a9251e0856c40a976"
00010   _type = "tibi_dabo_msgs/guideGoalGoal"
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                    location_id
00015 string                    robot_id
00016 int32                     target_id  
00017 
00018 """
00019   __slots__ = ['location_id','robot_id','target_id']
00020   _slot_types = ['string','string','int32']
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        location_id,robot_id,target_id
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(guideGoalGoal, self).__init__(*args, **kwds)
00038       #message fields cannot be None, assign default values for those that are
00039       if self.location_id is None:
00040         self.location_id = ''
00041       if self.robot_id is None:
00042         self.robot_id = ''
00043       if self.target_id is None:
00044         self.target_id = 0
00045     else:
00046       self.location_id = ''
00047       self.robot_id = ''
00048       self.target_id = 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.location_id
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.robot_id
00069       length = len(_x)
00070       if python3 or type(_x) == unicode:
00071         _x = _x.encode('utf-8')
00072         length = len(_x)
00073       buff.write(struct.pack('<I%ss'%length, length, _x))
00074       buff.write(_struct_i.pack(self.target_id))
00075     except struct.error as se: self._check_types(se)
00076     except TypeError as te: self._check_types(te)
00077 
00078   def deserialize(self, str):
00079     """
00080     unpack serialized message in str into this message instance
00081     :param str: byte array of serialized message, ``str``
00082     """
00083     try:
00084       end = 0
00085       start = end
00086       end += 4
00087       (length,) = _struct_I.unpack(str[start:end])
00088       start = end
00089       end += length
00090       if python3:
00091         self.location_id = str[start:end].decode('utf-8')
00092       else:
00093         self.location_id = str[start:end]
00094       start = end
00095       end += 4
00096       (length,) = _struct_I.unpack(str[start:end])
00097       start = end
00098       end += length
00099       if python3:
00100         self.robot_id = str[start:end].decode('utf-8')
00101       else:
00102         self.robot_id = str[start:end]
00103       start = end
00104       end += 4
00105       (self.target_id,) = _struct_i.unpack(str[start:end])
00106       return self
00107     except struct.error as e:
00108       raise genpy.DeserializationError(e) #most likely buffer underfill
00109 
00110 
00111   def serialize_numpy(self, buff, numpy):
00112     """
00113     serialize message with numpy array types into buffer
00114     :param buff: buffer, ``StringIO``
00115     :param numpy: numpy python module
00116     """
00117     try:
00118       _x = self.location_id
00119       length = len(_x)
00120       if python3 or type(_x) == unicode:
00121         _x = _x.encode('utf-8')
00122         length = len(_x)
00123       buff.write(struct.pack('<I%ss'%length, length, _x))
00124       _x = self.robot_id
00125       length = len(_x)
00126       if python3 or type(_x) == unicode:
00127         _x = _x.encode('utf-8')
00128         length = len(_x)
00129       buff.write(struct.pack('<I%ss'%length, length, _x))
00130       buff.write(_struct_i.pack(self.target_id))
00131     except struct.error as se: self._check_types(se)
00132     except TypeError as te: self._check_types(te)
00133 
00134   def deserialize_numpy(self, str, numpy):
00135     """
00136     unpack serialized message in str into this message instance using numpy for array types
00137     :param str: byte array of serialized message, ``str``
00138     :param numpy: numpy python module
00139     """
00140     try:
00141       end = 0
00142       start = end
00143       end += 4
00144       (length,) = _struct_I.unpack(str[start:end])
00145       start = end
00146       end += length
00147       if python3:
00148         self.location_id = str[start:end].decode('utf-8')
00149       else:
00150         self.location_id = str[start:end]
00151       start = end
00152       end += 4
00153       (length,) = _struct_I.unpack(str[start:end])
00154       start = end
00155       end += length
00156       if python3:
00157         self.robot_id = str[start:end].decode('utf-8')
00158       else:
00159         self.robot_id = str[start:end]
00160       start = end
00161       end += 4
00162       (self.target_id,) = _struct_i.unpack(str[start:end])
00163       return self
00164     except struct.error as e:
00165       raise genpy.DeserializationError(e) #most likely buffer underfill
00166 
00167 _struct_I = genpy.struct_I
00168 _struct_i = struct.Struct("<i")


tibi_dabo_msgs
Author(s): Sergi Hernandez Juan
autogenerated on Fri Dec 6 2013 20:03:32