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