Go to the documentation of this file.00001 """autogenerated by genpy from pr2_create_object_model/ModelObjectInHandFeedback.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007
00008 class ModelObjectInHandFeedback(genpy.Message):
00009 _md5sum = "cfc629925fff8facecf764939ad9a751"
00010 _type = "pr2_create_object_model/ModelObjectInHandFeedback"
00011 _has_header = False
00012 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00013
00014 # which phase the process is in
00015 int32 phase
00016 int32 BEFORE_MOVE=0
00017 int32 CLEAR_MOVE=1
00018 int32 MOVE_TO_ROTATE_POSE=2
00019 int32 ROTATING=3
00020 int32 DONE=4
00021
00022 # how many rotate-poses have we gone to/are we in now
00023 int32 rotate_ind
00024
00025
00026 """
00027
00028 BEFORE_MOVE = 0
00029 CLEAR_MOVE = 1
00030 MOVE_TO_ROTATE_POSE = 2
00031 ROTATING = 3
00032 DONE = 4
00033
00034 __slots__ = ['phase','rotate_ind']
00035 _slot_types = ['int32','int32']
00036
00037 def __init__(self, *args, **kwds):
00038 """
00039 Constructor. Any message fields that are implicitly/explicitly
00040 set to None will be assigned a default value. The recommend
00041 use is keyword arguments as this is more robust to future message
00042 changes. You cannot mix in-order arguments and keyword arguments.
00043
00044 The available fields are:
00045 phase,rotate_ind
00046
00047 :param args: complete set of field values, in .msg order
00048 :param kwds: use keyword arguments corresponding to message field names
00049 to set specific fields.
00050 """
00051 if args or kwds:
00052 super(ModelObjectInHandFeedback, self).__init__(*args, **kwds)
00053
00054 if self.phase is None:
00055 self.phase = 0
00056 if self.rotate_ind is None:
00057 self.rotate_ind = 0
00058 else:
00059 self.phase = 0
00060 self.rotate_ind = 0
00061
00062 def _get_types(self):
00063 """
00064 internal API method
00065 """
00066 return self._slot_types
00067
00068 def serialize(self, buff):
00069 """
00070 serialize message into buffer
00071 :param buff: buffer, ``StringIO``
00072 """
00073 try:
00074 _x = self
00075 buff.write(_struct_2i.pack(_x.phase, _x.rotate_ind))
00076 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00077 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00078
00079 def deserialize(self, str):
00080 """
00081 unpack serialized message in str into this message instance
00082 :param str: byte array of serialized message, ``str``
00083 """
00084 try:
00085 end = 0
00086 _x = self
00087 start = end
00088 end += 8
00089 (_x.phase, _x.rotate_ind,) = _struct_2i.unpack(str[start:end])
00090 return self
00091 except struct.error as e:
00092 raise genpy.DeserializationError(e)
00093
00094
00095 def serialize_numpy(self, buff, numpy):
00096 """
00097 serialize message with numpy array types into buffer
00098 :param buff: buffer, ``StringIO``
00099 :param numpy: numpy python module
00100 """
00101 try:
00102 _x = self
00103 buff.write(_struct_2i.pack(_x.phase, _x.rotate_ind))
00104 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00105 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00106
00107 def deserialize_numpy(self, str, numpy):
00108 """
00109 unpack serialized message in str into this message instance using numpy for array types
00110 :param str: byte array of serialized message, ``str``
00111 :param numpy: numpy python module
00112 """
00113 try:
00114 end = 0
00115 _x = self
00116 start = end
00117 end += 8
00118 (_x.phase, _x.rotate_ind,) = _struct_2i.unpack(str[start:end])
00119 return self
00120 except struct.error as e:
00121 raise genpy.DeserializationError(e)
00122
00123 _struct_I = genpy.struct_I
00124 _struct_2i = struct.Struct("<2i")