$search
00001 """autogenerated by genmsg_py from GraspResult.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class GraspResult(roslib.message.Message): 00007 _md5sum = "c8a909da895cdddc0630aafd59848191" 00008 _type = "object_manipulation_msgs/GraspResult" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """int32 SUCCESS = 1 00011 int32 GRASP_OUT_OF_REACH = 2 00012 int32 GRASP_IN_COLLISION = 3 00013 int32 GRASP_UNFEASIBLE = 4 00014 int32 PREGRASP_OUT_OF_REACH = 5 00015 int32 PREGRASP_IN_COLLISION = 6 00016 int32 PREGRASP_UNFEASIBLE = 7 00017 int32 LIFT_OUT_OF_REACH = 8 00018 int32 LIFT_IN_COLLISION = 9 00019 int32 LIFT_UNFEASIBLE = 10 00020 int32 MOVE_ARM_FAILED = 11 00021 int32 GRASP_FAILED = 12 00022 int32 LIFT_FAILED = 13 00023 int32 RETREAT_FAILED = 14 00024 int32 result_code 00025 00026 # whether the state of the world was disturbed by this attempt. generally, this flag 00027 # shows if another task can be attempted, or a new sensed world model is recommeded 00028 # before proceeding 00029 bool continuation_possible 00030 00031 """ 00032 # Pseudo-constants 00033 SUCCESS = 1 00034 GRASP_OUT_OF_REACH = 2 00035 GRASP_IN_COLLISION = 3 00036 GRASP_UNFEASIBLE = 4 00037 PREGRASP_OUT_OF_REACH = 5 00038 PREGRASP_IN_COLLISION = 6 00039 PREGRASP_UNFEASIBLE = 7 00040 LIFT_OUT_OF_REACH = 8 00041 LIFT_IN_COLLISION = 9 00042 LIFT_UNFEASIBLE = 10 00043 MOVE_ARM_FAILED = 11 00044 GRASP_FAILED = 12 00045 LIFT_FAILED = 13 00046 RETREAT_FAILED = 14 00047 00048 __slots__ = ['result_code','continuation_possible'] 00049 _slot_types = ['int32','bool'] 00050 00051 def __init__(self, *args, **kwds): 00052 """ 00053 Constructor. Any message fields that are implicitly/explicitly 00054 set to None will be assigned a default value. The recommend 00055 use is keyword arguments as this is more robust to future message 00056 changes. You cannot mix in-order arguments and keyword arguments. 00057 00058 The available fields are: 00059 result_code,continuation_possible 00060 00061 @param args: complete set of field values, in .msg order 00062 @param kwds: use keyword arguments corresponding to message field names 00063 to set specific fields. 00064 """ 00065 if args or kwds: 00066 super(GraspResult, self).__init__(*args, **kwds) 00067 #message fields cannot be None, assign default values for those that are 00068 if self.result_code is None: 00069 self.result_code = 0 00070 if self.continuation_possible is None: 00071 self.continuation_possible = False 00072 else: 00073 self.result_code = 0 00074 self.continuation_possible = False 00075 00076 def _get_types(self): 00077 """ 00078 internal API method 00079 """ 00080 return self._slot_types 00081 00082 def serialize(self, buff): 00083 """ 00084 serialize message into buffer 00085 @param buff: buffer 00086 @type buff: StringIO 00087 """ 00088 try: 00089 _x = self 00090 buff.write(_struct_iB.pack(_x.result_code, _x.continuation_possible)) 00091 except struct.error as se: self._check_types(se) 00092 except TypeError as te: self._check_types(te) 00093 00094 def deserialize(self, str): 00095 """ 00096 unpack serialized message in str into this message instance 00097 @param str: byte array of serialized message 00098 @type str: str 00099 """ 00100 try: 00101 end = 0 00102 _x = self 00103 start = end 00104 end += 5 00105 (_x.result_code, _x.continuation_possible,) = _struct_iB.unpack(str[start:end]) 00106 self.continuation_possible = bool(self.continuation_possible) 00107 return self 00108 except struct.error as e: 00109 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00110 00111 00112 def serialize_numpy(self, buff, numpy): 00113 """ 00114 serialize message with numpy array types into buffer 00115 @param buff: buffer 00116 @type buff: StringIO 00117 @param numpy: numpy python module 00118 @type numpy module 00119 """ 00120 try: 00121 _x = self 00122 buff.write(_struct_iB.pack(_x.result_code, _x.continuation_possible)) 00123 except struct.error as se: self._check_types(se) 00124 except TypeError as te: self._check_types(te) 00125 00126 def deserialize_numpy(self, str, numpy): 00127 """ 00128 unpack serialized message in str into this message instance using numpy for array types 00129 @param str: byte array of serialized message 00130 @type str: str 00131 @param numpy: numpy python module 00132 @type numpy: module 00133 """ 00134 try: 00135 end = 0 00136 _x = self 00137 start = end 00138 end += 5 00139 (_x.result_code, _x.continuation_possible,) = _struct_iB.unpack(str[start:end]) 00140 self.continuation_possible = bool(self.continuation_possible) 00141 return self 00142 except struct.error as e: 00143 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00144 00145 _struct_I = roslib.message.struct_I 00146 _struct_iB = struct.Struct("<iB")