_MakeStaticCollisionMapGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from arm_navigation_msgs/MakeStaticCollisionMapGoal.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 MakeStaticCollisionMapGoal(genpy.Message):
00009   _md5sum = "43564281ea7e3c1ca0f01095edc909f7"
00010   _type = "arm_navigation_msgs/MakeStaticCollisionMapGoal"
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 #The source to use to make the stable map
00014 string cloud_source
00015 
00016 #The number of clouds to compose the stable map
00017 int32 number_of_clouds
00018 
00019 """
00020   __slots__ = ['cloud_source','number_of_clouds']
00021   _slot_types = ['string','int32']
00022 
00023   def __init__(self, *args, **kwds):
00024     """
00025     Constructor. Any message fields that are implicitly/explicitly
00026     set to None will be assigned a default value. The recommend
00027     use is keyword arguments as this is more robust to future message
00028     changes.  You cannot mix in-order arguments and keyword arguments.
00029 
00030     The available fields are:
00031        cloud_source,number_of_clouds
00032 
00033     :param args: complete set of field values, in .msg order
00034     :param kwds: use keyword arguments corresponding to message field names
00035     to set specific fields.
00036     """
00037     if args or kwds:
00038       super(MakeStaticCollisionMapGoal, self).__init__(*args, **kwds)
00039       #message fields cannot be None, assign default values for those that are
00040       if self.cloud_source is None:
00041         self.cloud_source = ''
00042       if self.number_of_clouds is None:
00043         self.number_of_clouds = 0
00044     else:
00045       self.cloud_source = ''
00046       self.number_of_clouds = 0
00047 
00048   def _get_types(self):
00049     """
00050     internal API method
00051     """
00052     return self._slot_types
00053 
00054   def serialize(self, buff):
00055     """
00056     serialize message into buffer
00057     :param buff: buffer, ``StringIO``
00058     """
00059     try:
00060       _x = self.cloud_source
00061       length = len(_x)
00062       if python3 or type(_x) == unicode:
00063         _x = _x.encode('utf-8')
00064         length = len(_x)
00065       buff.write(struct.pack('<I%ss'%length, length, _x))
00066       buff.write(_struct_i.pack(self.number_of_clouds))
00067     except struct.error as se: self._check_types(se)
00068     except TypeError as te: self._check_types(te)
00069 
00070   def deserialize(self, str):
00071     """
00072     unpack serialized message in str into this message instance
00073     :param str: byte array of serialized message, ``str``
00074     """
00075     try:
00076       end = 0
00077       start = end
00078       end += 4
00079       (length,) = _struct_I.unpack(str[start:end])
00080       start = end
00081       end += length
00082       if python3:
00083         self.cloud_source = str[start:end].decode('utf-8')
00084       else:
00085         self.cloud_source = str[start:end]
00086       start = end
00087       end += 4
00088       (self.number_of_clouds,) = _struct_i.unpack(str[start:end])
00089       return self
00090     except struct.error as e:
00091       raise genpy.DeserializationError(e) #most likely buffer underfill
00092 
00093 
00094   def serialize_numpy(self, buff, numpy):
00095     """
00096     serialize message with numpy array types into buffer
00097     :param buff: buffer, ``StringIO``
00098     :param numpy: numpy python module
00099     """
00100     try:
00101       _x = self.cloud_source
00102       length = len(_x)
00103       if python3 or type(_x) == unicode:
00104         _x = _x.encode('utf-8')
00105         length = len(_x)
00106       buff.write(struct.pack('<I%ss'%length, length, _x))
00107       buff.write(_struct_i.pack(self.number_of_clouds))
00108     except struct.error as se: self._check_types(se)
00109     except TypeError as te: self._check_types(te)
00110 
00111   def deserialize_numpy(self, str, numpy):
00112     """
00113     unpack serialized message in str into this message instance using numpy for array types
00114     :param str: byte array of serialized message, ``str``
00115     :param numpy: numpy python module
00116     """
00117     try:
00118       end = 0
00119       start = end
00120       end += 4
00121       (length,) = _struct_I.unpack(str[start:end])
00122       start = end
00123       end += length
00124       if python3:
00125         self.cloud_source = str[start:end].decode('utf-8')
00126       else:
00127         self.cloud_source = str[start:end]
00128       start = end
00129       end += 4
00130       (self.number_of_clouds,) = _struct_i.unpack(str[start:end])
00131       return self
00132     except struct.error as e:
00133       raise genpy.DeserializationError(e) #most likely buffer underfill
00134 
00135 _struct_I = genpy.struct_I
00136 _struct_i = struct.Struct("<i")


arm_navigation_msgs
Author(s): Gil Jones
autogenerated on Mon Dec 2 2013 12:31:50