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