$search
00001 """autogenerated by genmsg_py from ReactiveGraspFeedback.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import object_manipulation_msgs.msg 00006 00007 class ReactiveGraspFeedback(roslib.message.Message): 00008 _md5sum = "f5854fd8810580aa0bc24d4d76384836" 00009 _type = "object_manipulation_msgs/ReactiveGraspFeedback" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00012 00013 # which phase the grasp is in 00014 00015 ManipulationPhase manipulation_phase 00016 00017 00018 00019 00020 ================================================================================ 00021 MSG: object_manipulation_msgs/ManipulationPhase 00022 int32 CHECKING_FEASIBILITY = 0 00023 int32 MOVING_TO_PREGRASP = 1 00024 int32 MOVING_TO_GRASP = 2 00025 int32 CLOSING = 3 00026 int32 ADJUSTING_GRASP = 4 00027 int32 LIFTING = 5 00028 int32 MOVING_WITH_OBJECT = 6 00029 int32 MOVING_TO_PLACE = 7 00030 int32 PLACING = 8 00031 int32 OPENING = 9 00032 int32 RETREATING = 10 00033 int32 MOVING_WITHOUT_OBJECT = 11 00034 int32 SHAKING = 12 00035 int32 SUCCEEDED = 13 00036 int32 FAILED = 14 00037 int32 ABORTED = 15 00038 int32 HOLDING_OBJECT = 16 00039 00040 int32 phase 00041 """ 00042 __slots__ = ['manipulation_phase'] 00043 _slot_types = ['object_manipulation_msgs/ManipulationPhase'] 00044 00045 def __init__(self, *args, **kwds): 00046 """ 00047 Constructor. Any message fields that are implicitly/explicitly 00048 set to None will be assigned a default value. The recommend 00049 use is keyword arguments as this is more robust to future message 00050 changes. You cannot mix in-order arguments and keyword arguments. 00051 00052 The available fields are: 00053 manipulation_phase 00054 00055 @param args: complete set of field values, in .msg order 00056 @param kwds: use keyword arguments corresponding to message field names 00057 to set specific fields. 00058 """ 00059 if args or kwds: 00060 super(ReactiveGraspFeedback, self).__init__(*args, **kwds) 00061 #message fields cannot be None, assign default values for those that are 00062 if self.manipulation_phase is None: 00063 self.manipulation_phase = object_manipulation_msgs.msg.ManipulationPhase() 00064 else: 00065 self.manipulation_phase = object_manipulation_msgs.msg.ManipulationPhase() 00066 00067 def _get_types(self): 00068 """ 00069 internal API method 00070 """ 00071 return self._slot_types 00072 00073 def serialize(self, buff): 00074 """ 00075 serialize message into buffer 00076 @param buff: buffer 00077 @type buff: StringIO 00078 """ 00079 try: 00080 buff.write(_struct_i.pack(self.manipulation_phase.phase)) 00081 except struct.error as se: self._check_types(se) 00082 except TypeError as te: self._check_types(te) 00083 00084 def deserialize(self, str): 00085 """ 00086 unpack serialized message in str into this message instance 00087 @param str: byte array of serialized message 00088 @type str: str 00089 """ 00090 try: 00091 if self.manipulation_phase is None: 00092 self.manipulation_phase = object_manipulation_msgs.msg.ManipulationPhase() 00093 end = 0 00094 start = end 00095 end += 4 00096 (self.manipulation_phase.phase,) = _struct_i.unpack(str[start:end]) 00097 return self 00098 except struct.error as e: 00099 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00100 00101 00102 def serialize_numpy(self, buff, numpy): 00103 """ 00104 serialize message with numpy array types into buffer 00105 @param buff: buffer 00106 @type buff: StringIO 00107 @param numpy: numpy python module 00108 @type numpy module 00109 """ 00110 try: 00111 buff.write(_struct_i.pack(self.manipulation_phase.phase)) 00112 except struct.error as se: self._check_types(se) 00113 except TypeError as te: self._check_types(te) 00114 00115 def deserialize_numpy(self, str, numpy): 00116 """ 00117 unpack serialized message in str into this message instance using numpy for array types 00118 @param str: byte array of serialized message 00119 @type str: str 00120 @param numpy: numpy python module 00121 @type numpy: module 00122 """ 00123 try: 00124 if self.manipulation_phase is None: 00125 self.manipulation_phase = object_manipulation_msgs.msg.ManipulationPhase() 00126 end = 0 00127 start = end 00128 end += 4 00129 (self.manipulation_phase.phase,) = _struct_i.unpack(str[start:end]) 00130 return self 00131 except struct.error as e: 00132 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00133 00134 _struct_I = roslib.message.struct_I 00135 _struct_i = struct.Struct("<i")