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