00001 """autogenerated by genpy from object_manipulation_msgs/ReactiveGraspActionResult.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 object_manipulation_msgs.msg
00008 import genpy
00009 import actionlib_msgs.msg
00010 import std_msgs.msg
00011
00012 class ReactiveGraspActionResult(genpy.Message):
00013 _md5sum = "1d0d051ec44b5b01ea719228a077e443"
00014 _type = "object_manipulation_msgs/ReactiveGraspActionResult"
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 ReactiveGraspResult 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: object_manipulation_msgs/ReactiveGraspResult
00081 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00082
00083 # the result of the reactive grasp attempt
00084
00085 ManipulationResult manipulation_result
00086
00087
00088 ================================================================================
00089 MSG: object_manipulation_msgs/ManipulationResult
00090 # Result codes for manipulation tasks
00091
00092 # task completed as expected
00093 # generally means you can proceed as planned
00094 int32 SUCCESS = 1
00095
00096 # task not possible (e.g. out of reach or obstacles in the way)
00097 # generally means that the world was not disturbed, so you can try another task
00098 int32 UNFEASIBLE = -1
00099
00100 # task was thought possible, but failed due to unexpected events during execution
00101 # it is likely that the world was disturbed, so you are encouraged to refresh
00102 # your sensed world model before proceeding to another task
00103 int32 FAILED = -2
00104
00105 # a lower level error prevented task completion (e.g. joint controller not responding)
00106 # generally requires human attention
00107 int32 ERROR = -3
00108
00109 # means that at some point during execution we ended up in a state that the collision-aware
00110 # arm navigation module will not move out of. The world was likely not disturbed, but you
00111 # probably need a new collision map to move the arm out of the stuck position
00112 int32 ARM_MOVEMENT_PREVENTED = -4
00113
00114 # specific to grasp actions
00115 # the object was grasped successfully, but the lift attempt could not achieve the minimum lift distance requested
00116 # it is likely that the collision environment will see collisions between the hand/object and the support surface
00117 int32 LIFT_FAILED = -5
00118
00119 # specific to place actions
00120 # the object was placed successfully, but the retreat attempt could not achieve the minimum retreat distance requested
00121 # it is likely that the collision environment will see collisions between the hand and the object
00122 int32 RETREAT_FAILED = -6
00123
00124 # indicates that somewhere along the line a human said "wait, stop, this is bad, go back and do something else"
00125 int32 CANCELLED = -7
00126
00127 # the actual value of this error code
00128 int32 value
00129
00130 """
00131 __slots__ = ['header','status','result']
00132 _slot_types = ['std_msgs/Header','actionlib_msgs/GoalStatus','object_manipulation_msgs/ReactiveGraspResult']
00133
00134 def __init__(self, *args, **kwds):
00135 """
00136 Constructor. Any message fields that are implicitly/explicitly
00137 set to None will be assigned a default value. The recommend
00138 use is keyword arguments as this is more robust to future message
00139 changes. You cannot mix in-order arguments and keyword arguments.
00140
00141 The available fields are:
00142 header,status,result
00143
00144 :param args: complete set of field values, in .msg order
00145 :param kwds: use keyword arguments corresponding to message field names
00146 to set specific fields.
00147 """
00148 if args or kwds:
00149 super(ReactiveGraspActionResult, self).__init__(*args, **kwds)
00150
00151 if self.header is None:
00152 self.header = std_msgs.msg.Header()
00153 if self.status is None:
00154 self.status = actionlib_msgs.msg.GoalStatus()
00155 if self.result is None:
00156 self.result = object_manipulation_msgs.msg.ReactiveGraspResult()
00157 else:
00158 self.header = std_msgs.msg.Header()
00159 self.status = actionlib_msgs.msg.GoalStatus()
00160 self.result = object_manipulation_msgs.msg.ReactiveGraspResult()
00161
00162 def _get_types(self):
00163 """
00164 internal API method
00165 """
00166 return self._slot_types
00167
00168 def serialize(self, buff):
00169 """
00170 serialize message into buffer
00171 :param buff: buffer, ``StringIO``
00172 """
00173 try:
00174 _x = self
00175 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00176 _x = self.header.frame_id
00177 length = len(_x)
00178 if python3 or type(_x) == unicode:
00179 _x = _x.encode('utf-8')
00180 length = len(_x)
00181 buff.write(struct.pack('<I%ss'%length, length, _x))
00182 _x = self
00183 buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00184 _x = self.status.goal_id.id
00185 length = len(_x)
00186 if python3 or type(_x) == unicode:
00187 _x = _x.encode('utf-8')
00188 length = len(_x)
00189 buff.write(struct.pack('<I%ss'%length, length, _x))
00190 buff.write(_struct_B.pack(self.status.status))
00191 _x = self.status.text
00192 length = len(_x)
00193 if python3 or type(_x) == unicode:
00194 _x = _x.encode('utf-8')
00195 length = len(_x)
00196 buff.write(struct.pack('<I%ss'%length, length, _x))
00197 buff.write(_struct_i.pack(self.result.manipulation_result.value))
00198 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00199 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00200
00201 def deserialize(self, str):
00202 """
00203 unpack serialized message in str into this message instance
00204 :param str: byte array of serialized message, ``str``
00205 """
00206 try:
00207 if self.header is None:
00208 self.header = std_msgs.msg.Header()
00209 if self.status is None:
00210 self.status = actionlib_msgs.msg.GoalStatus()
00211 if self.result is None:
00212 self.result = object_manipulation_msgs.msg.ReactiveGraspResult()
00213 end = 0
00214 _x = self
00215 start = end
00216 end += 12
00217 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00218 start = end
00219 end += 4
00220 (length,) = _struct_I.unpack(str[start:end])
00221 start = end
00222 end += length
00223 if python3:
00224 self.header.frame_id = str[start:end].decode('utf-8')
00225 else:
00226 self.header.frame_id = str[start:end]
00227 _x = self
00228 start = end
00229 end += 8
00230 (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00231 start = end
00232 end += 4
00233 (length,) = _struct_I.unpack(str[start:end])
00234 start = end
00235 end += length
00236 if python3:
00237 self.status.goal_id.id = str[start:end].decode('utf-8')
00238 else:
00239 self.status.goal_id.id = str[start:end]
00240 start = end
00241 end += 1
00242 (self.status.status,) = _struct_B.unpack(str[start:end])
00243 start = end
00244 end += 4
00245 (length,) = _struct_I.unpack(str[start:end])
00246 start = end
00247 end += length
00248 if python3:
00249 self.status.text = str[start:end].decode('utf-8')
00250 else:
00251 self.status.text = str[start:end]
00252 start = end
00253 end += 4
00254 (self.result.manipulation_result.value,) = _struct_i.unpack(str[start:end])
00255 return self
00256 except struct.error as e:
00257 raise genpy.DeserializationError(e)
00258
00259
00260 def serialize_numpy(self, buff, numpy):
00261 """
00262 serialize message with numpy array types into buffer
00263 :param buff: buffer, ``StringIO``
00264 :param numpy: numpy python module
00265 """
00266 try:
00267 _x = self
00268 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00269 _x = self.header.frame_id
00270 length = len(_x)
00271 if python3 or type(_x) == unicode:
00272 _x = _x.encode('utf-8')
00273 length = len(_x)
00274 buff.write(struct.pack('<I%ss'%length, length, _x))
00275 _x = self
00276 buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00277 _x = self.status.goal_id.id
00278 length = len(_x)
00279 if python3 or type(_x) == unicode:
00280 _x = _x.encode('utf-8')
00281 length = len(_x)
00282 buff.write(struct.pack('<I%ss'%length, length, _x))
00283 buff.write(_struct_B.pack(self.status.status))
00284 _x = self.status.text
00285 length = len(_x)
00286 if python3 or type(_x) == unicode:
00287 _x = _x.encode('utf-8')
00288 length = len(_x)
00289 buff.write(struct.pack('<I%ss'%length, length, _x))
00290 buff.write(_struct_i.pack(self.result.manipulation_result.value))
00291 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00292 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00293
00294 def deserialize_numpy(self, str, numpy):
00295 """
00296 unpack serialized message in str into this message instance using numpy for array types
00297 :param str: byte array of serialized message, ``str``
00298 :param numpy: numpy python module
00299 """
00300 try:
00301 if self.header is None:
00302 self.header = std_msgs.msg.Header()
00303 if self.status is None:
00304 self.status = actionlib_msgs.msg.GoalStatus()
00305 if self.result is None:
00306 self.result = object_manipulation_msgs.msg.ReactiveGraspResult()
00307 end = 0
00308 _x = self
00309 start = end
00310 end += 12
00311 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00312 start = end
00313 end += 4
00314 (length,) = _struct_I.unpack(str[start:end])
00315 start = end
00316 end += length
00317 if python3:
00318 self.header.frame_id = str[start:end].decode('utf-8')
00319 else:
00320 self.header.frame_id = str[start:end]
00321 _x = self
00322 start = end
00323 end += 8
00324 (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00325 start = end
00326 end += 4
00327 (length,) = _struct_I.unpack(str[start:end])
00328 start = end
00329 end += length
00330 if python3:
00331 self.status.goal_id.id = str[start:end].decode('utf-8')
00332 else:
00333 self.status.goal_id.id = str[start:end]
00334 start = end
00335 end += 1
00336 (self.status.status,) = _struct_B.unpack(str[start:end])
00337 start = end
00338 end += 4
00339 (length,) = _struct_I.unpack(str[start:end])
00340 start = end
00341 end += length
00342 if python3:
00343 self.status.text = str[start:end].decode('utf-8')
00344 else:
00345 self.status.text = str[start:end]
00346 start = end
00347 end += 4
00348 (self.result.manipulation_result.value,) = _struct_i.unpack(str[start:end])
00349 return self
00350 except struct.error as e:
00351 raise genpy.DeserializationError(e)
00352
00353 _struct_I = genpy.struct_I
00354 _struct_i = struct.Struct("<i")
00355 _struct_3I = struct.Struct("<3I")
00356 _struct_B = struct.Struct("<B")
00357 _struct_2I = struct.Struct("<2I")