00001 """autogenerated by genpy from interactive_perception_msgs/ObjectRecognitionGuiActionResult.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import interactive_perception_msgs.msg
00008 import genpy
00009 import actionlib_msgs.msg
00010 import std_msgs.msg
00011
00012 class ObjectRecognitionGuiActionResult(genpy.Message):
00013 _md5sum = "5a5f7e7e9976cabab28a6f9f96bf45ec"
00014 _type = "interactive_perception_msgs/ObjectRecognitionGuiActionResult"
00015 _has_header = True
00016 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00017
00018 Header header
00019 actionlib_msgs/GoalStatus status
00020 ObjectRecognitionGuiResult result
00021
00022 ================================================================================
00023 MSG: std_msgs/Header
00024 # Standard metadata for higher-level stamped data types.
00025 # This is generally used to communicate timestamped data
00026 # in a particular coordinate frame.
00027 #
00028 # sequence ID: consecutively increasing ID
00029 uint32 seq
00030 #Two-integer timestamp that is expressed as:
00031 # * stamp.secs: seconds (stamp_secs) since epoch
00032 # * stamp.nsecs: nanoseconds since stamp_secs
00033 # time-handling sugar is provided by the client library
00034 time stamp
00035 #Frame this data is associated with
00036 # 0: no frame
00037 # 1: global frame
00038 string frame_id
00039
00040 ================================================================================
00041 MSG: actionlib_msgs/GoalStatus
00042 GoalID goal_id
00043 uint8 status
00044 uint8 PENDING = 0 # The goal has yet to be processed by the action server
00045 uint8 ACTIVE = 1 # The goal is currently being processed by the action server
00046 uint8 PREEMPTED = 2 # The goal received a cancel request after it started executing
00047 # and has since completed its execution (Terminal State)
00048 uint8 SUCCEEDED = 3 # The goal was achieved successfully by the action server (Terminal State)
00049 uint8 ABORTED = 4 # The goal was aborted during execution by the action server due
00050 # to some failure (Terminal State)
00051 uint8 REJECTED = 5 # The goal was rejected by the action server without being processed,
00052 # because the goal was unattainable or invalid (Terminal State)
00053 uint8 PREEMPTING = 6 # The goal received a cancel request after it started executing
00054 # and has not yet completed execution
00055 uint8 RECALLING = 7 # The goal received a cancel request before it started executing,
00056 # but the action server has not yet confirmed that the goal is canceled
00057 uint8 RECALLED = 8 # The goal received a cancel request before it started executing
00058 # and was successfully cancelled (Terminal State)
00059 uint8 LOST = 9 # An action client can determine that a goal is LOST. This should not be
00060 # sent over the wire by an action server
00061
00062 #Allow for the user to associate a string with GoalStatus for debugging
00063 string text
00064
00065
00066 ================================================================================
00067 MSG: actionlib_msgs/GoalID
00068 # The stamp should store the time at which this goal was requested.
00069 # It is used by an action server when it tries to preempt all
00070 # goals that were requested before a certain time
00071 time stamp
00072
00073 # The id provides a way to associate feedback and
00074 # result message with specific goal requests. The id
00075 # specified must be unique.
00076 string id
00077
00078
00079 ================================================================================
00080 MSG: interactive_perception_msgs/ObjectRecognitionGuiResult
00081 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00082
00083 #the index of the model hypothesis that the user has selected for each cluster
00084 #values below 0 mean 'reject all hypotheses'
00085 int32[] selected_hypothesis_indices
00086
00087 """
00088 __slots__ = ['header','status','result']
00089 _slot_types = ['std_msgs/Header','actionlib_msgs/GoalStatus','interactive_perception_msgs/ObjectRecognitionGuiResult']
00090
00091 def __init__(self, *args, **kwds):
00092 """
00093 Constructor. Any message fields that are implicitly/explicitly
00094 set to None will be assigned a default value. The recommend
00095 use is keyword arguments as this is more robust to future message
00096 changes. You cannot mix in-order arguments and keyword arguments.
00097
00098 The available fields are:
00099 header,status,result
00100
00101 :param args: complete set of field values, in .msg order
00102 :param kwds: use keyword arguments corresponding to message field names
00103 to set specific fields.
00104 """
00105 if args or kwds:
00106 super(ObjectRecognitionGuiActionResult, self).__init__(*args, **kwds)
00107
00108 if self.header is None:
00109 self.header = std_msgs.msg.Header()
00110 if self.status is None:
00111 self.status = actionlib_msgs.msg.GoalStatus()
00112 if self.result is None:
00113 self.result = interactive_perception_msgs.msg.ObjectRecognitionGuiResult()
00114 else:
00115 self.header = std_msgs.msg.Header()
00116 self.status = actionlib_msgs.msg.GoalStatus()
00117 self.result = interactive_perception_msgs.msg.ObjectRecognitionGuiResult()
00118
00119 def _get_types(self):
00120 """
00121 internal API method
00122 """
00123 return self._slot_types
00124
00125 def serialize(self, buff):
00126 """
00127 serialize message into buffer
00128 :param buff: buffer, ``StringIO``
00129 """
00130 try:
00131 _x = self
00132 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00133 _x = self.header.frame_id
00134 length = len(_x)
00135 if python3 or type(_x) == unicode:
00136 _x = _x.encode('utf-8')
00137 length = len(_x)
00138 buff.write(struct.pack('<I%ss'%length, length, _x))
00139 _x = self
00140 buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00141 _x = self.status.goal_id.id
00142 length = len(_x)
00143 if python3 or type(_x) == unicode:
00144 _x = _x.encode('utf-8')
00145 length = len(_x)
00146 buff.write(struct.pack('<I%ss'%length, length, _x))
00147 buff.write(_struct_B.pack(self.status.status))
00148 _x = self.status.text
00149 length = len(_x)
00150 if python3 or type(_x) == unicode:
00151 _x = _x.encode('utf-8')
00152 length = len(_x)
00153 buff.write(struct.pack('<I%ss'%length, length, _x))
00154 length = len(self.result.selected_hypothesis_indices)
00155 buff.write(_struct_I.pack(length))
00156 pattern = '<%si'%length
00157 buff.write(struct.pack(pattern, *self.result.selected_hypothesis_indices))
00158 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00159 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00160
00161 def deserialize(self, str):
00162 """
00163 unpack serialized message in str into this message instance
00164 :param str: byte array of serialized message, ``str``
00165 """
00166 try:
00167 if self.header is None:
00168 self.header = std_msgs.msg.Header()
00169 if self.status is None:
00170 self.status = actionlib_msgs.msg.GoalStatus()
00171 if self.result is None:
00172 self.result = interactive_perception_msgs.msg.ObjectRecognitionGuiResult()
00173 end = 0
00174 _x = self
00175 start = end
00176 end += 12
00177 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00178 start = end
00179 end += 4
00180 (length,) = _struct_I.unpack(str[start:end])
00181 start = end
00182 end += length
00183 if python3:
00184 self.header.frame_id = str[start:end].decode('utf-8')
00185 else:
00186 self.header.frame_id = str[start:end]
00187 _x = self
00188 start = end
00189 end += 8
00190 (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00191 start = end
00192 end += 4
00193 (length,) = _struct_I.unpack(str[start:end])
00194 start = end
00195 end += length
00196 if python3:
00197 self.status.goal_id.id = str[start:end].decode('utf-8')
00198 else:
00199 self.status.goal_id.id = str[start:end]
00200 start = end
00201 end += 1
00202 (self.status.status,) = _struct_B.unpack(str[start:end])
00203 start = end
00204 end += 4
00205 (length,) = _struct_I.unpack(str[start:end])
00206 start = end
00207 end += length
00208 if python3:
00209 self.status.text = str[start:end].decode('utf-8')
00210 else:
00211 self.status.text = str[start:end]
00212 start = end
00213 end += 4
00214 (length,) = _struct_I.unpack(str[start:end])
00215 pattern = '<%si'%length
00216 start = end
00217 end += struct.calcsize(pattern)
00218 self.result.selected_hypothesis_indices = struct.unpack(pattern, str[start:end])
00219 return self
00220 except struct.error as e:
00221 raise genpy.DeserializationError(e)
00222
00223
00224 def serialize_numpy(self, buff, numpy):
00225 """
00226 serialize message with numpy array types into buffer
00227 :param buff: buffer, ``StringIO``
00228 :param numpy: numpy python module
00229 """
00230 try:
00231 _x = self
00232 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00233 _x = self.header.frame_id
00234 length = len(_x)
00235 if python3 or type(_x) == unicode:
00236 _x = _x.encode('utf-8')
00237 length = len(_x)
00238 buff.write(struct.pack('<I%ss'%length, length, _x))
00239 _x = self
00240 buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00241 _x = self.status.goal_id.id
00242 length = len(_x)
00243 if python3 or type(_x) == unicode:
00244 _x = _x.encode('utf-8')
00245 length = len(_x)
00246 buff.write(struct.pack('<I%ss'%length, length, _x))
00247 buff.write(_struct_B.pack(self.status.status))
00248 _x = self.status.text
00249 length = len(_x)
00250 if python3 or type(_x) == unicode:
00251 _x = _x.encode('utf-8')
00252 length = len(_x)
00253 buff.write(struct.pack('<I%ss'%length, length, _x))
00254 length = len(self.result.selected_hypothesis_indices)
00255 buff.write(_struct_I.pack(length))
00256 pattern = '<%si'%length
00257 buff.write(self.result.selected_hypothesis_indices.tostring())
00258 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00259 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00260
00261 def deserialize_numpy(self, str, numpy):
00262 """
00263 unpack serialized message in str into this message instance using numpy for array types
00264 :param str: byte array of serialized message, ``str``
00265 :param numpy: numpy python module
00266 """
00267 try:
00268 if self.header is None:
00269 self.header = std_msgs.msg.Header()
00270 if self.status is None:
00271 self.status = actionlib_msgs.msg.GoalStatus()
00272 if self.result is None:
00273 self.result = interactive_perception_msgs.msg.ObjectRecognitionGuiResult()
00274 end = 0
00275 _x = self
00276 start = end
00277 end += 12
00278 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00279 start = end
00280 end += 4
00281 (length,) = _struct_I.unpack(str[start:end])
00282 start = end
00283 end += length
00284 if python3:
00285 self.header.frame_id = str[start:end].decode('utf-8')
00286 else:
00287 self.header.frame_id = str[start:end]
00288 _x = self
00289 start = end
00290 end += 8
00291 (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00292 start = end
00293 end += 4
00294 (length,) = _struct_I.unpack(str[start:end])
00295 start = end
00296 end += length
00297 if python3:
00298 self.status.goal_id.id = str[start:end].decode('utf-8')
00299 else:
00300 self.status.goal_id.id = str[start:end]
00301 start = end
00302 end += 1
00303 (self.status.status,) = _struct_B.unpack(str[start:end])
00304 start = end
00305 end += 4
00306 (length,) = _struct_I.unpack(str[start:end])
00307 start = end
00308 end += length
00309 if python3:
00310 self.status.text = str[start:end].decode('utf-8')
00311 else:
00312 self.status.text = str[start:end]
00313 start = end
00314 end += 4
00315 (length,) = _struct_I.unpack(str[start:end])
00316 pattern = '<%si'%length
00317 start = end
00318 end += struct.calcsize(pattern)
00319 self.result.selected_hypothesis_indices = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00320 return self
00321 except struct.error as e:
00322 raise genpy.DeserializationError(e)
00323
00324 _struct_I = genpy.struct_I
00325 _struct_3I = struct.Struct("<3I")
00326 _struct_B = struct.Struct("<B")
00327 _struct_2I = struct.Struct("<2I")