$search
00001 """autogenerated by genmsg_py from PickupFeedback.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class PickupFeedback(roslib.message.Message): 00007 _md5sum = "864c83eb233aaa8fcbe0d88caed02501" 00008 _type = "object_manipulation_msgs/PickupFeedback" 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 00012 # The number of the grasp currently being attempted 00013 int32 current_grasp 00014 00015 # The total number of grasps that will be attempted 00016 int32 total_grasps 00017 00018 00019 """ 00020 __slots__ = ['current_grasp','total_grasps'] 00021 _slot_types = ['int32','int32'] 00022 00023 def __init__(self, *args, **kwds): 00024 """ 00025 Constructor. Any message fields that are implicitly/explicitly 00026 set to None will be assigned a default value. The recommend 00027 use is keyword arguments as this is more robust to future message 00028 changes. You cannot mix in-order arguments and keyword arguments. 00029 00030 The available fields are: 00031 current_grasp,total_grasps 00032 00033 @param args: complete set of field values, in .msg order 00034 @param kwds: use keyword arguments corresponding to message field names 00035 to set specific fields. 00036 """ 00037 if args or kwds: 00038 super(PickupFeedback, self).__init__(*args, **kwds) 00039 #message fields cannot be None, assign default values for those that are 00040 if self.current_grasp is None: 00041 self.current_grasp = 0 00042 if self.total_grasps is None: 00043 self.total_grasps = 0 00044 else: 00045 self.current_grasp = 0 00046 self.total_grasps = 0 00047 00048 def _get_types(self): 00049 """ 00050 internal API method 00051 """ 00052 return self._slot_types 00053 00054 def serialize(self, buff): 00055 """ 00056 serialize message into buffer 00057 @param buff: buffer 00058 @type buff: StringIO 00059 """ 00060 try: 00061 _x = self 00062 buff.write(_struct_2i.pack(_x.current_grasp, _x.total_grasps)) 00063 except struct.error as se: self._check_types(se) 00064 except TypeError as te: self._check_types(te) 00065 00066 def deserialize(self, str): 00067 """ 00068 unpack serialized message in str into this message instance 00069 @param str: byte array of serialized message 00070 @type str: str 00071 """ 00072 try: 00073 end = 0 00074 _x = self 00075 start = end 00076 end += 8 00077 (_x.current_grasp, _x.total_grasps,) = _struct_2i.unpack(str[start:end]) 00078 return self 00079 except struct.error as e: 00080 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00081 00082 00083 def serialize_numpy(self, buff, numpy): 00084 """ 00085 serialize message with numpy array types into buffer 00086 @param buff: buffer 00087 @type buff: StringIO 00088 @param numpy: numpy python module 00089 @type numpy module 00090 """ 00091 try: 00092 _x = self 00093 buff.write(_struct_2i.pack(_x.current_grasp, _x.total_grasps)) 00094 except struct.error as se: self._check_types(se) 00095 except TypeError as te: self._check_types(te) 00096 00097 def deserialize_numpy(self, str, numpy): 00098 """ 00099 unpack serialized message in str into this message instance using numpy for array types 00100 @param str: byte array of serialized message 00101 @type str: str 00102 @param numpy: numpy python module 00103 @type numpy: module 00104 """ 00105 try: 00106 end = 0 00107 _x = self 00108 start = end 00109 end += 8 00110 (_x.current_grasp, _x.total_grasps,) = _struct_2i.unpack(str[start:end]) 00111 return self 00112 except struct.error as e: 00113 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00114 00115 _struct_I = roslib.message.struct_I 00116 _struct_2i = struct.Struct("<2i")