00001 """autogenerated by genmsg_py from ModelObjectInHandGoal.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class ModelObjectInHandGoal(roslib.message.Message):
00007 _md5sum = "9f1692a11210a11c60d117d8a0b58be7"
00008 _type = "pr2_create_object_model/ModelObjectInHandGoal"
00009 _has_header = False
00010 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00011 string arm_name
00012 uint8 move_arm
00013 uint8 keep_level
00014 uint8 add_to_collision_map
00015
00016
00017 """
00018 __slots__ = ['arm_name','move_arm','keep_level','add_to_collision_map']
00019 _slot_types = ['string','uint8','uint8','uint8']
00020
00021 def __init__(self, *args, **kwds):
00022 """
00023 Constructor. Any message fields that are implicitly/explicitly
00024 set to None will be assigned a default value. The recommend
00025 use is keyword arguments as this is more robust to future message
00026 changes. You cannot mix in-order arguments and keyword arguments.
00027
00028 The available fields are:
00029 arm_name,move_arm,keep_level,add_to_collision_map
00030
00031 @param args: complete set of field values, in .msg order
00032 @param kwds: use keyword arguments corresponding to message field names
00033 to set specific fields.
00034 """
00035 if args or kwds:
00036 super(ModelObjectInHandGoal, self).__init__(*args, **kwds)
00037
00038 if self.arm_name is None:
00039 self.arm_name = ''
00040 if self.move_arm is None:
00041 self.move_arm = 0
00042 if self.keep_level is None:
00043 self.keep_level = 0
00044 if self.add_to_collision_map is None:
00045 self.add_to_collision_map = 0
00046 else:
00047 self.arm_name = ''
00048 self.move_arm = 0
00049 self.keep_level = 0
00050 self.add_to_collision_map = 0
00051
00052 def _get_types(self):
00053 """
00054 internal API method
00055 """
00056 return self._slot_types
00057
00058 def serialize(self, buff):
00059 """
00060 serialize message into buffer
00061 @param buff: buffer
00062 @type buff: StringIO
00063 """
00064 try:
00065 _x = self.arm_name
00066 length = len(_x)
00067 buff.write(struct.pack('<I%ss'%length, length, _x))
00068 _x = self
00069 buff.write(_struct_3B.pack(_x.move_arm, _x.keep_level, _x.add_to_collision_map))
00070 except struct.error, se: self._check_types(se)
00071 except TypeError, te: self._check_types(te)
00072
00073 def deserialize(self, str):
00074 """
00075 unpack serialized message in str into this message instance
00076 @param str: byte array of serialized message
00077 @type str: str
00078 """
00079 try:
00080 end = 0
00081 start = end
00082 end += 4
00083 (length,) = _struct_I.unpack(str[start:end])
00084 start = end
00085 end += length
00086 self.arm_name = str[start:end]
00087 _x = self
00088 start = end
00089 end += 3
00090 (_x.move_arm, _x.keep_level, _x.add_to_collision_map,) = _struct_3B.unpack(str[start:end])
00091 return self
00092 except struct.error, e:
00093 raise roslib.message.DeserializationError(e)
00094
00095
00096 def serialize_numpy(self, buff, numpy):
00097 """
00098 serialize message with numpy array types into buffer
00099 @param buff: buffer
00100 @type buff: StringIO
00101 @param numpy: numpy python module
00102 @type numpy module
00103 """
00104 try:
00105 _x = self.arm_name
00106 length = len(_x)
00107 buff.write(struct.pack('<I%ss'%length, length, _x))
00108 _x = self
00109 buff.write(_struct_3B.pack(_x.move_arm, _x.keep_level, _x.add_to_collision_map))
00110 except struct.error, se: self._check_types(se)
00111 except TypeError, te: self._check_types(te)
00112
00113 def deserialize_numpy(self, str, numpy):
00114 """
00115 unpack serialized message in str into this message instance using numpy for array types
00116 @param str: byte array of serialized message
00117 @type str: str
00118 @param numpy: numpy python module
00119 @type numpy: module
00120 """
00121 try:
00122 end = 0
00123 start = end
00124 end += 4
00125 (length,) = _struct_I.unpack(str[start:end])
00126 start = end
00127 end += length
00128 self.arm_name = str[start:end]
00129 _x = self
00130 start = end
00131 end += 3
00132 (_x.move_arm, _x.keep_level, _x.add_to_collision_map,) = _struct_3B.unpack(str[start:end])
00133 return self
00134 except struct.error, e:
00135 raise roslib.message.DeserializationError(e)
00136
00137 _struct_I = roslib.message.struct_I
00138 _struct_3B = struct.Struct("<3B")