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