_ManualArmManipGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from srs_assisted_arm_navigation_msgs/ManualArmManipGoal.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 ManualArmManipGoal(genpy.Message):
00009   _md5sum = "f3a15b9c9a2e4fccc9f9cf1224d8b54d"
00010   _type = "srs_assisted_arm_navigation_msgs/ManualArmManipGoal"
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
00014 string action # description what to do
00015 string post_action # string which will be displayed after user finished task
00016 bool allow_repeat
00017 string object_name
00018 
00019 """
00020   __slots__ = ['action','post_action','allow_repeat','object_name']
00021   _slot_types = ['string','string','bool','string']
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        action,post_action,allow_repeat,object_name
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(ManualArmManipGoal, self).__init__(*args, **kwds)
00039       #message fields cannot be None, assign default values for those that are
00040       if self.action is None:
00041         self.action = ''
00042       if self.post_action is None:
00043         self.post_action = ''
00044       if self.allow_repeat is None:
00045         self.allow_repeat = False
00046       if self.object_name is None:
00047         self.object_name = ''
00048     else:
00049       self.action = ''
00050       self.post_action = ''
00051       self.allow_repeat = False
00052       self.object_name = ''
00053 
00054   def _get_types(self):
00055     """
00056     internal API method
00057     """
00058     return self._slot_types
00059 
00060   def serialize(self, buff):
00061     """
00062     serialize message into buffer
00063     :param buff: buffer, ``StringIO``
00064     """
00065     try:
00066       _x = self.action
00067       length = len(_x)
00068       if python3 or type(_x) == unicode:
00069         _x = _x.encode('utf-8')
00070         length = len(_x)
00071       buff.write(struct.pack('<I%ss'%length, length, _x))
00072       _x = self.post_action
00073       length = len(_x)
00074       if python3 or type(_x) == unicode:
00075         _x = _x.encode('utf-8')
00076         length = len(_x)
00077       buff.write(struct.pack('<I%ss'%length, length, _x))
00078       buff.write(_struct_B.pack(self.allow_repeat))
00079       _x = self.object_name
00080       length = len(_x)
00081       if python3 or type(_x) == unicode:
00082         _x = _x.encode('utf-8')
00083         length = len(_x)
00084       buff.write(struct.pack('<I%ss'%length, length, _x))
00085     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00086     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00087 
00088   def deserialize(self, str):
00089     """
00090     unpack serialized message in str into this message instance
00091     :param str: byte array of serialized message, ``str``
00092     """
00093     try:
00094       end = 0
00095       start = end
00096       end += 4
00097       (length,) = _struct_I.unpack(str[start:end])
00098       start = end
00099       end += length
00100       if python3:
00101         self.action = str[start:end].decode('utf-8')
00102       else:
00103         self.action = str[start:end]
00104       start = end
00105       end += 4
00106       (length,) = _struct_I.unpack(str[start:end])
00107       start = end
00108       end += length
00109       if python3:
00110         self.post_action = str[start:end].decode('utf-8')
00111       else:
00112         self.post_action = str[start:end]
00113       start = end
00114       end += 1
00115       (self.allow_repeat,) = _struct_B.unpack(str[start:end])
00116       self.allow_repeat = bool(self.allow_repeat)
00117       start = end
00118       end += 4
00119       (length,) = _struct_I.unpack(str[start:end])
00120       start = end
00121       end += length
00122       if python3:
00123         self.object_name = str[start:end].decode('utf-8')
00124       else:
00125         self.object_name = str[start:end]
00126       return self
00127     except struct.error as e:
00128       raise genpy.DeserializationError(e) #most likely buffer underfill
00129 
00130 
00131   def serialize_numpy(self, buff, numpy):
00132     """
00133     serialize message with numpy array types into buffer
00134     :param buff: buffer, ``StringIO``
00135     :param numpy: numpy python module
00136     """
00137     try:
00138       _x = self.action
00139       length = len(_x)
00140       if python3 or type(_x) == unicode:
00141         _x = _x.encode('utf-8')
00142         length = len(_x)
00143       buff.write(struct.pack('<I%ss'%length, length, _x))
00144       _x = self.post_action
00145       length = len(_x)
00146       if python3 or type(_x) == unicode:
00147         _x = _x.encode('utf-8')
00148         length = len(_x)
00149       buff.write(struct.pack('<I%ss'%length, length, _x))
00150       buff.write(_struct_B.pack(self.allow_repeat))
00151       _x = self.object_name
00152       length = len(_x)
00153       if python3 or type(_x) == unicode:
00154         _x = _x.encode('utf-8')
00155         length = len(_x)
00156       buff.write(struct.pack('<I%ss'%length, length, _x))
00157     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00158     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00159 
00160   def deserialize_numpy(self, str, numpy):
00161     """
00162     unpack serialized message in str into this message instance using numpy for array types
00163     :param str: byte array of serialized message, ``str``
00164     :param numpy: numpy python module
00165     """
00166     try:
00167       end = 0
00168       start = end
00169       end += 4
00170       (length,) = _struct_I.unpack(str[start:end])
00171       start = end
00172       end += length
00173       if python3:
00174         self.action = str[start:end].decode('utf-8')
00175       else:
00176         self.action = str[start:end]
00177       start = end
00178       end += 4
00179       (length,) = _struct_I.unpack(str[start:end])
00180       start = end
00181       end += length
00182       if python3:
00183         self.post_action = str[start:end].decode('utf-8')
00184       else:
00185         self.post_action = str[start:end]
00186       start = end
00187       end += 1
00188       (self.allow_repeat,) = _struct_B.unpack(str[start:end])
00189       self.allow_repeat = bool(self.allow_repeat)
00190       start = end
00191       end += 4
00192       (length,) = _struct_I.unpack(str[start:end])
00193       start = end
00194       end += length
00195       if python3:
00196         self.object_name = str[start:end].decode('utf-8')
00197       else:
00198         self.object_name = str[start:end]
00199       return self
00200     except struct.error as e:
00201       raise genpy.DeserializationError(e) #most likely buffer underfill
00202 
00203 _struct_I = genpy.struct_I
00204 _struct_B = struct.Struct("<B")


srs_assisted_arm_navigation_msgs
Author(s): Zdenek Materna
autogenerated on Mon Oct 6 2014 08:09:35