$search
00001 """autogenerated by genmsg_py from IMGUICommand.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class IMGUICommand(roslib.message.Message): 00007 _md5sum = "d4a7867f271ce2cd8a5b55564de95925" 00008 _type = "pr2_object_manipulation_msgs/IMGUICommand" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """ 00011 int32 PICKUP = 0 00012 int32 PLACE = 1 00013 int32 PLANNED_MOVE = 2 00014 int32 RESET = 3 00015 int32 MOVE_ARM = 4 00016 int32 LOOK_AT_TABLE = 5 00017 int32 MODEL_OBJECT = 6 00018 int32 MOVE_GRIPPER = 7 00019 int32 SCRIPTED_ACTION = 8 00020 int32 STOP_NAV = 9 00021 00022 int32 command 00023 string script_name 00024 string script_group_name 00025 00026 """ 00027 # Pseudo-constants 00028 PICKUP = 0 00029 PLACE = 1 00030 PLANNED_MOVE = 2 00031 RESET = 3 00032 MOVE_ARM = 4 00033 LOOK_AT_TABLE = 5 00034 MODEL_OBJECT = 6 00035 MOVE_GRIPPER = 7 00036 SCRIPTED_ACTION = 8 00037 STOP_NAV = 9 00038 00039 __slots__ = ['command','script_name','script_group_name'] 00040 _slot_types = ['int32','string','string'] 00041 00042 def __init__(self, *args, **kwds): 00043 """ 00044 Constructor. Any message fields that are implicitly/explicitly 00045 set to None will be assigned a default value. The recommend 00046 use is keyword arguments as this is more robust to future message 00047 changes. You cannot mix in-order arguments and keyword arguments. 00048 00049 The available fields are: 00050 command,script_name,script_group_name 00051 00052 @param args: complete set of field values, in .msg order 00053 @param kwds: use keyword arguments corresponding to message field names 00054 to set specific fields. 00055 """ 00056 if args or kwds: 00057 super(IMGUICommand, self).__init__(*args, **kwds) 00058 #message fields cannot be None, assign default values for those that are 00059 if self.command is None: 00060 self.command = 0 00061 if self.script_name is None: 00062 self.script_name = '' 00063 if self.script_group_name is None: 00064 self.script_group_name = '' 00065 else: 00066 self.command = 0 00067 self.script_name = '' 00068 self.script_group_name = '' 00069 00070 def _get_types(self): 00071 """ 00072 internal API method 00073 """ 00074 return self._slot_types 00075 00076 def serialize(self, buff): 00077 """ 00078 serialize message into buffer 00079 @param buff: buffer 00080 @type buff: StringIO 00081 """ 00082 try: 00083 buff.write(_struct_i.pack(self.command)) 00084 _x = self.script_name 00085 length = len(_x) 00086 buff.write(struct.pack('<I%ss'%length, length, _x)) 00087 _x = self.script_group_name 00088 length = len(_x) 00089 buff.write(struct.pack('<I%ss'%length, length, _x)) 00090 except struct.error as se: self._check_types(se) 00091 except TypeError as te: self._check_types(te) 00092 00093 def deserialize(self, str): 00094 """ 00095 unpack serialized message in str into this message instance 00096 @param str: byte array of serialized message 00097 @type str: str 00098 """ 00099 try: 00100 end = 0 00101 start = end 00102 end += 4 00103 (self.command,) = _struct_i.unpack(str[start:end]) 00104 start = end 00105 end += 4 00106 (length,) = _struct_I.unpack(str[start:end]) 00107 start = end 00108 end += length 00109 self.script_name = str[start:end] 00110 start = end 00111 end += 4 00112 (length,) = _struct_I.unpack(str[start:end]) 00113 start = end 00114 end += length 00115 self.script_group_name = str[start:end] 00116 return self 00117 except struct.error as e: 00118 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00119 00120 00121 def serialize_numpy(self, buff, numpy): 00122 """ 00123 serialize message with numpy array types into buffer 00124 @param buff: buffer 00125 @type buff: StringIO 00126 @param numpy: numpy python module 00127 @type numpy module 00128 """ 00129 try: 00130 buff.write(_struct_i.pack(self.command)) 00131 _x = self.script_name 00132 length = len(_x) 00133 buff.write(struct.pack('<I%ss'%length, length, _x)) 00134 _x = self.script_group_name 00135 length = len(_x) 00136 buff.write(struct.pack('<I%ss'%length, length, _x)) 00137 except struct.error as se: self._check_types(se) 00138 except TypeError as te: self._check_types(te) 00139 00140 def deserialize_numpy(self, str, numpy): 00141 """ 00142 unpack serialized message in str into this message instance using numpy for array types 00143 @param str: byte array of serialized message 00144 @type str: str 00145 @param numpy: numpy python module 00146 @type numpy: module 00147 """ 00148 try: 00149 end = 0 00150 start = end 00151 end += 4 00152 (self.command,) = _struct_i.unpack(str[start:end]) 00153 start = end 00154 end += 4 00155 (length,) = _struct_I.unpack(str[start:end]) 00156 start = end 00157 end += length 00158 self.script_name = str[start:end] 00159 start = end 00160 end += 4 00161 (length,) = _struct_I.unpack(str[start:end]) 00162 start = end 00163 end += length 00164 self.script_group_name = str[start:end] 00165 return self 00166 except struct.error as e: 00167 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00168 00169 _struct_I = roslib.message.struct_I 00170 _struct_i = struct.Struct("<i")