$search
00001 """autogenerated by genmsg_py from UserCommandGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class UserCommandGoal(roslib.message.Message): 00007 _md5sum = "c4a081a4406d3a53c6fc74271793a116" 00008 _type = "pr2_interactive_object_detection/UserCommandGoal" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00011 #request constants 00012 int8 LOOK_AT_TABLE=0 00013 00014 int8 SEGMENT=1 00015 int8 RECOGNIZE=2 00016 int8 DETECT=3 00017 int8 RESET=4 00018 00019 int8 request 00020 bool interactive 00021 00022 """ 00023 # Pseudo-constants 00024 LOOK_AT_TABLE = 0 00025 SEGMENT = 1 00026 RECOGNIZE = 2 00027 DETECT = 3 00028 RESET = 4 00029 00030 __slots__ = ['request','interactive'] 00031 _slot_types = ['int8','bool'] 00032 00033 def __init__(self, *args, **kwds): 00034 """ 00035 Constructor. Any message fields that are implicitly/explicitly 00036 set to None will be assigned a default value. The recommend 00037 use is keyword arguments as this is more robust to future message 00038 changes. You cannot mix in-order arguments and keyword arguments. 00039 00040 The available fields are: 00041 request,interactive 00042 00043 @param args: complete set of field values, in .msg order 00044 @param kwds: use keyword arguments corresponding to message field names 00045 to set specific fields. 00046 """ 00047 if args or kwds: 00048 super(UserCommandGoal, self).__init__(*args, **kwds) 00049 #message fields cannot be None, assign default values for those that are 00050 if self.request is None: 00051 self.request = 0 00052 if self.interactive is None: 00053 self.interactive = False 00054 else: 00055 self.request = 0 00056 self.interactive = False 00057 00058 def _get_types(self): 00059 """ 00060 internal API method 00061 """ 00062 return self._slot_types 00063 00064 def serialize(self, buff): 00065 """ 00066 serialize message into buffer 00067 @param buff: buffer 00068 @type buff: StringIO 00069 """ 00070 try: 00071 _x = self 00072 buff.write(_struct_bB.pack(_x.request, _x.interactive)) 00073 except struct.error as se: self._check_types(se) 00074 except TypeError as te: self._check_types(te) 00075 00076 def deserialize(self, str): 00077 """ 00078 unpack serialized message in str into this message instance 00079 @param str: byte array of serialized message 00080 @type str: str 00081 """ 00082 try: 00083 end = 0 00084 _x = self 00085 start = end 00086 end += 2 00087 (_x.request, _x.interactive,) = _struct_bB.unpack(str[start:end]) 00088 self.interactive = bool(self.interactive) 00089 return self 00090 except struct.error as e: 00091 raise roslib.message.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 00098 @type buff: StringIO 00099 @param numpy: numpy python module 00100 @type numpy module 00101 """ 00102 try: 00103 _x = self 00104 buff.write(_struct_bB.pack(_x.request, _x.interactive)) 00105 except struct.error as se: self._check_types(se) 00106 except TypeError as te: self._check_types(te) 00107 00108 def deserialize_numpy(self, str, numpy): 00109 """ 00110 unpack serialized message in str into this message instance using numpy for array types 00111 @param str: byte array of serialized message 00112 @type str: str 00113 @param numpy: numpy python module 00114 @type numpy: module 00115 """ 00116 try: 00117 end = 0 00118 _x = self 00119 start = end 00120 end += 2 00121 (_x.request, _x.interactive,) = _struct_bB.unpack(str[start:end]) 00122 self.interactive = bool(self.interactive) 00123 return self 00124 except struct.error as e: 00125 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00126 00127 _struct_I = roslib.message.struct_I 00128 _struct_bB = struct.Struct("<bB")