$search
00001 """autogenerated by genmsg_py from FindContainerActionResult.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import object_manipulation_msgs.msg 00006 import roslib.rostime 00007 import actionlib_msgs.msg 00008 import geometry_msgs.msg 00009 import sensor_msgs.msg 00010 import std_msgs.msg 00011 00012 class FindContainerActionResult(roslib.message.Message): 00013 _md5sum = "1c4fd4050a411725f1d3674520757b5d" 00014 _type = "object_manipulation_msgs/FindContainerActionResult" 00015 _has_header = True #flag to mark the presence of a Header object 00016 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00017 00018 Header header 00019 actionlib_msgs/GoalStatus status 00020 FindContainerResult 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/FindContainerResult 00081 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00082 # refined pose and dimensions of bounding box for container 00083 geometry_msgs/PoseStamped box_pose 00084 geometry_msgs/Vector3 box_dims 00085 00086 # cloud chunks of stuff in container, and container 00087 sensor_msgs/PointCloud2 contents 00088 sensor_msgs/PointCloud2 container 00089 sensor_msgs/PointCloud2[] clusters 00090 00091 00092 ================================================================================ 00093 MSG: geometry_msgs/PoseStamped 00094 # A Pose with reference coordinate frame and timestamp 00095 Header header 00096 Pose pose 00097 00098 ================================================================================ 00099 MSG: geometry_msgs/Pose 00100 # A representation of pose in free space, composed of postion and orientation. 00101 Point position 00102 Quaternion orientation 00103 00104 ================================================================================ 00105 MSG: geometry_msgs/Point 00106 # This contains the position of a point in free space 00107 float64 x 00108 float64 y 00109 float64 z 00110 00111 ================================================================================ 00112 MSG: geometry_msgs/Quaternion 00113 # This represents an orientation in free space in quaternion form. 00114 00115 float64 x 00116 float64 y 00117 float64 z 00118 float64 w 00119 00120 ================================================================================ 00121 MSG: geometry_msgs/Vector3 00122 # This represents a vector in free space. 00123 00124 float64 x 00125 float64 y 00126 float64 z 00127 ================================================================================ 00128 MSG: sensor_msgs/PointCloud2 00129 # This message holds a collection of N-dimensional points, which may 00130 # contain additional information such as normals, intensity, etc. The 00131 # point data is stored as a binary blob, its layout described by the 00132 # contents of the "fields" array. 00133 00134 # The point cloud data may be organized 2d (image-like) or 1d 00135 # (unordered). Point clouds organized as 2d images may be produced by 00136 # camera depth sensors such as stereo or time-of-flight. 00137 00138 # Time of sensor data acquisition, and the coordinate frame ID (for 3d 00139 # points). 00140 Header header 00141 00142 # 2D structure of the point cloud. If the cloud is unordered, height is 00143 # 1 and width is the length of the point cloud. 00144 uint32 height 00145 uint32 width 00146 00147 # Describes the channels and their layout in the binary data blob. 00148 PointField[] fields 00149 00150 bool is_bigendian # Is this data bigendian? 00151 uint32 point_step # Length of a point in bytes 00152 uint32 row_step # Length of a row in bytes 00153 uint8[] data # Actual point data, size is (row_step*height) 00154 00155 bool is_dense # True if there are no invalid points 00156 00157 ================================================================================ 00158 MSG: sensor_msgs/PointField 00159 # This message holds the description of one point entry in the 00160 # PointCloud2 message format. 00161 uint8 INT8 = 1 00162 uint8 UINT8 = 2 00163 uint8 INT16 = 3 00164 uint8 UINT16 = 4 00165 uint8 INT32 = 5 00166 uint8 UINT32 = 6 00167 uint8 FLOAT32 = 7 00168 uint8 FLOAT64 = 8 00169 00170 string name # Name of field 00171 uint32 offset # Offset from start of point struct 00172 uint8 datatype # Datatype enumeration, see above 00173 uint32 count # How many elements in the field 00174 00175 """ 00176 __slots__ = ['header','status','result'] 00177 _slot_types = ['Header','actionlib_msgs/GoalStatus','object_manipulation_msgs/FindContainerResult'] 00178 00179 def __init__(self, *args, **kwds): 00180 """ 00181 Constructor. Any message fields that are implicitly/explicitly 00182 set to None will be assigned a default value. The recommend 00183 use is keyword arguments as this is more robust to future message 00184 changes. You cannot mix in-order arguments and keyword arguments. 00185 00186 The available fields are: 00187 header,status,result 00188 00189 @param args: complete set of field values, in .msg order 00190 @param kwds: use keyword arguments corresponding to message field names 00191 to set specific fields. 00192 """ 00193 if args or kwds: 00194 super(FindContainerActionResult, self).__init__(*args, **kwds) 00195 #message fields cannot be None, assign default values for those that are 00196 if self.header is None: 00197 self.header = std_msgs.msg._Header.Header() 00198 if self.status is None: 00199 self.status = actionlib_msgs.msg.GoalStatus() 00200 if self.result is None: 00201 self.result = object_manipulation_msgs.msg.FindContainerResult() 00202 else: 00203 self.header = std_msgs.msg._Header.Header() 00204 self.status = actionlib_msgs.msg.GoalStatus() 00205 self.result = object_manipulation_msgs.msg.FindContainerResult() 00206 00207 def _get_types(self): 00208 """ 00209 internal API method 00210 """ 00211 return self._slot_types 00212 00213 def serialize(self, buff): 00214 """ 00215 serialize message into buffer 00216 @param buff: buffer 00217 @type buff: StringIO 00218 """ 00219 try: 00220 _x = self 00221 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00222 _x = self.header.frame_id 00223 length = len(_x) 00224 buff.write(struct.pack('<I%ss'%length, length, _x)) 00225 _x = self 00226 buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs)) 00227 _x = self.status.goal_id.id 00228 length = len(_x) 00229 buff.write(struct.pack('<I%ss'%length, length, _x)) 00230 buff.write(_struct_B.pack(self.status.status)) 00231 _x = self.status.text 00232 length = len(_x) 00233 buff.write(struct.pack('<I%ss'%length, length, _x)) 00234 _x = self 00235 buff.write(_struct_3I.pack(_x.result.box_pose.header.seq, _x.result.box_pose.header.stamp.secs, _x.result.box_pose.header.stamp.nsecs)) 00236 _x = self.result.box_pose.header.frame_id 00237 length = len(_x) 00238 buff.write(struct.pack('<I%ss'%length, length, _x)) 00239 _x = self 00240 buff.write(_struct_10d3I.pack(_x.result.box_pose.pose.position.x, _x.result.box_pose.pose.position.y, _x.result.box_pose.pose.position.z, _x.result.box_pose.pose.orientation.x, _x.result.box_pose.pose.orientation.y, _x.result.box_pose.pose.orientation.z, _x.result.box_pose.pose.orientation.w, _x.result.box_dims.x, _x.result.box_dims.y, _x.result.box_dims.z, _x.result.contents.header.seq, _x.result.contents.header.stamp.secs, _x.result.contents.header.stamp.nsecs)) 00241 _x = self.result.contents.header.frame_id 00242 length = len(_x) 00243 buff.write(struct.pack('<I%ss'%length, length, _x)) 00244 _x = self 00245 buff.write(_struct_2I.pack(_x.result.contents.height, _x.result.contents.width)) 00246 length = len(self.result.contents.fields) 00247 buff.write(_struct_I.pack(length)) 00248 for val1 in self.result.contents.fields: 00249 _x = val1.name 00250 length = len(_x) 00251 buff.write(struct.pack('<I%ss'%length, length, _x)) 00252 _x = val1 00253 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00254 _x = self 00255 buff.write(_struct_B2I.pack(_x.result.contents.is_bigendian, _x.result.contents.point_step, _x.result.contents.row_step)) 00256 _x = self.result.contents.data 00257 length = len(_x) 00258 # - if encoded as a list instead, serialize as bytes instead of string 00259 if type(_x) in [list, tuple]: 00260 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00261 else: 00262 buff.write(struct.pack('<I%ss'%length, length, _x)) 00263 _x = self 00264 buff.write(_struct_B3I.pack(_x.result.contents.is_dense, _x.result.container.header.seq, _x.result.container.header.stamp.secs, _x.result.container.header.stamp.nsecs)) 00265 _x = self.result.container.header.frame_id 00266 length = len(_x) 00267 buff.write(struct.pack('<I%ss'%length, length, _x)) 00268 _x = self 00269 buff.write(_struct_2I.pack(_x.result.container.height, _x.result.container.width)) 00270 length = len(self.result.container.fields) 00271 buff.write(_struct_I.pack(length)) 00272 for val1 in self.result.container.fields: 00273 _x = val1.name 00274 length = len(_x) 00275 buff.write(struct.pack('<I%ss'%length, length, _x)) 00276 _x = val1 00277 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00278 _x = self 00279 buff.write(_struct_B2I.pack(_x.result.container.is_bigendian, _x.result.container.point_step, _x.result.container.row_step)) 00280 _x = self.result.container.data 00281 length = len(_x) 00282 # - if encoded as a list instead, serialize as bytes instead of string 00283 if type(_x) in [list, tuple]: 00284 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00285 else: 00286 buff.write(struct.pack('<I%ss'%length, length, _x)) 00287 buff.write(_struct_B.pack(self.result.container.is_dense)) 00288 length = len(self.result.clusters) 00289 buff.write(_struct_I.pack(length)) 00290 for val1 in self.result.clusters: 00291 _v1 = val1.header 00292 buff.write(_struct_I.pack(_v1.seq)) 00293 _v2 = _v1.stamp 00294 _x = _v2 00295 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00296 _x = _v1.frame_id 00297 length = len(_x) 00298 buff.write(struct.pack('<I%ss'%length, length, _x)) 00299 _x = val1 00300 buff.write(_struct_2I.pack(_x.height, _x.width)) 00301 length = len(val1.fields) 00302 buff.write(_struct_I.pack(length)) 00303 for val2 in val1.fields: 00304 _x = val2.name 00305 length = len(_x) 00306 buff.write(struct.pack('<I%ss'%length, length, _x)) 00307 _x = val2 00308 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00309 _x = val1 00310 buff.write(_struct_B2I.pack(_x.is_bigendian, _x.point_step, _x.row_step)) 00311 _x = val1.data 00312 length = len(_x) 00313 # - if encoded as a list instead, serialize as bytes instead of string 00314 if type(_x) in [list, tuple]: 00315 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00316 else: 00317 buff.write(struct.pack('<I%ss'%length, length, _x)) 00318 buff.write(_struct_B.pack(val1.is_dense)) 00319 except struct.error as se: self._check_types(se) 00320 except TypeError as te: self._check_types(te) 00321 00322 def deserialize(self, str): 00323 """ 00324 unpack serialized message in str into this message instance 00325 @param str: byte array of serialized message 00326 @type str: str 00327 """ 00328 try: 00329 if self.header is None: 00330 self.header = std_msgs.msg._Header.Header() 00331 if self.status is None: 00332 self.status = actionlib_msgs.msg.GoalStatus() 00333 if self.result is None: 00334 self.result = object_manipulation_msgs.msg.FindContainerResult() 00335 end = 0 00336 _x = self 00337 start = end 00338 end += 12 00339 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00340 start = end 00341 end += 4 00342 (length,) = _struct_I.unpack(str[start:end]) 00343 start = end 00344 end += length 00345 self.header.frame_id = str[start:end] 00346 _x = self 00347 start = end 00348 end += 8 00349 (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00350 start = end 00351 end += 4 00352 (length,) = _struct_I.unpack(str[start:end]) 00353 start = end 00354 end += length 00355 self.status.goal_id.id = str[start:end] 00356 start = end 00357 end += 1 00358 (self.status.status,) = _struct_B.unpack(str[start:end]) 00359 start = end 00360 end += 4 00361 (length,) = _struct_I.unpack(str[start:end]) 00362 start = end 00363 end += length 00364 self.status.text = str[start:end] 00365 _x = self 00366 start = end 00367 end += 12 00368 (_x.result.box_pose.header.seq, _x.result.box_pose.header.stamp.secs, _x.result.box_pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00369 start = end 00370 end += 4 00371 (length,) = _struct_I.unpack(str[start:end]) 00372 start = end 00373 end += length 00374 self.result.box_pose.header.frame_id = str[start:end] 00375 _x = self 00376 start = end 00377 end += 92 00378 (_x.result.box_pose.pose.position.x, _x.result.box_pose.pose.position.y, _x.result.box_pose.pose.position.z, _x.result.box_pose.pose.orientation.x, _x.result.box_pose.pose.orientation.y, _x.result.box_pose.pose.orientation.z, _x.result.box_pose.pose.orientation.w, _x.result.box_dims.x, _x.result.box_dims.y, _x.result.box_dims.z, _x.result.contents.header.seq, _x.result.contents.header.stamp.secs, _x.result.contents.header.stamp.nsecs,) = _struct_10d3I.unpack(str[start:end]) 00379 start = end 00380 end += 4 00381 (length,) = _struct_I.unpack(str[start:end]) 00382 start = end 00383 end += length 00384 self.result.contents.header.frame_id = str[start:end] 00385 _x = self 00386 start = end 00387 end += 8 00388 (_x.result.contents.height, _x.result.contents.width,) = _struct_2I.unpack(str[start:end]) 00389 start = end 00390 end += 4 00391 (length,) = _struct_I.unpack(str[start:end]) 00392 self.result.contents.fields = [] 00393 for i in range(0, length): 00394 val1 = sensor_msgs.msg.PointField() 00395 start = end 00396 end += 4 00397 (length,) = _struct_I.unpack(str[start:end]) 00398 start = end 00399 end += length 00400 val1.name = str[start:end] 00401 _x = val1 00402 start = end 00403 end += 9 00404 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00405 self.result.contents.fields.append(val1) 00406 _x = self 00407 start = end 00408 end += 9 00409 (_x.result.contents.is_bigendian, _x.result.contents.point_step, _x.result.contents.row_step,) = _struct_B2I.unpack(str[start:end]) 00410 self.result.contents.is_bigendian = bool(self.result.contents.is_bigendian) 00411 start = end 00412 end += 4 00413 (length,) = _struct_I.unpack(str[start:end]) 00414 start = end 00415 end += length 00416 self.result.contents.data = str[start:end] 00417 _x = self 00418 start = end 00419 end += 13 00420 (_x.result.contents.is_dense, _x.result.container.header.seq, _x.result.container.header.stamp.secs, _x.result.container.header.stamp.nsecs,) = _struct_B3I.unpack(str[start:end]) 00421 self.result.contents.is_dense = bool(self.result.contents.is_dense) 00422 start = end 00423 end += 4 00424 (length,) = _struct_I.unpack(str[start:end]) 00425 start = end 00426 end += length 00427 self.result.container.header.frame_id = str[start:end] 00428 _x = self 00429 start = end 00430 end += 8 00431 (_x.result.container.height, _x.result.container.width,) = _struct_2I.unpack(str[start:end]) 00432 start = end 00433 end += 4 00434 (length,) = _struct_I.unpack(str[start:end]) 00435 self.result.container.fields = [] 00436 for i in range(0, length): 00437 val1 = sensor_msgs.msg.PointField() 00438 start = end 00439 end += 4 00440 (length,) = _struct_I.unpack(str[start:end]) 00441 start = end 00442 end += length 00443 val1.name = str[start:end] 00444 _x = val1 00445 start = end 00446 end += 9 00447 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00448 self.result.container.fields.append(val1) 00449 _x = self 00450 start = end 00451 end += 9 00452 (_x.result.container.is_bigendian, _x.result.container.point_step, _x.result.container.row_step,) = _struct_B2I.unpack(str[start:end]) 00453 self.result.container.is_bigendian = bool(self.result.container.is_bigendian) 00454 start = end 00455 end += 4 00456 (length,) = _struct_I.unpack(str[start:end]) 00457 start = end 00458 end += length 00459 self.result.container.data = str[start:end] 00460 start = end 00461 end += 1 00462 (self.result.container.is_dense,) = _struct_B.unpack(str[start:end]) 00463 self.result.container.is_dense = bool(self.result.container.is_dense) 00464 start = end 00465 end += 4 00466 (length,) = _struct_I.unpack(str[start:end]) 00467 self.result.clusters = [] 00468 for i in range(0, length): 00469 val1 = sensor_msgs.msg.PointCloud2() 00470 _v3 = val1.header 00471 start = end 00472 end += 4 00473 (_v3.seq,) = _struct_I.unpack(str[start:end]) 00474 _v4 = _v3.stamp 00475 _x = _v4 00476 start = end 00477 end += 8 00478 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00479 start = end 00480 end += 4 00481 (length,) = _struct_I.unpack(str[start:end]) 00482 start = end 00483 end += length 00484 _v3.frame_id = str[start:end] 00485 _x = val1 00486 start = end 00487 end += 8 00488 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 00489 start = end 00490 end += 4 00491 (length,) = _struct_I.unpack(str[start:end]) 00492 val1.fields = [] 00493 for i in range(0, length): 00494 val2 = sensor_msgs.msg.PointField() 00495 start = end 00496 end += 4 00497 (length,) = _struct_I.unpack(str[start:end]) 00498 start = end 00499 end += length 00500 val2.name = str[start:end] 00501 _x = val2 00502 start = end 00503 end += 9 00504 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00505 val1.fields.append(val2) 00506 _x = val1 00507 start = end 00508 end += 9 00509 (_x.is_bigendian, _x.point_step, _x.row_step,) = _struct_B2I.unpack(str[start:end]) 00510 val1.is_bigendian = bool(val1.is_bigendian) 00511 start = end 00512 end += 4 00513 (length,) = _struct_I.unpack(str[start:end]) 00514 start = end 00515 end += length 00516 val1.data = str[start:end] 00517 start = end 00518 end += 1 00519 (val1.is_dense,) = _struct_B.unpack(str[start:end]) 00520 val1.is_dense = bool(val1.is_dense) 00521 self.result.clusters.append(val1) 00522 return self 00523 except struct.error as e: 00524 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00525 00526 00527 def serialize_numpy(self, buff, numpy): 00528 """ 00529 serialize message with numpy array types into buffer 00530 @param buff: buffer 00531 @type buff: StringIO 00532 @param numpy: numpy python module 00533 @type numpy module 00534 """ 00535 try: 00536 _x = self 00537 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00538 _x = self.header.frame_id 00539 length = len(_x) 00540 buff.write(struct.pack('<I%ss'%length, length, _x)) 00541 _x = self 00542 buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs)) 00543 _x = self.status.goal_id.id 00544 length = len(_x) 00545 buff.write(struct.pack('<I%ss'%length, length, _x)) 00546 buff.write(_struct_B.pack(self.status.status)) 00547 _x = self.status.text 00548 length = len(_x) 00549 buff.write(struct.pack('<I%ss'%length, length, _x)) 00550 _x = self 00551 buff.write(_struct_3I.pack(_x.result.box_pose.header.seq, _x.result.box_pose.header.stamp.secs, _x.result.box_pose.header.stamp.nsecs)) 00552 _x = self.result.box_pose.header.frame_id 00553 length = len(_x) 00554 buff.write(struct.pack('<I%ss'%length, length, _x)) 00555 _x = self 00556 buff.write(_struct_10d3I.pack(_x.result.box_pose.pose.position.x, _x.result.box_pose.pose.position.y, _x.result.box_pose.pose.position.z, _x.result.box_pose.pose.orientation.x, _x.result.box_pose.pose.orientation.y, _x.result.box_pose.pose.orientation.z, _x.result.box_pose.pose.orientation.w, _x.result.box_dims.x, _x.result.box_dims.y, _x.result.box_dims.z, _x.result.contents.header.seq, _x.result.contents.header.stamp.secs, _x.result.contents.header.stamp.nsecs)) 00557 _x = self.result.contents.header.frame_id 00558 length = len(_x) 00559 buff.write(struct.pack('<I%ss'%length, length, _x)) 00560 _x = self 00561 buff.write(_struct_2I.pack(_x.result.contents.height, _x.result.contents.width)) 00562 length = len(self.result.contents.fields) 00563 buff.write(_struct_I.pack(length)) 00564 for val1 in self.result.contents.fields: 00565 _x = val1.name 00566 length = len(_x) 00567 buff.write(struct.pack('<I%ss'%length, length, _x)) 00568 _x = val1 00569 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00570 _x = self 00571 buff.write(_struct_B2I.pack(_x.result.contents.is_bigendian, _x.result.contents.point_step, _x.result.contents.row_step)) 00572 _x = self.result.contents.data 00573 length = len(_x) 00574 # - if encoded as a list instead, serialize as bytes instead of string 00575 if type(_x) in [list, tuple]: 00576 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00577 else: 00578 buff.write(struct.pack('<I%ss'%length, length, _x)) 00579 _x = self 00580 buff.write(_struct_B3I.pack(_x.result.contents.is_dense, _x.result.container.header.seq, _x.result.container.header.stamp.secs, _x.result.container.header.stamp.nsecs)) 00581 _x = self.result.container.header.frame_id 00582 length = len(_x) 00583 buff.write(struct.pack('<I%ss'%length, length, _x)) 00584 _x = self 00585 buff.write(_struct_2I.pack(_x.result.container.height, _x.result.container.width)) 00586 length = len(self.result.container.fields) 00587 buff.write(_struct_I.pack(length)) 00588 for val1 in self.result.container.fields: 00589 _x = val1.name 00590 length = len(_x) 00591 buff.write(struct.pack('<I%ss'%length, length, _x)) 00592 _x = val1 00593 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00594 _x = self 00595 buff.write(_struct_B2I.pack(_x.result.container.is_bigendian, _x.result.container.point_step, _x.result.container.row_step)) 00596 _x = self.result.container.data 00597 length = len(_x) 00598 # - if encoded as a list instead, serialize as bytes instead of string 00599 if type(_x) in [list, tuple]: 00600 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00601 else: 00602 buff.write(struct.pack('<I%ss'%length, length, _x)) 00603 buff.write(_struct_B.pack(self.result.container.is_dense)) 00604 length = len(self.result.clusters) 00605 buff.write(_struct_I.pack(length)) 00606 for val1 in self.result.clusters: 00607 _v5 = val1.header 00608 buff.write(_struct_I.pack(_v5.seq)) 00609 _v6 = _v5.stamp 00610 _x = _v6 00611 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00612 _x = _v5.frame_id 00613 length = len(_x) 00614 buff.write(struct.pack('<I%ss'%length, length, _x)) 00615 _x = val1 00616 buff.write(_struct_2I.pack(_x.height, _x.width)) 00617 length = len(val1.fields) 00618 buff.write(_struct_I.pack(length)) 00619 for val2 in val1.fields: 00620 _x = val2.name 00621 length = len(_x) 00622 buff.write(struct.pack('<I%ss'%length, length, _x)) 00623 _x = val2 00624 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00625 _x = val1 00626 buff.write(_struct_B2I.pack(_x.is_bigendian, _x.point_step, _x.row_step)) 00627 _x = val1.data 00628 length = len(_x) 00629 # - if encoded as a list instead, serialize as bytes instead of string 00630 if type(_x) in [list, tuple]: 00631 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00632 else: 00633 buff.write(struct.pack('<I%ss'%length, length, _x)) 00634 buff.write(_struct_B.pack(val1.is_dense)) 00635 except struct.error as se: self._check_types(se) 00636 except TypeError as te: self._check_types(te) 00637 00638 def deserialize_numpy(self, str, numpy): 00639 """ 00640 unpack serialized message in str into this message instance using numpy for array types 00641 @param str: byte array of serialized message 00642 @type str: str 00643 @param numpy: numpy python module 00644 @type numpy: module 00645 """ 00646 try: 00647 if self.header is None: 00648 self.header = std_msgs.msg._Header.Header() 00649 if self.status is None: 00650 self.status = actionlib_msgs.msg.GoalStatus() 00651 if self.result is None: 00652 self.result = object_manipulation_msgs.msg.FindContainerResult() 00653 end = 0 00654 _x = self 00655 start = end 00656 end += 12 00657 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00658 start = end 00659 end += 4 00660 (length,) = _struct_I.unpack(str[start:end]) 00661 start = end 00662 end += length 00663 self.header.frame_id = str[start:end] 00664 _x = self 00665 start = end 00666 end += 8 00667 (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00668 start = end 00669 end += 4 00670 (length,) = _struct_I.unpack(str[start:end]) 00671 start = end 00672 end += length 00673 self.status.goal_id.id = str[start:end] 00674 start = end 00675 end += 1 00676 (self.status.status,) = _struct_B.unpack(str[start:end]) 00677 start = end 00678 end += 4 00679 (length,) = _struct_I.unpack(str[start:end]) 00680 start = end 00681 end += length 00682 self.status.text = str[start:end] 00683 _x = self 00684 start = end 00685 end += 12 00686 (_x.result.box_pose.header.seq, _x.result.box_pose.header.stamp.secs, _x.result.box_pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00687 start = end 00688 end += 4 00689 (length,) = _struct_I.unpack(str[start:end]) 00690 start = end 00691 end += length 00692 self.result.box_pose.header.frame_id = str[start:end] 00693 _x = self 00694 start = end 00695 end += 92 00696 (_x.result.box_pose.pose.position.x, _x.result.box_pose.pose.position.y, _x.result.box_pose.pose.position.z, _x.result.box_pose.pose.orientation.x, _x.result.box_pose.pose.orientation.y, _x.result.box_pose.pose.orientation.z, _x.result.box_pose.pose.orientation.w, _x.result.box_dims.x, _x.result.box_dims.y, _x.result.box_dims.z, _x.result.contents.header.seq, _x.result.contents.header.stamp.secs, _x.result.contents.header.stamp.nsecs,) = _struct_10d3I.unpack(str[start:end]) 00697 start = end 00698 end += 4 00699 (length,) = _struct_I.unpack(str[start:end]) 00700 start = end 00701 end += length 00702 self.result.contents.header.frame_id = str[start:end] 00703 _x = self 00704 start = end 00705 end += 8 00706 (_x.result.contents.height, _x.result.contents.width,) = _struct_2I.unpack(str[start:end]) 00707 start = end 00708 end += 4 00709 (length,) = _struct_I.unpack(str[start:end]) 00710 self.result.contents.fields = [] 00711 for i in range(0, length): 00712 val1 = sensor_msgs.msg.PointField() 00713 start = end 00714 end += 4 00715 (length,) = _struct_I.unpack(str[start:end]) 00716 start = end 00717 end += length 00718 val1.name = str[start:end] 00719 _x = val1 00720 start = end 00721 end += 9 00722 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00723 self.result.contents.fields.append(val1) 00724 _x = self 00725 start = end 00726 end += 9 00727 (_x.result.contents.is_bigendian, _x.result.contents.point_step, _x.result.contents.row_step,) = _struct_B2I.unpack(str[start:end]) 00728 self.result.contents.is_bigendian = bool(self.result.contents.is_bigendian) 00729 start = end 00730 end += 4 00731 (length,) = _struct_I.unpack(str[start:end]) 00732 start = end 00733 end += length 00734 self.result.contents.data = str[start:end] 00735 _x = self 00736 start = end 00737 end += 13 00738 (_x.result.contents.is_dense, _x.result.container.header.seq, _x.result.container.header.stamp.secs, _x.result.container.header.stamp.nsecs,) = _struct_B3I.unpack(str[start:end]) 00739 self.result.contents.is_dense = bool(self.result.contents.is_dense) 00740 start = end 00741 end += 4 00742 (length,) = _struct_I.unpack(str[start:end]) 00743 start = end 00744 end += length 00745 self.result.container.header.frame_id = str[start:end] 00746 _x = self 00747 start = end 00748 end += 8 00749 (_x.result.container.height, _x.result.container.width,) = _struct_2I.unpack(str[start:end]) 00750 start = end 00751 end += 4 00752 (length,) = _struct_I.unpack(str[start:end]) 00753 self.result.container.fields = [] 00754 for i in range(0, length): 00755 val1 = sensor_msgs.msg.PointField() 00756 start = end 00757 end += 4 00758 (length,) = _struct_I.unpack(str[start:end]) 00759 start = end 00760 end += length 00761 val1.name = str[start:end] 00762 _x = val1 00763 start = end 00764 end += 9 00765 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00766 self.result.container.fields.append(val1) 00767 _x = self 00768 start = end 00769 end += 9 00770 (_x.result.container.is_bigendian, _x.result.container.point_step, _x.result.container.row_step,) = _struct_B2I.unpack(str[start:end]) 00771 self.result.container.is_bigendian = bool(self.result.container.is_bigendian) 00772 start = end 00773 end += 4 00774 (length,) = _struct_I.unpack(str[start:end]) 00775 start = end 00776 end += length 00777 self.result.container.data = str[start:end] 00778 start = end 00779 end += 1 00780 (self.result.container.is_dense,) = _struct_B.unpack(str[start:end]) 00781 self.result.container.is_dense = bool(self.result.container.is_dense) 00782 start = end 00783 end += 4 00784 (length,) = _struct_I.unpack(str[start:end]) 00785 self.result.clusters = [] 00786 for i in range(0, length): 00787 val1 = sensor_msgs.msg.PointCloud2() 00788 _v7 = val1.header 00789 start = end 00790 end += 4 00791 (_v7.seq,) = _struct_I.unpack(str[start:end]) 00792 _v8 = _v7.stamp 00793 _x = _v8 00794 start = end 00795 end += 8 00796 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00797 start = end 00798 end += 4 00799 (length,) = _struct_I.unpack(str[start:end]) 00800 start = end 00801 end += length 00802 _v7.frame_id = str[start:end] 00803 _x = val1 00804 start = end 00805 end += 8 00806 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 00807 start = end 00808 end += 4 00809 (length,) = _struct_I.unpack(str[start:end]) 00810 val1.fields = [] 00811 for i in range(0, length): 00812 val2 = sensor_msgs.msg.PointField() 00813 start = end 00814 end += 4 00815 (length,) = _struct_I.unpack(str[start:end]) 00816 start = end 00817 end += length 00818 val2.name = str[start:end] 00819 _x = val2 00820 start = end 00821 end += 9 00822 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00823 val1.fields.append(val2) 00824 _x = val1 00825 start = end 00826 end += 9 00827 (_x.is_bigendian, _x.point_step, _x.row_step,) = _struct_B2I.unpack(str[start:end]) 00828 val1.is_bigendian = bool(val1.is_bigendian) 00829 start = end 00830 end += 4 00831 (length,) = _struct_I.unpack(str[start:end]) 00832 start = end 00833 end += length 00834 val1.data = str[start:end] 00835 start = end 00836 end += 1 00837 (val1.is_dense,) = _struct_B.unpack(str[start:end]) 00838 val1.is_dense = bool(val1.is_dense) 00839 self.result.clusters.append(val1) 00840 return self 00841 except struct.error as e: 00842 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00843 00844 _struct_I = roslib.message.struct_I 00845 _struct_IBI = struct.Struct("<IBI") 00846 _struct_B = struct.Struct("<B") 00847 _struct_10d3I = struct.Struct("<10d3I") 00848 _struct_3I = struct.Struct("<3I") 00849 _struct_B3I = struct.Struct("<B3I") 00850 _struct_B2I = struct.Struct("<B2I") 00851 _struct_2I = struct.Struct("<2I")