$search
00001 """autogenerated by genmsg_py from DetectObjectsGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import std_msgs.msg 00006 00007 class DetectObjectsGoal(roslib.message.Message): 00008 _md5sum = "adb33ef101026c3e15d799e3decf403f" 00009 _type = "cob_object_detection_msgs/DetectObjectsGoal" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00012 # The goal 00013 std_msgs/String object_name 00014 00015 ================================================================================ 00016 MSG: std_msgs/String 00017 string data 00018 00019 """ 00020 __slots__ = ['object_name'] 00021 _slot_types = ['std_msgs/String'] 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 object_name 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(DetectObjectsGoal, self).__init__(*args, **kwds) 00039 #message fields cannot be None, assign default values for those that are 00040 if self.object_name is None: 00041 self.object_name = std_msgs.msg.String() 00042 else: 00043 self.object_name = std_msgs.msg.String() 00044 00045 def _get_types(self): 00046 """ 00047 internal API method 00048 """ 00049 return self._slot_types 00050 00051 def serialize(self, buff): 00052 """ 00053 serialize message into buffer 00054 @param buff: buffer 00055 @type buff: StringIO 00056 """ 00057 try: 00058 _x = self.object_name.data 00059 length = len(_x) 00060 buff.write(struct.pack('<I%ss'%length, length, _x)) 00061 except struct.error as se: self._check_types(se) 00062 except TypeError as te: self._check_types(te) 00063 00064 def deserialize(self, str): 00065 """ 00066 unpack serialized message in str into this message instance 00067 @param str: byte array of serialized message 00068 @type str: str 00069 """ 00070 try: 00071 if self.object_name is None: 00072 self.object_name = std_msgs.msg.String() 00073 end = 0 00074 start = end 00075 end += 4 00076 (length,) = _struct_I.unpack(str[start:end]) 00077 start = end 00078 end += length 00079 self.object_name.data = str[start:end] 00080 return self 00081 except struct.error as e: 00082 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00083 00084 00085 def serialize_numpy(self, buff, numpy): 00086 """ 00087 serialize message with numpy array types into buffer 00088 @param buff: buffer 00089 @type buff: StringIO 00090 @param numpy: numpy python module 00091 @type numpy module 00092 """ 00093 try: 00094 _x = self.object_name.data 00095 length = len(_x) 00096 buff.write(struct.pack('<I%ss'%length, length, _x)) 00097 except struct.error as se: self._check_types(se) 00098 except TypeError as te: self._check_types(te) 00099 00100 def deserialize_numpy(self, str, numpy): 00101 """ 00102 unpack serialized message in str into this message instance using numpy for array types 00103 @param str: byte array of serialized message 00104 @type str: str 00105 @param numpy: numpy python module 00106 @type numpy: module 00107 """ 00108 try: 00109 if self.object_name is None: 00110 self.object_name = std_msgs.msg.String() 00111 end = 0 00112 start = end 00113 end += 4 00114 (length,) = _struct_I.unpack(str[start:end]) 00115 start = end 00116 end += length 00117 self.object_name.data = str[start:end] 00118 return self 00119 except struct.error as e: 00120 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00121 00122 _struct_I = roslib.message.struct_I