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