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