$search
00001 """autogenerated by genmsg_py from PickPlaceRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class PickPlaceRequest(roslib.message.Message): 00007 _md5sum = "a103fd90ae71bfd419fcdfa60a00c804" 00008 _type = "pr2_pick_and_place_service/PickPlaceRequest" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """string command 00011 string arg 00012 00013 00014 """ 00015 __slots__ = ['command','arg'] 00016 _slot_types = ['string','string'] 00017 00018 def __init__(self, *args, **kwds): 00019 """ 00020 Constructor. Any message fields that are implicitly/explicitly 00021 set to None will be assigned a default value. The recommend 00022 use is keyword arguments as this is more robust to future message 00023 changes. You cannot mix in-order arguments and keyword arguments. 00024 00025 The available fields are: 00026 command,arg 00027 00028 @param args: complete set of field values, in .msg order 00029 @param kwds: use keyword arguments corresponding to message field names 00030 to set specific fields. 00031 """ 00032 if args or kwds: 00033 super(PickPlaceRequest, self).__init__(*args, **kwds) 00034 #message fields cannot be None, assign default values for those that are 00035 if self.command is None: 00036 self.command = '' 00037 if self.arg is None: 00038 self.arg = '' 00039 else: 00040 self.command = '' 00041 self.arg = '' 00042 00043 def _get_types(self): 00044 """ 00045 internal API method 00046 """ 00047 return self._slot_types 00048 00049 def serialize(self, buff): 00050 """ 00051 serialize message into buffer 00052 @param buff: buffer 00053 @type buff: StringIO 00054 """ 00055 try: 00056 _x = self.command 00057 length = len(_x) 00058 buff.write(struct.pack('<I%ss'%length, length, _x)) 00059 _x = self.arg 00060 length = len(_x) 00061 buff.write(struct.pack('<I%ss'%length, length, _x)) 00062 except struct.error as se: self._check_types(se) 00063 except TypeError as te: self._check_types(te) 00064 00065 def deserialize(self, str): 00066 """ 00067 unpack serialized message in str into this message instance 00068 @param str: byte array of serialized message 00069 @type str: str 00070 """ 00071 try: 00072 end = 0 00073 start = end 00074 end += 4 00075 (length,) = _struct_I.unpack(str[start:end]) 00076 start = end 00077 end += length 00078 self.command = str[start:end] 00079 start = end 00080 end += 4 00081 (length,) = _struct_I.unpack(str[start:end]) 00082 start = end 00083 end += length 00084 self.arg = str[start:end] 00085 return self 00086 except struct.error as e: 00087 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00088 00089 00090 def serialize_numpy(self, buff, numpy): 00091 """ 00092 serialize message with numpy array types into buffer 00093 @param buff: buffer 00094 @type buff: StringIO 00095 @param numpy: numpy python module 00096 @type numpy module 00097 """ 00098 try: 00099 _x = self.command 00100 length = len(_x) 00101 buff.write(struct.pack('<I%ss'%length, length, _x)) 00102 _x = self.arg 00103 length = len(_x) 00104 buff.write(struct.pack('<I%ss'%length, length, _x)) 00105 except struct.error as se: self._check_types(se) 00106 except TypeError as te: self._check_types(te) 00107 00108 def deserialize_numpy(self, str, numpy): 00109 """ 00110 unpack serialized message in str into this message instance using numpy for array types 00111 @param str: byte array of serialized message 00112 @type str: str 00113 @param numpy: numpy python module 00114 @type numpy: module 00115 """ 00116 try: 00117 end = 0 00118 start = end 00119 end += 4 00120 (length,) = _struct_I.unpack(str[start:end]) 00121 start = end 00122 end += length 00123 self.command = str[start:end] 00124 start = end 00125 end += 4 00126 (length,) = _struct_I.unpack(str[start:end]) 00127 start = end 00128 end += length 00129 self.arg = str[start:end] 00130 return self 00131 except struct.error as e: 00132 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00133 00134 _struct_I = roslib.message.struct_I 00135 """autogenerated by genmsg_py from PickPlaceResponse.msg. Do not edit.""" 00136 import roslib.message 00137 import struct 00138 00139 import object_manipulation_msgs.msg 00140 import geometry_msgs.msg 00141 import pr2_pick_and_place_service.msg 00142 import sensor_msgs.msg 00143 import household_objects_database_msgs.msg 00144 import std_msgs.msg 00145 00146 class PickPlaceResponse(roslib.message.Message): 00147 _md5sum = "a1461d83d374e19cb65866ae1f17bb1c" 00148 _type = "pr2_pick_and_place_service/PickPlaceResponse" 00149 _has_header = False #flag to mark the presence of a Header object 00150 _full_text = """string response 00151 PickPlaceObject[] objects 00152 00153 00154 ================================================================================ 00155 MSG: pr2_pick_and_place_service/PickPlaceObject 00156 int32 objectid 00157 object_manipulation_msgs/GraspableObject object 00158 geometry_msgs/PoseStamped pose 00159 float64[] boundingbox 00160 00161 ================================================================================ 00162 MSG: object_manipulation_msgs/GraspableObject 00163 # an object that the object_manipulator can work on 00164 00165 # a graspable object can be represented in multiple ways. This message 00166 # can contain all of them. Which one is actually used is up to the receiver 00167 # of this message. When adding new representations, one must be careful that 00168 # they have reasonable lightweight defaults indicating that that particular 00169 # representation is not available. 00170 00171 # the tf frame to be used as a reference frame when combining information from 00172 # the different representations below 00173 string reference_frame_id 00174 00175 # potential recognition results from a database of models 00176 # all poses are relative to the object reference pose 00177 household_objects_database_msgs/DatabaseModelPose[] potential_models 00178 00179 # the point cloud itself 00180 sensor_msgs/PointCloud cluster 00181 00182 # a region of a PointCloud2 of interest 00183 object_manipulation_msgs/SceneRegion region 00184 00185 # the name that this object has in the collision environment 00186 string collision_name 00187 ================================================================================ 00188 MSG: household_objects_database_msgs/DatabaseModelPose 00189 # Informs that a specific model from the Model Database has been 00190 # identified at a certain location 00191 00192 # the database id of the model 00193 int32 model_id 00194 00195 # the pose that it can be found in 00196 geometry_msgs/PoseStamped pose 00197 00198 # a measure of the confidence level in this detection result 00199 float32 confidence 00200 00201 # the name of the object detector that generated this detection result 00202 string detector_name 00203 00204 ================================================================================ 00205 MSG: geometry_msgs/PoseStamped 00206 # A Pose with reference coordinate frame and timestamp 00207 Header header 00208 Pose pose 00209 00210 ================================================================================ 00211 MSG: std_msgs/Header 00212 # Standard metadata for higher-level stamped data types. 00213 # This is generally used to communicate timestamped data 00214 # in a particular coordinate frame. 00215 # 00216 # sequence ID: consecutively increasing ID 00217 uint32 seq 00218 #Two-integer timestamp that is expressed as: 00219 # * stamp.secs: seconds (stamp_secs) since epoch 00220 # * stamp.nsecs: nanoseconds since stamp_secs 00221 # time-handling sugar is provided by the client library 00222 time stamp 00223 #Frame this data is associated with 00224 # 0: no frame 00225 # 1: global frame 00226 string frame_id 00227 00228 ================================================================================ 00229 MSG: geometry_msgs/Pose 00230 # A representation of pose in free space, composed of postion and orientation. 00231 Point position 00232 Quaternion orientation 00233 00234 ================================================================================ 00235 MSG: geometry_msgs/Point 00236 # This contains the position of a point in free space 00237 float64 x 00238 float64 y 00239 float64 z 00240 00241 ================================================================================ 00242 MSG: geometry_msgs/Quaternion 00243 # This represents an orientation in free space in quaternion form. 00244 00245 float64 x 00246 float64 y 00247 float64 z 00248 float64 w 00249 00250 ================================================================================ 00251 MSG: sensor_msgs/PointCloud 00252 # This message holds a collection of 3d points, plus optional additional 00253 # information about each point. 00254 00255 # Time of sensor data acquisition, coordinate frame ID. 00256 Header header 00257 00258 # Array of 3d points. Each Point32 should be interpreted as a 3d point 00259 # in the frame given in the header. 00260 geometry_msgs/Point32[] points 00261 00262 # Each channel should have the same number of elements as points array, 00263 # and the data in each channel should correspond 1:1 with each point. 00264 # Channel names in common practice are listed in ChannelFloat32.msg. 00265 ChannelFloat32[] channels 00266 00267 ================================================================================ 00268 MSG: geometry_msgs/Point32 00269 # This contains the position of a point in free space(with 32 bits of precision). 00270 # It is recommeded to use Point wherever possible instead of Point32. 00271 # 00272 # This recommendation is to promote interoperability. 00273 # 00274 # This message is designed to take up less space when sending 00275 # lots of points at once, as in the case of a PointCloud. 00276 00277 float32 x 00278 float32 y 00279 float32 z 00280 ================================================================================ 00281 MSG: sensor_msgs/ChannelFloat32 00282 # This message is used by the PointCloud message to hold optional data 00283 # associated with each point in the cloud. The length of the values 00284 # array should be the same as the length of the points array in the 00285 # PointCloud, and each value should be associated with the corresponding 00286 # point. 00287 00288 # Channel names in existing practice include: 00289 # "u", "v" - row and column (respectively) in the left stereo image. 00290 # This is opposite to usual conventions but remains for 00291 # historical reasons. The newer PointCloud2 message has no 00292 # such problem. 00293 # "rgb" - For point clouds produced by color stereo cameras. uint8 00294 # (R,G,B) values packed into the least significant 24 bits, 00295 # in order. 00296 # "intensity" - laser or pixel intensity. 00297 # "distance" 00298 00299 # The channel name should give semantics of the channel (e.g. 00300 # "intensity" instead of "value"). 00301 string name 00302 00303 # The values array should be 1-1 with the elements of the associated 00304 # PointCloud. 00305 float32[] values 00306 00307 ================================================================================ 00308 MSG: object_manipulation_msgs/SceneRegion 00309 # Point cloud 00310 sensor_msgs/PointCloud2 cloud 00311 00312 # Indices for the region of interest 00313 int32[] mask 00314 00315 # One of the corresponding 2D images, if applicable 00316 sensor_msgs/Image image 00317 00318 # The disparity image, if applicable 00319 sensor_msgs/Image disparity_image 00320 00321 # Camera info for the camera that took the image 00322 sensor_msgs/CameraInfo cam_info 00323 00324 # a 3D region of interest for grasp planning 00325 geometry_msgs/PoseStamped roi_box_pose 00326 geometry_msgs/Vector3 roi_box_dims 00327 00328 ================================================================================ 00329 MSG: sensor_msgs/PointCloud2 00330 # This message holds a collection of N-dimensional points, which may 00331 # contain additional information such as normals, intensity, etc. The 00332 # point data is stored as a binary blob, its layout described by the 00333 # contents of the "fields" array. 00334 00335 # The point cloud data may be organized 2d (image-like) or 1d 00336 # (unordered). Point clouds organized as 2d images may be produced by 00337 # camera depth sensors such as stereo or time-of-flight. 00338 00339 # Time of sensor data acquisition, and the coordinate frame ID (for 3d 00340 # points). 00341 Header header 00342 00343 # 2D structure of the point cloud. If the cloud is unordered, height is 00344 # 1 and width is the length of the point cloud. 00345 uint32 height 00346 uint32 width 00347 00348 # Describes the channels and their layout in the binary data blob. 00349 PointField[] fields 00350 00351 bool is_bigendian # Is this data bigendian? 00352 uint32 point_step # Length of a point in bytes 00353 uint32 row_step # Length of a row in bytes 00354 uint8[] data # Actual point data, size is (row_step*height) 00355 00356 bool is_dense # True if there are no invalid points 00357 00358 ================================================================================ 00359 MSG: sensor_msgs/PointField 00360 # This message holds the description of one point entry in the 00361 # PointCloud2 message format. 00362 uint8 INT8 = 1 00363 uint8 UINT8 = 2 00364 uint8 INT16 = 3 00365 uint8 UINT16 = 4 00366 uint8 INT32 = 5 00367 uint8 UINT32 = 6 00368 uint8 FLOAT32 = 7 00369 uint8 FLOAT64 = 8 00370 00371 string name # Name of field 00372 uint32 offset # Offset from start of point struct 00373 uint8 datatype # Datatype enumeration, see above 00374 uint32 count # How many elements in the field 00375 00376 ================================================================================ 00377 MSG: sensor_msgs/Image 00378 # This message contains an uncompressed image 00379 # (0, 0) is at top-left corner of image 00380 # 00381 00382 Header header # Header timestamp should be acquisition time of image 00383 # Header frame_id should be optical frame of camera 00384 # origin of frame should be optical center of cameara 00385 # +x should point to the right in the image 00386 # +y should point down in the image 00387 # +z should point into to plane of the image 00388 # If the frame_id here and the frame_id of the CameraInfo 00389 # message associated with the image conflict 00390 # the behavior is undefined 00391 00392 uint32 height # image height, that is, number of rows 00393 uint32 width # image width, that is, number of columns 00394 00395 # The legal values for encoding are in file src/image_encodings.cpp 00396 # If you want to standardize a new string format, join 00397 # ros-users@lists.sourceforge.net and send an email proposing a new encoding. 00398 00399 string encoding # Encoding of pixels -- channel meaning, ordering, size 00400 # taken from the list of strings in src/image_encodings.cpp 00401 00402 uint8 is_bigendian # is this data bigendian? 00403 uint32 step # Full row length in bytes 00404 uint8[] data # actual matrix data, size is (step * rows) 00405 00406 ================================================================================ 00407 MSG: sensor_msgs/CameraInfo 00408 # This message defines meta information for a camera. It should be in a 00409 # camera namespace on topic "camera_info" and accompanied by up to five 00410 # image topics named: 00411 # 00412 # image_raw - raw data from the camera driver, possibly Bayer encoded 00413 # image - monochrome, distorted 00414 # image_color - color, distorted 00415 # image_rect - monochrome, rectified 00416 # image_rect_color - color, rectified 00417 # 00418 # The image_pipeline contains packages (image_proc, stereo_image_proc) 00419 # for producing the four processed image topics from image_raw and 00420 # camera_info. The meaning of the camera parameters are described in 00421 # detail at http://www.ros.org/wiki/image_pipeline/CameraInfo. 00422 # 00423 # The image_geometry package provides a user-friendly interface to 00424 # common operations using this meta information. If you want to, e.g., 00425 # project a 3d point into image coordinates, we strongly recommend 00426 # using image_geometry. 00427 # 00428 # If the camera is uncalibrated, the matrices D, K, R, P should be left 00429 # zeroed out. In particular, clients may assume that K[0] == 0.0 00430 # indicates an uncalibrated camera. 00431 00432 ####################################################################### 00433 # Image acquisition info # 00434 ####################################################################### 00435 00436 # Time of image acquisition, camera coordinate frame ID 00437 Header header # Header timestamp should be acquisition time of image 00438 # Header frame_id should be optical frame of camera 00439 # origin of frame should be optical center of camera 00440 # +x should point to the right in the image 00441 # +y should point down in the image 00442 # +z should point into the plane of the image 00443 00444 00445 ####################################################################### 00446 # Calibration Parameters # 00447 ####################################################################### 00448 # These are fixed during camera calibration. Their values will be the # 00449 # same in all messages until the camera is recalibrated. Note that # 00450 # self-calibrating systems may "recalibrate" frequently. # 00451 # # 00452 # The internal parameters can be used to warp a raw (distorted) image # 00453 # to: # 00454 # 1. An undistorted image (requires D and K) # 00455 # 2. A rectified image (requires D, K, R) # 00456 # The projection matrix P projects 3D points into the rectified image.# 00457 ####################################################################### 00458 00459 # The image dimensions with which the camera was calibrated. Normally 00460 # this will be the full camera resolution in pixels. 00461 uint32 height 00462 uint32 width 00463 00464 # The distortion model used. Supported models are listed in 00465 # sensor_msgs/distortion_models.h. For most cameras, "plumb_bob" - a 00466 # simple model of radial and tangential distortion - is sufficent. 00467 string distortion_model 00468 00469 # The distortion parameters, size depending on the distortion model. 00470 # For "plumb_bob", the 5 parameters are: (k1, k2, t1, t2, k3). 00471 float64[] D 00472 00473 # Intrinsic camera matrix for the raw (distorted) images. 00474 # [fx 0 cx] 00475 # K = [ 0 fy cy] 00476 # [ 0 0 1] 00477 # Projects 3D points in the camera coordinate frame to 2D pixel 00478 # coordinates using the focal lengths (fx, fy) and principal point 00479 # (cx, cy). 00480 float64[9] K # 3x3 row-major matrix 00481 00482 # Rectification matrix (stereo cameras only) 00483 # A rotation matrix aligning the camera coordinate system to the ideal 00484 # stereo image plane so that epipolar lines in both stereo images are 00485 # parallel. 00486 float64[9] R # 3x3 row-major matrix 00487 00488 # Projection/camera matrix 00489 # [fx' 0 cx' Tx] 00490 # P = [ 0 fy' cy' Ty] 00491 # [ 0 0 1 0] 00492 # By convention, this matrix specifies the intrinsic (camera) matrix 00493 # of the processed (rectified) image. That is, the left 3x3 portion 00494 # is the normal camera intrinsic matrix for the rectified image. 00495 # It projects 3D points in the camera coordinate frame to 2D pixel 00496 # coordinates using the focal lengths (fx', fy') and principal point 00497 # (cx', cy') - these may differ from the values in K. 00498 # For monocular cameras, Tx = Ty = 0. Normally, monocular cameras will 00499 # also have R = the identity and P[1:3,1:3] = K. 00500 # For a stereo pair, the fourth column [Tx Ty 0]' is related to the 00501 # position of the optical center of the second camera in the first 00502 # camera's frame. We assume Tz = 0 so both cameras are in the same 00503 # stereo image plane. The first camera always has Tx = Ty = 0. For 00504 # the right (second) camera of a horizontal stereo pair, Ty = 0 and 00505 # Tx = -fx' * B, where B is the baseline between the cameras. 00506 # Given a 3D point [X Y Z]', the projection (x, y) of the point onto 00507 # the rectified image is given by: 00508 # [u v w]' = P * [X Y Z 1]' 00509 # x = u / w 00510 # y = v / w 00511 # This holds for both images of a stereo pair. 00512 float64[12] P # 3x4 row-major matrix 00513 00514 00515 ####################################################################### 00516 # Operational Parameters # 00517 ####################################################################### 00518 # These define the image region actually captured by the camera # 00519 # driver. Although they affect the geometry of the output image, they # 00520 # may be changed freely without recalibrating the camera. # 00521 ####################################################################### 00522 00523 # Binning refers here to any camera setting which combines rectangular 00524 # neighborhoods of pixels into larger "super-pixels." It reduces the 00525 # resolution of the output image to 00526 # (width / binning_x) x (height / binning_y). 00527 # The default values binning_x = binning_y = 0 is considered the same 00528 # as binning_x = binning_y = 1 (no subsampling). 00529 uint32 binning_x 00530 uint32 binning_y 00531 00532 # Region of interest (subwindow of full camera resolution), given in 00533 # full resolution (unbinned) image coordinates. A particular ROI 00534 # always denotes the same window of pixels on the camera sensor, 00535 # regardless of binning settings. 00536 # The default setting of roi (all values 0) is considered the same as 00537 # full resolution (roi.width = width, roi.height = height). 00538 RegionOfInterest roi 00539 00540 ================================================================================ 00541 MSG: sensor_msgs/RegionOfInterest 00542 # This message is used to specify a region of interest within an image. 00543 # 00544 # When used to specify the ROI setting of the camera when the image was 00545 # taken, the height and width fields should either match the height and 00546 # width fields for the associated image; or height = width = 0 00547 # indicates that the full resolution image was captured. 00548 00549 uint32 x_offset # Leftmost pixel of the ROI 00550 # (0 if the ROI includes the left edge of the image) 00551 uint32 y_offset # Topmost pixel of the ROI 00552 # (0 if the ROI includes the top edge of the image) 00553 uint32 height # Height of ROI 00554 uint32 width # Width of ROI 00555 00556 # True if a distinct rectified ROI should be calculated from the "raw" 00557 # ROI in this message. Typically this should be False if the full image 00558 # is captured (ROI not used), and True if a subwindow is captured (ROI 00559 # used). 00560 bool do_rectify 00561 00562 ================================================================================ 00563 MSG: geometry_msgs/Vector3 00564 # This represents a vector in free space. 00565 00566 float64 x 00567 float64 y 00568 float64 z 00569 """ 00570 __slots__ = ['response','objects'] 00571 _slot_types = ['string','pr2_pick_and_place_service/PickPlaceObject[]'] 00572 00573 def __init__(self, *args, **kwds): 00574 """ 00575 Constructor. Any message fields that are implicitly/explicitly 00576 set to None will be assigned a default value. The recommend 00577 use is keyword arguments as this is more robust to future message 00578 changes. You cannot mix in-order arguments and keyword arguments. 00579 00580 The available fields are: 00581 response,objects 00582 00583 @param args: complete set of field values, in .msg order 00584 @param kwds: use keyword arguments corresponding to message field names 00585 to set specific fields. 00586 """ 00587 if args or kwds: 00588 super(PickPlaceResponse, self).__init__(*args, **kwds) 00589 #message fields cannot be None, assign default values for those that are 00590 if self.response is None: 00591 self.response = '' 00592 if self.objects is None: 00593 self.objects = [] 00594 else: 00595 self.response = '' 00596 self.objects = [] 00597 00598 def _get_types(self): 00599 """ 00600 internal API method 00601 """ 00602 return self._slot_types 00603 00604 def serialize(self, buff): 00605 """ 00606 serialize message into buffer 00607 @param buff: buffer 00608 @type buff: StringIO 00609 """ 00610 try: 00611 _x = self.response 00612 length = len(_x) 00613 buff.write(struct.pack('<I%ss'%length, length, _x)) 00614 length = len(self.objects) 00615 buff.write(_struct_I.pack(length)) 00616 for val1 in self.objects: 00617 buff.write(_struct_i.pack(val1.objectid)) 00618 _v1 = val1.object 00619 _x = _v1.reference_frame_id 00620 length = len(_x) 00621 buff.write(struct.pack('<I%ss'%length, length, _x)) 00622 length = len(_v1.potential_models) 00623 buff.write(_struct_I.pack(length)) 00624 for val3 in _v1.potential_models: 00625 buff.write(_struct_i.pack(val3.model_id)) 00626 _v2 = val3.pose 00627 _v3 = _v2.header 00628 buff.write(_struct_I.pack(_v3.seq)) 00629 _v4 = _v3.stamp 00630 _x = _v4 00631 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00632 _x = _v3.frame_id 00633 length = len(_x) 00634 buff.write(struct.pack('<I%ss'%length, length, _x)) 00635 _v5 = _v2.pose 00636 _v6 = _v5.position 00637 _x = _v6 00638 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00639 _v7 = _v5.orientation 00640 _x = _v7 00641 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00642 buff.write(_struct_f.pack(val3.confidence)) 00643 _x = val3.detector_name 00644 length = len(_x) 00645 buff.write(struct.pack('<I%ss'%length, length, _x)) 00646 _v8 = _v1.cluster 00647 _v9 = _v8.header 00648 buff.write(_struct_I.pack(_v9.seq)) 00649 _v10 = _v9.stamp 00650 _x = _v10 00651 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00652 _x = _v9.frame_id 00653 length = len(_x) 00654 buff.write(struct.pack('<I%ss'%length, length, _x)) 00655 length = len(_v8.points) 00656 buff.write(_struct_I.pack(length)) 00657 for val4 in _v8.points: 00658 _x = val4 00659 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z)) 00660 length = len(_v8.channels) 00661 buff.write(_struct_I.pack(length)) 00662 for val4 in _v8.channels: 00663 _x = val4.name 00664 length = len(_x) 00665 buff.write(struct.pack('<I%ss'%length, length, _x)) 00666 length = len(val4.values) 00667 buff.write(_struct_I.pack(length)) 00668 pattern = '<%sf'%length 00669 buff.write(struct.pack(pattern, *val4.values)) 00670 _v11 = _v1.region 00671 _v12 = _v11.cloud 00672 _v13 = _v12.header 00673 buff.write(_struct_I.pack(_v13.seq)) 00674 _v14 = _v13.stamp 00675 _x = _v14 00676 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00677 _x = _v13.frame_id 00678 length = len(_x) 00679 buff.write(struct.pack('<I%ss'%length, length, _x)) 00680 _x = _v12 00681 buff.write(_struct_2I.pack(_x.height, _x.width)) 00682 length = len(_v12.fields) 00683 buff.write(_struct_I.pack(length)) 00684 for val5 in _v12.fields: 00685 _x = val5.name 00686 length = len(_x) 00687 buff.write(struct.pack('<I%ss'%length, length, _x)) 00688 _x = val5 00689 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00690 _x = _v12 00691 buff.write(_struct_B2I.pack(_x.is_bigendian, _x.point_step, _x.row_step)) 00692 _x = _v12.data 00693 length = len(_x) 00694 # - if encoded as a list instead, serialize as bytes instead of string 00695 if type(_x) in [list, tuple]: 00696 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00697 else: 00698 buff.write(struct.pack('<I%ss'%length, length, _x)) 00699 buff.write(_struct_B.pack(_v12.is_dense)) 00700 length = len(_v11.mask) 00701 buff.write(_struct_I.pack(length)) 00702 pattern = '<%si'%length 00703 buff.write(struct.pack(pattern, *_v11.mask)) 00704 _v15 = _v11.image 00705 _v16 = _v15.header 00706 buff.write(_struct_I.pack(_v16.seq)) 00707 _v17 = _v16.stamp 00708 _x = _v17 00709 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00710 _x = _v16.frame_id 00711 length = len(_x) 00712 buff.write(struct.pack('<I%ss'%length, length, _x)) 00713 _x = _v15 00714 buff.write(_struct_2I.pack(_x.height, _x.width)) 00715 _x = _v15.encoding 00716 length = len(_x) 00717 buff.write(struct.pack('<I%ss'%length, length, _x)) 00718 _x = _v15 00719 buff.write(_struct_BI.pack(_x.is_bigendian, _x.step)) 00720 _x = _v15.data 00721 length = len(_x) 00722 # - if encoded as a list instead, serialize as bytes instead of string 00723 if type(_x) in [list, tuple]: 00724 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00725 else: 00726 buff.write(struct.pack('<I%ss'%length, length, _x)) 00727 _v18 = _v11.disparity_image 00728 _v19 = _v18.header 00729 buff.write(_struct_I.pack(_v19.seq)) 00730 _v20 = _v19.stamp 00731 _x = _v20 00732 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00733 _x = _v19.frame_id 00734 length = len(_x) 00735 buff.write(struct.pack('<I%ss'%length, length, _x)) 00736 _x = _v18 00737 buff.write(_struct_2I.pack(_x.height, _x.width)) 00738 _x = _v18.encoding 00739 length = len(_x) 00740 buff.write(struct.pack('<I%ss'%length, length, _x)) 00741 _x = _v18 00742 buff.write(_struct_BI.pack(_x.is_bigendian, _x.step)) 00743 _x = _v18.data 00744 length = len(_x) 00745 # - if encoded as a list instead, serialize as bytes instead of string 00746 if type(_x) in [list, tuple]: 00747 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00748 else: 00749 buff.write(struct.pack('<I%ss'%length, length, _x)) 00750 _v21 = _v11.cam_info 00751 _v22 = _v21.header 00752 buff.write(_struct_I.pack(_v22.seq)) 00753 _v23 = _v22.stamp 00754 _x = _v23 00755 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00756 _x = _v22.frame_id 00757 length = len(_x) 00758 buff.write(struct.pack('<I%ss'%length, length, _x)) 00759 _x = _v21 00760 buff.write(_struct_2I.pack(_x.height, _x.width)) 00761 _x = _v21.distortion_model 00762 length = len(_x) 00763 buff.write(struct.pack('<I%ss'%length, length, _x)) 00764 length = len(_v21.D) 00765 buff.write(_struct_I.pack(length)) 00766 pattern = '<%sd'%length 00767 buff.write(struct.pack(pattern, *_v21.D)) 00768 buff.write(_struct_9d.pack(*_v21.K)) 00769 buff.write(_struct_9d.pack(*_v21.R)) 00770 buff.write(_struct_12d.pack(*_v21.P)) 00771 _x = _v21 00772 buff.write(_struct_2I.pack(_x.binning_x, _x.binning_y)) 00773 _v24 = _v21.roi 00774 _x = _v24 00775 buff.write(_struct_4IB.pack(_x.x_offset, _x.y_offset, _x.height, _x.width, _x.do_rectify)) 00776 _v25 = _v11.roi_box_pose 00777 _v26 = _v25.header 00778 buff.write(_struct_I.pack(_v26.seq)) 00779 _v27 = _v26.stamp 00780 _x = _v27 00781 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00782 _x = _v26.frame_id 00783 length = len(_x) 00784 buff.write(struct.pack('<I%ss'%length, length, _x)) 00785 _v28 = _v25.pose 00786 _v29 = _v28.position 00787 _x = _v29 00788 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00789 _v30 = _v28.orientation 00790 _x = _v30 00791 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00792 _v31 = _v11.roi_box_dims 00793 _x = _v31 00794 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00795 _x = _v1.collision_name 00796 length = len(_x) 00797 buff.write(struct.pack('<I%ss'%length, length, _x)) 00798 _v32 = val1.pose 00799 _v33 = _v32.header 00800 buff.write(_struct_I.pack(_v33.seq)) 00801 _v34 = _v33.stamp 00802 _x = _v34 00803 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00804 _x = _v33.frame_id 00805 length = len(_x) 00806 buff.write(struct.pack('<I%ss'%length, length, _x)) 00807 _v35 = _v32.pose 00808 _v36 = _v35.position 00809 _x = _v36 00810 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00811 _v37 = _v35.orientation 00812 _x = _v37 00813 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00814 length = len(val1.boundingbox) 00815 buff.write(_struct_I.pack(length)) 00816 pattern = '<%sd'%length 00817 buff.write(struct.pack(pattern, *val1.boundingbox)) 00818 except struct.error as se: self._check_types(se) 00819 except TypeError as te: self._check_types(te) 00820 00821 def deserialize(self, str): 00822 """ 00823 unpack serialized message in str into this message instance 00824 @param str: byte array of serialized message 00825 @type str: str 00826 """ 00827 try: 00828 end = 0 00829 start = end 00830 end += 4 00831 (length,) = _struct_I.unpack(str[start:end]) 00832 start = end 00833 end += length 00834 self.response = str[start:end] 00835 start = end 00836 end += 4 00837 (length,) = _struct_I.unpack(str[start:end]) 00838 self.objects = [] 00839 for i in range(0, length): 00840 val1 = pr2_pick_and_place_service.msg.PickPlaceObject() 00841 start = end 00842 end += 4 00843 (val1.objectid,) = _struct_i.unpack(str[start:end]) 00844 _v38 = val1.object 00845 start = end 00846 end += 4 00847 (length,) = _struct_I.unpack(str[start:end]) 00848 start = end 00849 end += length 00850 _v38.reference_frame_id = str[start:end] 00851 start = end 00852 end += 4 00853 (length,) = _struct_I.unpack(str[start:end]) 00854 _v38.potential_models = [] 00855 for i in range(0, length): 00856 val3 = household_objects_database_msgs.msg.DatabaseModelPose() 00857 start = end 00858 end += 4 00859 (val3.model_id,) = _struct_i.unpack(str[start:end]) 00860 _v39 = val3.pose 00861 _v40 = _v39.header 00862 start = end 00863 end += 4 00864 (_v40.seq,) = _struct_I.unpack(str[start:end]) 00865 _v41 = _v40.stamp 00866 _x = _v41 00867 start = end 00868 end += 8 00869 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00870 start = end 00871 end += 4 00872 (length,) = _struct_I.unpack(str[start:end]) 00873 start = end 00874 end += length 00875 _v40.frame_id = str[start:end] 00876 _v42 = _v39.pose 00877 _v43 = _v42.position 00878 _x = _v43 00879 start = end 00880 end += 24 00881 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00882 _v44 = _v42.orientation 00883 _x = _v44 00884 start = end 00885 end += 32 00886 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00887 start = end 00888 end += 4 00889 (val3.confidence,) = _struct_f.unpack(str[start:end]) 00890 start = end 00891 end += 4 00892 (length,) = _struct_I.unpack(str[start:end]) 00893 start = end 00894 end += length 00895 val3.detector_name = str[start:end] 00896 _v38.potential_models.append(val3) 00897 _v45 = _v38.cluster 00898 _v46 = _v45.header 00899 start = end 00900 end += 4 00901 (_v46.seq,) = _struct_I.unpack(str[start:end]) 00902 _v47 = _v46.stamp 00903 _x = _v47 00904 start = end 00905 end += 8 00906 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00907 start = end 00908 end += 4 00909 (length,) = _struct_I.unpack(str[start:end]) 00910 start = end 00911 end += length 00912 _v46.frame_id = str[start:end] 00913 start = end 00914 end += 4 00915 (length,) = _struct_I.unpack(str[start:end]) 00916 _v45.points = [] 00917 for i in range(0, length): 00918 val4 = geometry_msgs.msg.Point32() 00919 _x = val4 00920 start = end 00921 end += 12 00922 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end]) 00923 _v45.points.append(val4) 00924 start = end 00925 end += 4 00926 (length,) = _struct_I.unpack(str[start:end]) 00927 _v45.channels = [] 00928 for i in range(0, length): 00929 val4 = sensor_msgs.msg.ChannelFloat32() 00930 start = end 00931 end += 4 00932 (length,) = _struct_I.unpack(str[start:end]) 00933 start = end 00934 end += length 00935 val4.name = str[start:end] 00936 start = end 00937 end += 4 00938 (length,) = _struct_I.unpack(str[start:end]) 00939 pattern = '<%sf'%length 00940 start = end 00941 end += struct.calcsize(pattern) 00942 val4.values = struct.unpack(pattern, str[start:end]) 00943 _v45.channels.append(val4) 00944 _v48 = _v38.region 00945 _v49 = _v48.cloud 00946 _v50 = _v49.header 00947 start = end 00948 end += 4 00949 (_v50.seq,) = _struct_I.unpack(str[start:end]) 00950 _v51 = _v50.stamp 00951 _x = _v51 00952 start = end 00953 end += 8 00954 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00955 start = end 00956 end += 4 00957 (length,) = _struct_I.unpack(str[start:end]) 00958 start = end 00959 end += length 00960 _v50.frame_id = str[start:end] 00961 _x = _v49 00962 start = end 00963 end += 8 00964 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 00965 start = end 00966 end += 4 00967 (length,) = _struct_I.unpack(str[start:end]) 00968 _v49.fields = [] 00969 for i in range(0, length): 00970 val5 = sensor_msgs.msg.PointField() 00971 start = end 00972 end += 4 00973 (length,) = _struct_I.unpack(str[start:end]) 00974 start = end 00975 end += length 00976 val5.name = str[start:end] 00977 _x = val5 00978 start = end 00979 end += 9 00980 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00981 _v49.fields.append(val5) 00982 _x = _v49 00983 start = end 00984 end += 9 00985 (_x.is_bigendian, _x.point_step, _x.row_step,) = _struct_B2I.unpack(str[start:end]) 00986 _v49.is_bigendian = bool(_v49.is_bigendian) 00987 start = end 00988 end += 4 00989 (length,) = _struct_I.unpack(str[start:end]) 00990 start = end 00991 end += length 00992 _v49.data = str[start:end] 00993 start = end 00994 end += 1 00995 (_v49.is_dense,) = _struct_B.unpack(str[start:end]) 00996 _v49.is_dense = bool(_v49.is_dense) 00997 start = end 00998 end += 4 00999 (length,) = _struct_I.unpack(str[start:end]) 01000 pattern = '<%si'%length 01001 start = end 01002 end += struct.calcsize(pattern) 01003 _v48.mask = struct.unpack(pattern, str[start:end]) 01004 _v52 = _v48.image 01005 _v53 = _v52.header 01006 start = end 01007 end += 4 01008 (_v53.seq,) = _struct_I.unpack(str[start:end]) 01009 _v54 = _v53.stamp 01010 _x = _v54 01011 start = end 01012 end += 8 01013 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 01014 start = end 01015 end += 4 01016 (length,) = _struct_I.unpack(str[start:end]) 01017 start = end 01018 end += length 01019 _v53.frame_id = str[start:end] 01020 _x = _v52 01021 start = end 01022 end += 8 01023 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 01024 start = end 01025 end += 4 01026 (length,) = _struct_I.unpack(str[start:end]) 01027 start = end 01028 end += length 01029 _v52.encoding = str[start:end] 01030 _x = _v52 01031 start = end 01032 end += 5 01033 (_x.is_bigendian, _x.step,) = _struct_BI.unpack(str[start:end]) 01034 start = end 01035 end += 4 01036 (length,) = _struct_I.unpack(str[start:end]) 01037 start = end 01038 end += length 01039 _v52.data = str[start:end] 01040 _v55 = _v48.disparity_image 01041 _v56 = _v55.header 01042 start = end 01043 end += 4 01044 (_v56.seq,) = _struct_I.unpack(str[start:end]) 01045 _v57 = _v56.stamp 01046 _x = _v57 01047 start = end 01048 end += 8 01049 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 01050 start = end 01051 end += 4 01052 (length,) = _struct_I.unpack(str[start:end]) 01053 start = end 01054 end += length 01055 _v56.frame_id = str[start:end] 01056 _x = _v55 01057 start = end 01058 end += 8 01059 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 01060 start = end 01061 end += 4 01062 (length,) = _struct_I.unpack(str[start:end]) 01063 start = end 01064 end += length 01065 _v55.encoding = str[start:end] 01066 _x = _v55 01067 start = end 01068 end += 5 01069 (_x.is_bigendian, _x.step,) = _struct_BI.unpack(str[start:end]) 01070 start = end 01071 end += 4 01072 (length,) = _struct_I.unpack(str[start:end]) 01073 start = end 01074 end += length 01075 _v55.data = str[start:end] 01076 _v58 = _v48.cam_info 01077 _v59 = _v58.header 01078 start = end 01079 end += 4 01080 (_v59.seq,) = _struct_I.unpack(str[start:end]) 01081 _v60 = _v59.stamp 01082 _x = _v60 01083 start = end 01084 end += 8 01085 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 01086 start = end 01087 end += 4 01088 (length,) = _struct_I.unpack(str[start:end]) 01089 start = end 01090 end += length 01091 _v59.frame_id = str[start:end] 01092 _x = _v58 01093 start = end 01094 end += 8 01095 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 01096 start = end 01097 end += 4 01098 (length,) = _struct_I.unpack(str[start:end]) 01099 start = end 01100 end += length 01101 _v58.distortion_model = str[start:end] 01102 start = end 01103 end += 4 01104 (length,) = _struct_I.unpack(str[start:end]) 01105 pattern = '<%sd'%length 01106 start = end 01107 end += struct.calcsize(pattern) 01108 _v58.D = struct.unpack(pattern, str[start:end]) 01109 start = end 01110 end += 72 01111 _v58.K = _struct_9d.unpack(str[start:end]) 01112 start = end 01113 end += 72 01114 _v58.R = _struct_9d.unpack(str[start:end]) 01115 start = end 01116 end += 96 01117 _v58.P = _struct_12d.unpack(str[start:end]) 01118 _x = _v58 01119 start = end 01120 end += 8 01121 (_x.binning_x, _x.binning_y,) = _struct_2I.unpack(str[start:end]) 01122 _v61 = _v58.roi 01123 _x = _v61 01124 start = end 01125 end += 17 01126 (_x.x_offset, _x.y_offset, _x.height, _x.width, _x.do_rectify,) = _struct_4IB.unpack(str[start:end]) 01127 _v61.do_rectify = bool(_v61.do_rectify) 01128 _v62 = _v48.roi_box_pose 01129 _v63 = _v62.header 01130 start = end 01131 end += 4 01132 (_v63.seq,) = _struct_I.unpack(str[start:end]) 01133 _v64 = _v63.stamp 01134 _x = _v64 01135 start = end 01136 end += 8 01137 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 01138 start = end 01139 end += 4 01140 (length,) = _struct_I.unpack(str[start:end]) 01141 start = end 01142 end += length 01143 _v63.frame_id = str[start:end] 01144 _v65 = _v62.pose 01145 _v66 = _v65.position 01146 _x = _v66 01147 start = end 01148 end += 24 01149 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 01150 _v67 = _v65.orientation 01151 _x = _v67 01152 start = end 01153 end += 32 01154 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 01155 _v68 = _v48.roi_box_dims 01156 _x = _v68 01157 start = end 01158 end += 24 01159 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 01160 start = end 01161 end += 4 01162 (length,) = _struct_I.unpack(str[start:end]) 01163 start = end 01164 end += length 01165 _v38.collision_name = str[start:end] 01166 _v69 = val1.pose 01167 _v70 = _v69.header 01168 start = end 01169 end += 4 01170 (_v70.seq,) = _struct_I.unpack(str[start:end]) 01171 _v71 = _v70.stamp 01172 _x = _v71 01173 start = end 01174 end += 8 01175 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 01176 start = end 01177 end += 4 01178 (length,) = _struct_I.unpack(str[start:end]) 01179 start = end 01180 end += length 01181 _v70.frame_id = str[start:end] 01182 _v72 = _v69.pose 01183 _v73 = _v72.position 01184 _x = _v73 01185 start = end 01186 end += 24 01187 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 01188 _v74 = _v72.orientation 01189 _x = _v74 01190 start = end 01191 end += 32 01192 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 01193 start = end 01194 end += 4 01195 (length,) = _struct_I.unpack(str[start:end]) 01196 pattern = '<%sd'%length 01197 start = end 01198 end += struct.calcsize(pattern) 01199 val1.boundingbox = struct.unpack(pattern, str[start:end]) 01200 self.objects.append(val1) 01201 return self 01202 except struct.error as e: 01203 raise roslib.message.DeserializationError(e) #most likely buffer underfill 01204 01205 01206 def serialize_numpy(self, buff, numpy): 01207 """ 01208 serialize message with numpy array types into buffer 01209 @param buff: buffer 01210 @type buff: StringIO 01211 @param numpy: numpy python module 01212 @type numpy module 01213 """ 01214 try: 01215 _x = self.response 01216 length = len(_x) 01217 buff.write(struct.pack('<I%ss'%length, length, _x)) 01218 length = len(self.objects) 01219 buff.write(_struct_I.pack(length)) 01220 for val1 in self.objects: 01221 buff.write(_struct_i.pack(val1.objectid)) 01222 _v75 = val1.object 01223 _x = _v75.reference_frame_id 01224 length = len(_x) 01225 buff.write(struct.pack('<I%ss'%length, length, _x)) 01226 length = len(_v75.potential_models) 01227 buff.write(_struct_I.pack(length)) 01228 for val3 in _v75.potential_models: 01229 buff.write(_struct_i.pack(val3.model_id)) 01230 _v76 = val3.pose 01231 _v77 = _v76.header 01232 buff.write(_struct_I.pack(_v77.seq)) 01233 _v78 = _v77.stamp 01234 _x = _v78 01235 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 01236 _x = _v77.frame_id 01237 length = len(_x) 01238 buff.write(struct.pack('<I%ss'%length, length, _x)) 01239 _v79 = _v76.pose 01240 _v80 = _v79.position 01241 _x = _v80 01242 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 01243 _v81 = _v79.orientation 01244 _x = _v81 01245 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 01246 buff.write(_struct_f.pack(val3.confidence)) 01247 _x = val3.detector_name 01248 length = len(_x) 01249 buff.write(struct.pack('<I%ss'%length, length, _x)) 01250 _v82 = _v75.cluster 01251 _v83 = _v82.header 01252 buff.write(_struct_I.pack(_v83.seq)) 01253 _v84 = _v83.stamp 01254 _x = _v84 01255 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 01256 _x = _v83.frame_id 01257 length = len(_x) 01258 buff.write(struct.pack('<I%ss'%length, length, _x)) 01259 length = len(_v82.points) 01260 buff.write(_struct_I.pack(length)) 01261 for val4 in _v82.points: 01262 _x = val4 01263 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z)) 01264 length = len(_v82.channels) 01265 buff.write(_struct_I.pack(length)) 01266 for val4 in _v82.channels: 01267 _x = val4.name 01268 length = len(_x) 01269 buff.write(struct.pack('<I%ss'%length, length, _x)) 01270 length = len(val4.values) 01271 buff.write(_struct_I.pack(length)) 01272 pattern = '<%sf'%length 01273 buff.write(val4.values.tostring()) 01274 _v85 = _v75.region 01275 _v86 = _v85.cloud 01276 _v87 = _v86.header 01277 buff.write(_struct_I.pack(_v87.seq)) 01278 _v88 = _v87.stamp 01279 _x = _v88 01280 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 01281 _x = _v87.frame_id 01282 length = len(_x) 01283 buff.write(struct.pack('<I%ss'%length, length, _x)) 01284 _x = _v86 01285 buff.write(_struct_2I.pack(_x.height, _x.width)) 01286 length = len(_v86.fields) 01287 buff.write(_struct_I.pack(length)) 01288 for val5 in _v86.fields: 01289 _x = val5.name 01290 length = len(_x) 01291 buff.write(struct.pack('<I%ss'%length, length, _x)) 01292 _x = val5 01293 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 01294 _x = _v86 01295 buff.write(_struct_B2I.pack(_x.is_bigendian, _x.point_step, _x.row_step)) 01296 _x = _v86.data 01297 length = len(_x) 01298 # - if encoded as a list instead, serialize as bytes instead of string 01299 if type(_x) in [list, tuple]: 01300 buff.write(struct.pack('<I%sB'%length, length, *_x)) 01301 else: 01302 buff.write(struct.pack('<I%ss'%length, length, _x)) 01303 buff.write(_struct_B.pack(_v86.is_dense)) 01304 length = len(_v85.mask) 01305 buff.write(_struct_I.pack(length)) 01306 pattern = '<%si'%length 01307 buff.write(_v85.mask.tostring()) 01308 _v89 = _v85.image 01309 _v90 = _v89.header 01310 buff.write(_struct_I.pack(_v90.seq)) 01311 _v91 = _v90.stamp 01312 _x = _v91 01313 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 01314 _x = _v90.frame_id 01315 length = len(_x) 01316 buff.write(struct.pack('<I%ss'%length, length, _x)) 01317 _x = _v89 01318 buff.write(_struct_2I.pack(_x.height, _x.width)) 01319 _x = _v89.encoding 01320 length = len(_x) 01321 buff.write(struct.pack('<I%ss'%length, length, _x)) 01322 _x = _v89 01323 buff.write(_struct_BI.pack(_x.is_bigendian, _x.step)) 01324 _x = _v89.data 01325 length = len(_x) 01326 # - if encoded as a list instead, serialize as bytes instead of string 01327 if type(_x) in [list, tuple]: 01328 buff.write(struct.pack('<I%sB'%length, length, *_x)) 01329 else: 01330 buff.write(struct.pack('<I%ss'%length, length, _x)) 01331 _v92 = _v85.disparity_image 01332 _v93 = _v92.header 01333 buff.write(_struct_I.pack(_v93.seq)) 01334 _v94 = _v93.stamp 01335 _x = _v94 01336 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 01337 _x = _v93.frame_id 01338 length = len(_x) 01339 buff.write(struct.pack('<I%ss'%length, length, _x)) 01340 _x = _v92 01341 buff.write(_struct_2I.pack(_x.height, _x.width)) 01342 _x = _v92.encoding 01343 length = len(_x) 01344 buff.write(struct.pack('<I%ss'%length, length, _x)) 01345 _x = _v92 01346 buff.write(_struct_BI.pack(_x.is_bigendian, _x.step)) 01347 _x = _v92.data 01348 length = len(_x) 01349 # - if encoded as a list instead, serialize as bytes instead of string 01350 if type(_x) in [list, tuple]: 01351 buff.write(struct.pack('<I%sB'%length, length, *_x)) 01352 else: 01353 buff.write(struct.pack('<I%ss'%length, length, _x)) 01354 _v95 = _v85.cam_info 01355 _v96 = _v95.header 01356 buff.write(_struct_I.pack(_v96.seq)) 01357 _v97 = _v96.stamp 01358 _x = _v97 01359 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 01360 _x = _v96.frame_id 01361 length = len(_x) 01362 buff.write(struct.pack('<I%ss'%length, length, _x)) 01363 _x = _v95 01364 buff.write(_struct_2I.pack(_x.height, _x.width)) 01365 _x = _v95.distortion_model 01366 length = len(_x) 01367 buff.write(struct.pack('<I%ss'%length, length, _x)) 01368 length = len(_v95.D) 01369 buff.write(_struct_I.pack(length)) 01370 pattern = '<%sd'%length 01371 buff.write(_v95.D.tostring()) 01372 buff.write(_v95.K.tostring()) 01373 buff.write(_v95.R.tostring()) 01374 buff.write(_v95.P.tostring()) 01375 _x = _v95 01376 buff.write(_struct_2I.pack(_x.binning_x, _x.binning_y)) 01377 _v98 = _v95.roi 01378 _x = _v98 01379 buff.write(_struct_4IB.pack(_x.x_offset, _x.y_offset, _x.height, _x.width, _x.do_rectify)) 01380 _v99 = _v85.roi_box_pose 01381 _v100 = _v99.header 01382 buff.write(_struct_I.pack(_v100.seq)) 01383 _v101 = _v100.stamp 01384 _x = _v101 01385 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 01386 _x = _v100.frame_id 01387 length = len(_x) 01388 buff.write(struct.pack('<I%ss'%length, length, _x)) 01389 _v102 = _v99.pose 01390 _v103 = _v102.position 01391 _x = _v103 01392 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 01393 _v104 = _v102.orientation 01394 _x = _v104 01395 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 01396 _v105 = _v85.roi_box_dims 01397 _x = _v105 01398 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 01399 _x = _v75.collision_name 01400 length = len(_x) 01401 buff.write(struct.pack('<I%ss'%length, length, _x)) 01402 _v106 = val1.pose 01403 _v107 = _v106.header 01404 buff.write(_struct_I.pack(_v107.seq)) 01405 _v108 = _v107.stamp 01406 _x = _v108 01407 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 01408 _x = _v107.frame_id 01409 length = len(_x) 01410 buff.write(struct.pack('<I%ss'%length, length, _x)) 01411 _v109 = _v106.pose 01412 _v110 = _v109.position 01413 _x = _v110 01414 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 01415 _v111 = _v109.orientation 01416 _x = _v111 01417 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 01418 length = len(val1.boundingbox) 01419 buff.write(_struct_I.pack(length)) 01420 pattern = '<%sd'%length 01421 buff.write(val1.boundingbox.tostring()) 01422 except struct.error as se: self._check_types(se) 01423 except TypeError as te: self._check_types(te) 01424 01425 def deserialize_numpy(self, str, numpy): 01426 """ 01427 unpack serialized message in str into this message instance using numpy for array types 01428 @param str: byte array of serialized message 01429 @type str: str 01430 @param numpy: numpy python module 01431 @type numpy: module 01432 """ 01433 try: 01434 end = 0 01435 start = end 01436 end += 4 01437 (length,) = _struct_I.unpack(str[start:end]) 01438 start = end 01439 end += length 01440 self.response = str[start:end] 01441 start = end 01442 end += 4 01443 (length,) = _struct_I.unpack(str[start:end]) 01444 self.objects = [] 01445 for i in range(0, length): 01446 val1 = pr2_pick_and_place_service.msg.PickPlaceObject() 01447 start = end 01448 end += 4 01449 (val1.objectid,) = _struct_i.unpack(str[start:end]) 01450 _v112 = val1.object 01451 start = end 01452 end += 4 01453 (length,) = _struct_I.unpack(str[start:end]) 01454 start = end 01455 end += length 01456 _v112.reference_frame_id = str[start:end] 01457 start = end 01458 end += 4 01459 (length,) = _struct_I.unpack(str[start:end]) 01460 _v112.potential_models = [] 01461 for i in range(0, length): 01462 val3 = household_objects_database_msgs.msg.DatabaseModelPose() 01463 start = end 01464 end += 4 01465 (val3.model_id,) = _struct_i.unpack(str[start:end]) 01466 _v113 = val3.pose 01467 _v114 = _v113.header 01468 start = end 01469 end += 4 01470 (_v114.seq,) = _struct_I.unpack(str[start:end]) 01471 _v115 = _v114.stamp 01472 _x = _v115 01473 start = end 01474 end += 8 01475 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 01476 start = end 01477 end += 4 01478 (length,) = _struct_I.unpack(str[start:end]) 01479 start = end 01480 end += length 01481 _v114.frame_id = str[start:end] 01482 _v116 = _v113.pose 01483 _v117 = _v116.position 01484 _x = _v117 01485 start = end 01486 end += 24 01487 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 01488 _v118 = _v116.orientation 01489 _x = _v118 01490 start = end 01491 end += 32 01492 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 01493 start = end 01494 end += 4 01495 (val3.confidence,) = _struct_f.unpack(str[start:end]) 01496 start = end 01497 end += 4 01498 (length,) = _struct_I.unpack(str[start:end]) 01499 start = end 01500 end += length 01501 val3.detector_name = str[start:end] 01502 _v112.potential_models.append(val3) 01503 _v119 = _v112.cluster 01504 _v120 = _v119.header 01505 start = end 01506 end += 4 01507 (_v120.seq,) = _struct_I.unpack(str[start:end]) 01508 _v121 = _v120.stamp 01509 _x = _v121 01510 start = end 01511 end += 8 01512 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 01513 start = end 01514 end += 4 01515 (length,) = _struct_I.unpack(str[start:end]) 01516 start = end 01517 end += length 01518 _v120.frame_id = str[start:end] 01519 start = end 01520 end += 4 01521 (length,) = _struct_I.unpack(str[start:end]) 01522 _v119.points = [] 01523 for i in range(0, length): 01524 val4 = geometry_msgs.msg.Point32() 01525 _x = val4 01526 start = end 01527 end += 12 01528 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end]) 01529 _v119.points.append(val4) 01530 start = end 01531 end += 4 01532 (length,) = _struct_I.unpack(str[start:end]) 01533 _v119.channels = [] 01534 for i in range(0, length): 01535 val4 = sensor_msgs.msg.ChannelFloat32() 01536 start = end 01537 end += 4 01538 (length,) = _struct_I.unpack(str[start:end]) 01539 start = end 01540 end += length 01541 val4.name = str[start:end] 01542 start = end 01543 end += 4 01544 (length,) = _struct_I.unpack(str[start:end]) 01545 pattern = '<%sf'%length 01546 start = end 01547 end += struct.calcsize(pattern) 01548 val4.values = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 01549 _v119.channels.append(val4) 01550 _v122 = _v112.region 01551 _v123 = _v122.cloud 01552 _v124 = _v123.header 01553 start = end 01554 end += 4 01555 (_v124.seq,) = _struct_I.unpack(str[start:end]) 01556 _v125 = _v124.stamp 01557 _x = _v125 01558 start = end 01559 end += 8 01560 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 01561 start = end 01562 end += 4 01563 (length,) = _struct_I.unpack(str[start:end]) 01564 start = end 01565 end += length 01566 _v124.frame_id = str[start:end] 01567 _x = _v123 01568 start = end 01569 end += 8 01570 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 01571 start = end 01572 end += 4 01573 (length,) = _struct_I.unpack(str[start:end]) 01574 _v123.fields = [] 01575 for i in range(0, length): 01576 val5 = sensor_msgs.msg.PointField() 01577 start = end 01578 end += 4 01579 (length,) = _struct_I.unpack(str[start:end]) 01580 start = end 01581 end += length 01582 val5.name = str[start:end] 01583 _x = val5 01584 start = end 01585 end += 9 01586 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 01587 _v123.fields.append(val5) 01588 _x = _v123 01589 start = end 01590 end += 9 01591 (_x.is_bigendian, _x.point_step, _x.row_step,) = _struct_B2I.unpack(str[start:end]) 01592 _v123.is_bigendian = bool(_v123.is_bigendian) 01593 start = end 01594 end += 4 01595 (length,) = _struct_I.unpack(str[start:end]) 01596 start = end 01597 end += length 01598 _v123.data = str[start:end] 01599 start = end 01600 end += 1 01601 (_v123.is_dense,) = _struct_B.unpack(str[start:end]) 01602 _v123.is_dense = bool(_v123.is_dense) 01603 start = end 01604 end += 4 01605 (length,) = _struct_I.unpack(str[start:end]) 01606 pattern = '<%si'%length 01607 start = end 01608 end += struct.calcsize(pattern) 01609 _v122.mask = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length) 01610 _v126 = _v122.image 01611 _v127 = _v126.header 01612 start = end 01613 end += 4 01614 (_v127.seq,) = _struct_I.unpack(str[start:end]) 01615 _v128 = _v127.stamp 01616 _x = _v128 01617 start = end 01618 end += 8 01619 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 01620 start = end 01621 end += 4 01622 (length,) = _struct_I.unpack(str[start:end]) 01623 start = end 01624 end += length 01625 _v127.frame_id = str[start:end] 01626 _x = _v126 01627 start = end 01628 end += 8 01629 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 01630 start = end 01631 end += 4 01632 (length,) = _struct_I.unpack(str[start:end]) 01633 start = end 01634 end += length 01635 _v126.encoding = str[start:end] 01636 _x = _v126 01637 start = end 01638 end += 5 01639 (_x.is_bigendian, _x.step,) = _struct_BI.unpack(str[start:end]) 01640 start = end 01641 end += 4 01642 (length,) = _struct_I.unpack(str[start:end]) 01643 start = end 01644 end += length 01645 _v126.data = str[start:end] 01646 _v129 = _v122.disparity_image 01647 _v130 = _v129.header 01648 start = end 01649 end += 4 01650 (_v130.seq,) = _struct_I.unpack(str[start:end]) 01651 _v131 = _v130.stamp 01652 _x = _v131 01653 start = end 01654 end += 8 01655 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 01656 start = end 01657 end += 4 01658 (length,) = _struct_I.unpack(str[start:end]) 01659 start = end 01660 end += length 01661 _v130.frame_id = str[start:end] 01662 _x = _v129 01663 start = end 01664 end += 8 01665 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 01666 start = end 01667 end += 4 01668 (length,) = _struct_I.unpack(str[start:end]) 01669 start = end 01670 end += length 01671 _v129.encoding = str[start:end] 01672 _x = _v129 01673 start = end 01674 end += 5 01675 (_x.is_bigendian, _x.step,) = _struct_BI.unpack(str[start:end]) 01676 start = end 01677 end += 4 01678 (length,) = _struct_I.unpack(str[start:end]) 01679 start = end 01680 end += length 01681 _v129.data = str[start:end] 01682 _v132 = _v122.cam_info 01683 _v133 = _v132.header 01684 start = end 01685 end += 4 01686 (_v133.seq,) = _struct_I.unpack(str[start:end]) 01687 _v134 = _v133.stamp 01688 _x = _v134 01689 start = end 01690 end += 8 01691 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 01692 start = end 01693 end += 4 01694 (length,) = _struct_I.unpack(str[start:end]) 01695 start = end 01696 end += length 01697 _v133.frame_id = str[start:end] 01698 _x = _v132 01699 start = end 01700 end += 8 01701 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 01702 start = end 01703 end += 4 01704 (length,) = _struct_I.unpack(str[start:end]) 01705 start = end 01706 end += length 01707 _v132.distortion_model = str[start:end] 01708 start = end 01709 end += 4 01710 (length,) = _struct_I.unpack(str[start:end]) 01711 pattern = '<%sd'%length 01712 start = end 01713 end += struct.calcsize(pattern) 01714 _v132.D = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 01715 start = end 01716 end += 72 01717 _v132.K = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9) 01718 start = end 01719 end += 72 01720 _v132.R = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9) 01721 start = end 01722 end += 96 01723 _v132.P = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=12) 01724 _x = _v132 01725 start = end 01726 end += 8 01727 (_x.binning_x, _x.binning_y,) = _struct_2I.unpack(str[start:end]) 01728 _v135 = _v132.roi 01729 _x = _v135 01730 start = end 01731 end += 17 01732 (_x.x_offset, _x.y_offset, _x.height, _x.width, _x.do_rectify,) = _struct_4IB.unpack(str[start:end]) 01733 _v135.do_rectify = bool(_v135.do_rectify) 01734 _v136 = _v122.roi_box_pose 01735 _v137 = _v136.header 01736 start = end 01737 end += 4 01738 (_v137.seq,) = _struct_I.unpack(str[start:end]) 01739 _v138 = _v137.stamp 01740 _x = _v138 01741 start = end 01742 end += 8 01743 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 01744 start = end 01745 end += 4 01746 (length,) = _struct_I.unpack(str[start:end]) 01747 start = end 01748 end += length 01749 _v137.frame_id = str[start:end] 01750 _v139 = _v136.pose 01751 _v140 = _v139.position 01752 _x = _v140 01753 start = end 01754 end += 24 01755 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 01756 _v141 = _v139.orientation 01757 _x = _v141 01758 start = end 01759 end += 32 01760 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 01761 _v142 = _v122.roi_box_dims 01762 _x = _v142 01763 start = end 01764 end += 24 01765 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 01766 start = end 01767 end += 4 01768 (length,) = _struct_I.unpack(str[start:end]) 01769 start = end 01770 end += length 01771 _v112.collision_name = str[start:end] 01772 _v143 = val1.pose 01773 _v144 = _v143.header 01774 start = end 01775 end += 4 01776 (_v144.seq,) = _struct_I.unpack(str[start:end]) 01777 _v145 = _v144.stamp 01778 _x = _v145 01779 start = end 01780 end += 8 01781 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 01782 start = end 01783 end += 4 01784 (length,) = _struct_I.unpack(str[start:end]) 01785 start = end 01786 end += length 01787 _v144.frame_id = str[start:end] 01788 _v146 = _v143.pose 01789 _v147 = _v146.position 01790 _x = _v147 01791 start = end 01792 end += 24 01793 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 01794 _v148 = _v146.orientation 01795 _x = _v148 01796 start = end 01797 end += 32 01798 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 01799 start = end 01800 end += 4 01801 (length,) = _struct_I.unpack(str[start:end]) 01802 pattern = '<%sd'%length 01803 start = end 01804 end += struct.calcsize(pattern) 01805 val1.boundingbox = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 01806 self.objects.append(val1) 01807 return self 01808 except struct.error as e: 01809 raise roslib.message.DeserializationError(e) #most likely buffer underfill 01810 01811 _struct_I = roslib.message.struct_I 01812 _struct_IBI = struct.Struct("<IBI") 01813 _struct_B = struct.Struct("<B") 01814 _struct_12d = struct.Struct("<12d") 01815 _struct_f = struct.Struct("<f") 01816 _struct_i = struct.Struct("<i") 01817 _struct_BI = struct.Struct("<BI") 01818 _struct_3f = struct.Struct("<3f") 01819 _struct_9d = struct.Struct("<9d") 01820 _struct_B2I = struct.Struct("<B2I") 01821 _struct_4d = struct.Struct("<4d") 01822 _struct_2I = struct.Struct("<2I") 01823 _struct_4IB = struct.Struct("<4IB") 01824 _struct_3d = struct.Struct("<3d") 01825 class PickPlace(roslib.message.ServiceDefinition): 01826 _type = 'pr2_pick_and_place_service/PickPlace' 01827 _md5sum = 'ed796eaf203a95fd847bb7dfd92ee619' 01828 _request_class = PickPlaceRequest 01829 _response_class = PickPlaceResponse