00001 """autogenerated by genmsg_py from PlaceResult.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geometry_msgs.msg
00006 import object_manipulation_msgs.msg
00007 import std_msgs.msg
00008
00009 class PlaceResult(roslib.message.Message):
00010 _md5sum = "531ddb04b8422b6734fb74421d431059"
00011 _type = "object_manipulation_msgs/PlaceResult"
00012 _has_header = False
00013 _full_text = """# The result of the pickup attempt
00014 ManipulationResult manipulation_result
00015
00016 # The successful place location, if any
00017 geometry_msgs/PoseStamped place_location
00018
00019 # the list of attempted locations, in the order in which they were attempted
00020 # the successful one should be the last one in this list
00021 geometry_msgs/PoseStamped[] attempted_locations
00022
00023 # the outcomes of the attempted locations, in the same order as attempted_locations
00024 PlaceLocationResult[] attempted_location_results
00025 ================================================================================
00026 MSG: object_manipulation_msgs/ManipulationResult
00027 # Result codes for manipulation tasks
00028
00029 # task completed as expected
00030 # generally means you can proceed as planned
00031 int32 SUCCESS = 1
00032
00033 # task not possible (e.g. out of reach or obstacles in the way)
00034 # generally means that the world was not disturbed, so you can try another task
00035 int32 UNFEASIBLE = -1
00036
00037 # task was thought possible, but failed due to unexpected events during execution
00038 # it is likely that the world was disturbed, so you are encouraged to refresh
00039 # your sensed world model before proceeding to another task
00040 int32 FAILED = -2
00041
00042 # a lower level error prevented task completion (e.g. joint controller not responding)
00043 # generally requires human attention
00044 int32 ERROR = -3
00045
00046 # means that at some point during execution we ended up in a state that the collision-aware
00047 # arm navigation module will not move out of. The world was likely not disturbed, but you
00048 # probably need a new collision map to move the arm out of the stuck position
00049 int32 ARM_MOVEMENT_PREVENTED = -4
00050
00051 # specific to grasp actions
00052 # the object was grasped successfully, but the lift attempt could not achieve the minimum lift distance requested
00053 # it is likely that the collision environment will see collisions between the hand/object and the support surface
00054 int32 LIFT_FAILED = -5
00055
00056 # specific to place actions
00057 # the object was placed successfully, but the retreat attempt could not achieve the minimum retreat distance requested
00058 # it is likely that the collision environment will see collisions between the hand and the object
00059 int32 RETREAT_FAILED = -6
00060
00061 # indicates that somewhere along the line a human said "wait, stop, this is bad, go back and do something else"
00062 int32 CANCELLED = -7
00063
00064 # the actual value of this error code
00065 int32 value
00066
00067 ================================================================================
00068 MSG: geometry_msgs/PoseStamped
00069 # A Pose with reference coordinate frame and timestamp
00070 Header header
00071 Pose pose
00072
00073 ================================================================================
00074 MSG: std_msgs/Header
00075 # Standard metadata for higher-level stamped data types.
00076 # This is generally used to communicate timestamped data
00077 # in a particular coordinate frame.
00078 #
00079 # sequence ID: consecutively increasing ID
00080 uint32 seq
00081 #Two-integer timestamp that is expressed as:
00082 # * stamp.secs: seconds (stamp_secs) since epoch
00083 # * stamp.nsecs: nanoseconds since stamp_secs
00084 # time-handling sugar is provided by the client library
00085 time stamp
00086 #Frame this data is associated with
00087 # 0: no frame
00088 # 1: global frame
00089 string frame_id
00090
00091 ================================================================================
00092 MSG: geometry_msgs/Pose
00093 # A representation of pose in free space, composed of postion and orientation.
00094 Point position
00095 Quaternion orientation
00096
00097 ================================================================================
00098 MSG: geometry_msgs/Point
00099 # This contains the position of a point in free space
00100 float64 x
00101 float64 y
00102 float64 z
00103
00104 ================================================================================
00105 MSG: geometry_msgs/Quaternion
00106 # This represents an orientation in free space in quaternion form.
00107
00108 float64 x
00109 float64 y
00110 float64 z
00111 float64 w
00112
00113 ================================================================================
00114 MSG: object_manipulation_msgs/PlaceLocationResult
00115 int32 SUCCESS = 1
00116 int32 PLACE_OUT_OF_REACH = 2
00117 int32 PLACE_IN_COLLISION = 3
00118 int32 PLACE_UNFEASIBLE = 4
00119 int32 PREPLACE_OUT_OF_REACH = 5
00120 int32 PREPLACE_IN_COLLISION = 6
00121 int32 PREPLACE_UNFEASIBLE = 7
00122 int32 RETREAT_OUT_OF_REACH = 8
00123 int32 RETREAT_IN_COLLISION = 9
00124 int32 RETREAT_UNFEASIBLE = 10
00125 int32 MOVE_ARM_FAILED = 11
00126 int32 PLACE_FAILED = 12
00127 int32 RETREAT_FAILED = 13
00128 int32 result_code
00129
00130 # whether the state of the world was disturbed by this attempt. generally, this flag
00131 # shows if another task can be attempted, or a new sensed world model is recommeded
00132 # before proceeding
00133 bool continuation_possible
00134
00135 """
00136 __slots__ = ['manipulation_result','place_location','attempted_locations','attempted_location_results']
00137 _slot_types = ['object_manipulation_msgs/ManipulationResult','geometry_msgs/PoseStamped','geometry_msgs/PoseStamped[]','object_manipulation_msgs/PlaceLocationResult[]']
00138
00139 def __init__(self, *args, **kwds):
00140 """
00141 Constructor. Any message fields that are implicitly/explicitly
00142 set to None will be assigned a default value. The recommend
00143 use is keyword arguments as this is more robust to future message
00144 changes. You cannot mix in-order arguments and keyword arguments.
00145
00146 The available fields are:
00147 manipulation_result,place_location,attempted_locations,attempted_location_results
00148
00149 @param args: complete set of field values, in .msg order
00150 @param kwds: use keyword arguments corresponding to message field names
00151 to set specific fields.
00152 """
00153 if args or kwds:
00154 super(PlaceResult, self).__init__(*args, **kwds)
00155
00156 if self.manipulation_result is None:
00157 self.manipulation_result = object_manipulation_msgs.msg.ManipulationResult()
00158 if self.place_location is None:
00159 self.place_location = geometry_msgs.msg.PoseStamped()
00160 if self.attempted_locations is None:
00161 self.attempted_locations = []
00162 if self.attempted_location_results is None:
00163 self.attempted_location_results = []
00164 else:
00165 self.manipulation_result = object_manipulation_msgs.msg.ManipulationResult()
00166 self.place_location = geometry_msgs.msg.PoseStamped()
00167 self.attempted_locations = []
00168 self.attempted_location_results = []
00169
00170 def _get_types(self):
00171 """
00172 internal API method
00173 """
00174 return self._slot_types
00175
00176 def serialize(self, buff):
00177 """
00178 serialize message into buffer
00179 @param buff: buffer
00180 @type buff: StringIO
00181 """
00182 try:
00183 _x = self
00184 buff.write(_struct_i3I.pack(_x.manipulation_result.value, _x.place_location.header.seq, _x.place_location.header.stamp.secs, _x.place_location.header.stamp.nsecs))
00185 _x = self.place_location.header.frame_id
00186 length = len(_x)
00187 buff.write(struct.pack('<I%ss'%length, length, _x))
00188 _x = self
00189 buff.write(_struct_7d.pack(_x.place_location.pose.position.x, _x.place_location.pose.position.y, _x.place_location.pose.position.z, _x.place_location.pose.orientation.x, _x.place_location.pose.orientation.y, _x.place_location.pose.orientation.z, _x.place_location.pose.orientation.w))
00190 length = len(self.attempted_locations)
00191 buff.write(_struct_I.pack(length))
00192 for val1 in self.attempted_locations:
00193 _v1 = val1.header
00194 buff.write(_struct_I.pack(_v1.seq))
00195 _v2 = _v1.stamp
00196 _x = _v2
00197 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00198 _x = _v1.frame_id
00199 length = len(_x)
00200 buff.write(struct.pack('<I%ss'%length, length, _x))
00201 _v3 = val1.pose
00202 _v4 = _v3.position
00203 _x = _v4
00204 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00205 _v5 = _v3.orientation
00206 _x = _v5
00207 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00208 length = len(self.attempted_location_results)
00209 buff.write(_struct_I.pack(length))
00210 for val1 in self.attempted_location_results:
00211 _x = val1
00212 buff.write(_struct_iB.pack(_x.result_code, _x.continuation_possible))
00213 except struct.error, se: self._check_types(se)
00214 except TypeError, te: self._check_types(te)
00215
00216 def deserialize(self, str):
00217 """
00218 unpack serialized message in str into this message instance
00219 @param str: byte array of serialized message
00220 @type str: str
00221 """
00222 try:
00223 if self.manipulation_result is None:
00224 self.manipulation_result = object_manipulation_msgs.msg.ManipulationResult()
00225 if self.place_location is None:
00226 self.place_location = geometry_msgs.msg.PoseStamped()
00227 end = 0
00228 _x = self
00229 start = end
00230 end += 16
00231 (_x.manipulation_result.value, _x.place_location.header.seq, _x.place_location.header.stamp.secs, _x.place_location.header.stamp.nsecs,) = _struct_i3I.unpack(str[start:end])
00232 start = end
00233 end += 4
00234 (length,) = _struct_I.unpack(str[start:end])
00235 start = end
00236 end += length
00237 self.place_location.header.frame_id = str[start:end]
00238 _x = self
00239 start = end
00240 end += 56
00241 (_x.place_location.pose.position.x, _x.place_location.pose.position.y, _x.place_location.pose.position.z, _x.place_location.pose.orientation.x, _x.place_location.pose.orientation.y, _x.place_location.pose.orientation.z, _x.place_location.pose.orientation.w,) = _struct_7d.unpack(str[start:end])
00242 start = end
00243 end += 4
00244 (length,) = _struct_I.unpack(str[start:end])
00245 self.attempted_locations = []
00246 for i in xrange(0, length):
00247 val1 = geometry_msgs.msg.PoseStamped()
00248 _v6 = val1.header
00249 start = end
00250 end += 4
00251 (_v6.seq,) = _struct_I.unpack(str[start:end])
00252 _v7 = _v6.stamp
00253 _x = _v7
00254 start = end
00255 end += 8
00256 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00257 start = end
00258 end += 4
00259 (length,) = _struct_I.unpack(str[start:end])
00260 start = end
00261 end += length
00262 _v6.frame_id = str[start:end]
00263 _v8 = val1.pose
00264 _v9 = _v8.position
00265 _x = _v9
00266 start = end
00267 end += 24
00268 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00269 _v10 = _v8.orientation
00270 _x = _v10
00271 start = end
00272 end += 32
00273 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00274 self.attempted_locations.append(val1)
00275 start = end
00276 end += 4
00277 (length,) = _struct_I.unpack(str[start:end])
00278 self.attempted_location_results = []
00279 for i in xrange(0, length):
00280 val1 = object_manipulation_msgs.msg.PlaceLocationResult()
00281 _x = val1
00282 start = end
00283 end += 5
00284 (_x.result_code, _x.continuation_possible,) = _struct_iB.unpack(str[start:end])
00285 val1.continuation_possible = bool(val1.continuation_possible)
00286 self.attempted_location_results.append(val1)
00287 return self
00288 except struct.error, e:
00289 raise roslib.message.DeserializationError(e)
00290
00291
00292 def serialize_numpy(self, buff, numpy):
00293 """
00294 serialize message with numpy array types into buffer
00295 @param buff: buffer
00296 @type buff: StringIO
00297 @param numpy: numpy python module
00298 @type numpy module
00299 """
00300 try:
00301 _x = self
00302 buff.write(_struct_i3I.pack(_x.manipulation_result.value, _x.place_location.header.seq, _x.place_location.header.stamp.secs, _x.place_location.header.stamp.nsecs))
00303 _x = self.place_location.header.frame_id
00304 length = len(_x)
00305 buff.write(struct.pack('<I%ss'%length, length, _x))
00306 _x = self
00307 buff.write(_struct_7d.pack(_x.place_location.pose.position.x, _x.place_location.pose.position.y, _x.place_location.pose.position.z, _x.place_location.pose.orientation.x, _x.place_location.pose.orientation.y, _x.place_location.pose.orientation.z, _x.place_location.pose.orientation.w))
00308 length = len(self.attempted_locations)
00309 buff.write(_struct_I.pack(length))
00310 for val1 in self.attempted_locations:
00311 _v11 = val1.header
00312 buff.write(_struct_I.pack(_v11.seq))
00313 _v12 = _v11.stamp
00314 _x = _v12
00315 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00316 _x = _v11.frame_id
00317 length = len(_x)
00318 buff.write(struct.pack('<I%ss'%length, length, _x))
00319 _v13 = val1.pose
00320 _v14 = _v13.position
00321 _x = _v14
00322 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00323 _v15 = _v13.orientation
00324 _x = _v15
00325 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00326 length = len(self.attempted_location_results)
00327 buff.write(_struct_I.pack(length))
00328 for val1 in self.attempted_location_results:
00329 _x = val1
00330 buff.write(_struct_iB.pack(_x.result_code, _x.continuation_possible))
00331 except struct.error, se: self._check_types(se)
00332 except TypeError, te: self._check_types(te)
00333
00334 def deserialize_numpy(self, str, numpy):
00335 """
00336 unpack serialized message in str into this message instance using numpy for array types
00337 @param str: byte array of serialized message
00338 @type str: str
00339 @param numpy: numpy python module
00340 @type numpy: module
00341 """
00342 try:
00343 if self.manipulation_result is None:
00344 self.manipulation_result = object_manipulation_msgs.msg.ManipulationResult()
00345 if self.place_location is None:
00346 self.place_location = geometry_msgs.msg.PoseStamped()
00347 end = 0
00348 _x = self
00349 start = end
00350 end += 16
00351 (_x.manipulation_result.value, _x.place_location.header.seq, _x.place_location.header.stamp.secs, _x.place_location.header.stamp.nsecs,) = _struct_i3I.unpack(str[start:end])
00352 start = end
00353 end += 4
00354 (length,) = _struct_I.unpack(str[start:end])
00355 start = end
00356 end += length
00357 self.place_location.header.frame_id = str[start:end]
00358 _x = self
00359 start = end
00360 end += 56
00361 (_x.place_location.pose.position.x, _x.place_location.pose.position.y, _x.place_location.pose.position.z, _x.place_location.pose.orientation.x, _x.place_location.pose.orientation.y, _x.place_location.pose.orientation.z, _x.place_location.pose.orientation.w,) = _struct_7d.unpack(str[start:end])
00362 start = end
00363 end += 4
00364 (length,) = _struct_I.unpack(str[start:end])
00365 self.attempted_locations = []
00366 for i in xrange(0, length):
00367 val1 = geometry_msgs.msg.PoseStamped()
00368 _v16 = val1.header
00369 start = end
00370 end += 4
00371 (_v16.seq,) = _struct_I.unpack(str[start:end])
00372 _v17 = _v16.stamp
00373 _x = _v17
00374 start = end
00375 end += 8
00376 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00377 start = end
00378 end += 4
00379 (length,) = _struct_I.unpack(str[start:end])
00380 start = end
00381 end += length
00382 _v16.frame_id = str[start:end]
00383 _v18 = val1.pose
00384 _v19 = _v18.position
00385 _x = _v19
00386 start = end
00387 end += 24
00388 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00389 _v20 = _v18.orientation
00390 _x = _v20
00391 start = end
00392 end += 32
00393 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00394 self.attempted_locations.append(val1)
00395 start = end
00396 end += 4
00397 (length,) = _struct_I.unpack(str[start:end])
00398 self.attempted_location_results = []
00399 for i in xrange(0, length):
00400 val1 = object_manipulation_msgs.msg.PlaceLocationResult()
00401 _x = val1
00402 start = end
00403 end += 5
00404 (_x.result_code, _x.continuation_possible,) = _struct_iB.unpack(str[start:end])
00405 val1.continuation_possible = bool(val1.continuation_possible)
00406 self.attempted_location_results.append(val1)
00407 return self
00408 except struct.error, e:
00409 raise roslib.message.DeserializationError(e)
00410
00411 _struct_I = roslib.message.struct_I
00412 _struct_7d = struct.Struct("<7d")
00413 _struct_i3I = struct.Struct("<i3I")
00414 _struct_4d = struct.Struct("<4d")
00415 _struct_iB = struct.Struct("<iB")
00416 _struct_2I = struct.Struct("<2I")
00417 _struct_3d = struct.Struct("<3d")