00001 """autogenerated by genmsg_py from PlaceFeedback.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class PlaceFeedback(roslib.message.Message):
00007 _md5sum = "5976b498bfb9532a526a0e0e50282d2f"
00008 _type = "object_manipulation_msgs/PlaceFeedback"
00009 _has_header = False
00010 _full_text = """# The number of the place location currently being attempted
00011 int32 current_location
00012
00013 # The total number of locations that will be attempted
00014 int32 total_locations
00015
00016
00017
00018
00019 """
00020 __slots__ = ['current_location','total_locations']
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_location,total_locations
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(PlaceFeedback, self).__init__(*args, **kwds)
00039
00040 if self.current_location is None:
00041 self.current_location = 0
00042 if self.total_locations is None:
00043 self.total_locations = 0
00044 else:
00045 self.current_location = 0
00046 self.total_locations = 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_location, _x.total_locations))
00063 except struct.error, se: self._check_types(se)
00064 except TypeError, 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_location, _x.total_locations,) = _struct_2i.unpack(str[start:end])
00078 return self
00079 except struct.error, e:
00080 raise roslib.message.DeserializationError(e)
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_location, _x.total_locations))
00094 except struct.error, se: self._check_types(se)
00095 except TypeError, 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_location, _x.total_locations,) = _struct_2i.unpack(str[start:end])
00111 return self
00112 except struct.error, e:
00113 raise roslib.message.DeserializationError(e)
00114
00115 _struct_I = roslib.message.struct_I
00116 _struct_2i = struct.Struct("<2i")