_IMGUICommand.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_object_manipulation_msgs/IMGUICommand.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 IMGUICommand(genpy.Message):
00009   _md5sum = "d4a7867f271ce2cd8a5b55564de95925"
00010   _type = "pr2_object_manipulation_msgs/IMGUICommand"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 int32 PICKUP = 0
00014 int32 PLACE = 1
00015 int32 PLANNED_MOVE = 2
00016 int32 RESET = 3
00017 int32 MOVE_ARM = 4
00018 int32 LOOK_AT_TABLE = 5
00019 int32 MODEL_OBJECT = 6
00020 int32 MOVE_GRIPPER = 7
00021 int32 SCRIPTED_ACTION = 8
00022 int32 STOP_NAV = 9
00023 
00024 int32 command
00025 string script_name
00026 string script_group_name
00027 
00028 """
00029   # Pseudo-constants
00030   PICKUP = 0
00031   PLACE = 1
00032   PLANNED_MOVE = 2
00033   RESET = 3
00034   MOVE_ARM = 4
00035   LOOK_AT_TABLE = 5
00036   MODEL_OBJECT = 6
00037   MOVE_GRIPPER = 7
00038   SCRIPTED_ACTION = 8
00039   STOP_NAV = 9
00040 
00041   __slots__ = ['command','script_name','script_group_name']
00042   _slot_types = ['int32','string','string']
00043 
00044   def __init__(self, *args, **kwds):
00045     """
00046     Constructor. Any message fields that are implicitly/explicitly
00047     set to None will be assigned a default value. The recommend
00048     use is keyword arguments as this is more robust to future message
00049     changes.  You cannot mix in-order arguments and keyword arguments.
00050 
00051     The available fields are:
00052        command,script_name,script_group_name
00053 
00054     :param args: complete set of field values, in .msg order
00055     :param kwds: use keyword arguments corresponding to message field names
00056     to set specific fields.
00057     """
00058     if args or kwds:
00059       super(IMGUICommand, self).__init__(*args, **kwds)
00060       #message fields cannot be None, assign default values for those that are
00061       if self.command is None:
00062         self.command = 0
00063       if self.script_name is None:
00064         self.script_name = ''
00065       if self.script_group_name is None:
00066         self.script_group_name = ''
00067     else:
00068       self.command = 0
00069       self.script_name = ''
00070       self.script_group_name = ''
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       buff.write(_struct_i.pack(self.command))
00085       _x = self.script_name
00086       length = len(_x)
00087       if python3 or type(_x) == unicode:
00088         _x = _x.encode('utf-8')
00089         length = len(_x)
00090       buff.write(struct.pack('<I%ss'%length, length, _x))
00091       _x = self.script_group_name
00092       length = len(_x)
00093       if python3 or type(_x) == unicode:
00094         _x = _x.encode('utf-8')
00095         length = len(_x)
00096       buff.write(struct.pack('<I%ss'%length, length, _x))
00097     except struct.error as se: self._check_types(se)
00098     except TypeError as te: self._check_types(te)
00099 
00100   def deserialize(self, str):
00101     """
00102     unpack serialized message in str into this message instance
00103     :param str: byte array of serialized message, ``str``
00104     """
00105     try:
00106       end = 0
00107       start = end
00108       end += 4
00109       (self.command,) = _struct_i.unpack(str[start:end])
00110       start = end
00111       end += 4
00112       (length,) = _struct_I.unpack(str[start:end])
00113       start = end
00114       end += length
00115       if python3:
00116         self.script_name = str[start:end].decode('utf-8')
00117       else:
00118         self.script_name = str[start:end]
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.script_group_name = str[start:end].decode('utf-8')
00126       else:
00127         self.script_group_name = str[start:end]
00128       return self
00129     except struct.error as e:
00130       raise genpy.DeserializationError(e) #most likely buffer underfill
00131 
00132 
00133   def serialize_numpy(self, buff, numpy):
00134     """
00135     serialize message with numpy array types into buffer
00136     :param buff: buffer, ``StringIO``
00137     :param numpy: numpy python module
00138     """
00139     try:
00140       buff.write(_struct_i.pack(self.command))
00141       _x = self.script_name
00142       length = len(_x)
00143       if python3 or type(_x) == unicode:
00144         _x = _x.encode('utf-8')
00145         length = len(_x)
00146       buff.write(struct.pack('<I%ss'%length, length, _x))
00147       _x = self.script_group_name
00148       length = len(_x)
00149       if python3 or type(_x) == unicode:
00150         _x = _x.encode('utf-8')
00151         length = len(_x)
00152       buff.write(struct.pack('<I%ss'%length, length, _x))
00153     except struct.error as se: self._check_types(se)
00154     except TypeError as te: self._check_types(te)
00155 
00156   def deserialize_numpy(self, str, numpy):
00157     """
00158     unpack serialized message in str into this message instance using numpy for array types
00159     :param str: byte array of serialized message, ``str``
00160     :param numpy: numpy python module
00161     """
00162     try:
00163       end = 0
00164       start = end
00165       end += 4
00166       (self.command,) = _struct_i.unpack(str[start:end])
00167       start = end
00168       end += 4
00169       (length,) = _struct_I.unpack(str[start:end])
00170       start = end
00171       end += length
00172       if python3:
00173         self.script_name = str[start:end].decode('utf-8')
00174       else:
00175         self.script_name = str[start:end]
00176       start = end
00177       end += 4
00178       (length,) = _struct_I.unpack(str[start:end])
00179       start = end
00180       end += length
00181       if python3:
00182         self.script_group_name = str[start:end].decode('utf-8')
00183       else:
00184         self.script_group_name = str[start:end]
00185       return self
00186     except struct.error as e:
00187       raise genpy.DeserializationError(e) #most likely buffer underfill
00188 
00189 _struct_I = genpy.struct_I
00190 _struct_i = struct.Struct("<i")


pr2_object_manipulation_msgs
Author(s): Matei Ciocarlie
autogenerated on Fri Jan 3 2014 11:59:13