00001 """autogenerated by genpy from interactive_perception_msgs/ObjectSegmentationGuiGoal.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 stereo_msgs.msg
00008 import std_msgs.msg
00009 import sensor_msgs.msg
00010
00011 class ObjectSegmentationGuiGoal(genpy.Message):
00012 _md5sum = "e1d5b6113ada0dd63b3fd30b2ac9f913"
00013 _type = "interactive_perception_msgs/ObjectSegmentationGuiGoal"
00014 _has_header = False
00015 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00016 sensor_msgs/Image image
00017 sensor_msgs/CameraInfo camera_info
00018 sensor_msgs/Image wide_field
00019 sensor_msgs/CameraInfo wide_camera_info
00020
00021 sensor_msgs/PointCloud2 point_cloud
00022 stereo_msgs/DisparityImage disparity_image
00023
00024
00025 ================================================================================
00026 MSG: sensor_msgs/Image
00027 # This message contains an uncompressed image
00028 # (0, 0) is at top-left corner of image
00029 #
00030
00031 Header header # Header timestamp should be acquisition time of image
00032 # Header frame_id should be optical frame of camera
00033 # origin of frame should be optical center of cameara
00034 # +x should point to the right in the image
00035 # +y should point down in the image
00036 # +z should point into to plane of the image
00037 # If the frame_id here and the frame_id of the CameraInfo
00038 # message associated with the image conflict
00039 # the behavior is undefined
00040
00041 uint32 height # image height, that is, number of rows
00042 uint32 width # image width, that is, number of columns
00043
00044 # The legal values for encoding are in file src/image_encodings.cpp
00045 # If you want to standardize a new string format, join
00046 # ros-users@lists.sourceforge.net and send an email proposing a new encoding.
00047
00048 string encoding # Encoding of pixels -- channel meaning, ordering, size
00049 # taken from the list of strings in include/sensor_msgs/image_encodings.h
00050
00051 uint8 is_bigendian # is this data bigendian?
00052 uint32 step # Full row length in bytes
00053 uint8[] data # actual matrix data, size is (step * rows)
00054
00055 ================================================================================
00056 MSG: std_msgs/Header
00057 # Standard metadata for higher-level stamped data types.
00058 # This is generally used to communicate timestamped data
00059 # in a particular coordinate frame.
00060 #
00061 # sequence ID: consecutively increasing ID
00062 uint32 seq
00063 #Two-integer timestamp that is expressed as:
00064 # * stamp.secs: seconds (stamp_secs) since epoch
00065 # * stamp.nsecs: nanoseconds since stamp_secs
00066 # time-handling sugar is provided by the client library
00067 time stamp
00068 #Frame this data is associated with
00069 # 0: no frame
00070 # 1: global frame
00071 string frame_id
00072
00073 ================================================================================
00074 MSG: sensor_msgs/CameraInfo
00075 # This message defines meta information for a camera. It should be in a
00076 # camera namespace on topic "camera_info" and accompanied by up to five
00077 # image topics named:
00078 #
00079 # image_raw - raw data from the camera driver, possibly Bayer encoded
00080 # image - monochrome, distorted
00081 # image_color - color, distorted
00082 # image_rect - monochrome, rectified
00083 # image_rect_color - color, rectified
00084 #
00085 # The image_pipeline contains packages (image_proc, stereo_image_proc)
00086 # for producing the four processed image topics from image_raw and
00087 # camera_info. The meaning of the camera parameters are described in
00088 # detail at http://www.ros.org/wiki/image_pipeline/CameraInfo.
00089 #
00090 # The image_geometry package provides a user-friendly interface to
00091 # common operations using this meta information. If you want to, e.g.,
00092 # project a 3d point into image coordinates, we strongly recommend
00093 # using image_geometry.
00094 #
00095 # If the camera is uncalibrated, the matrices D, K, R, P should be left
00096 # zeroed out. In particular, clients may assume that K[0] == 0.0
00097 # indicates an uncalibrated camera.
00098
00099 #######################################################################
00100 # Image acquisition info #
00101 #######################################################################
00102
00103 # Time of image acquisition, camera coordinate frame ID
00104 Header header # Header timestamp should be acquisition time of image
00105 # Header frame_id should be optical frame of camera
00106 # origin of frame should be optical center of camera
00107 # +x should point to the right in the image
00108 # +y should point down in the image
00109 # +z should point into the plane of the image
00110
00111
00112 #######################################################################
00113 # Calibration Parameters #
00114 #######################################################################
00115 # These are fixed during camera calibration. Their values will be the #
00116 # same in all messages until the camera is recalibrated. Note that #
00117 # self-calibrating systems may "recalibrate" frequently. #
00118 # #
00119 # The internal parameters can be used to warp a raw (distorted) image #
00120 # to: #
00121 # 1. An undistorted image (requires D and K) #
00122 # 2. A rectified image (requires D, K, R) #
00123 # The projection matrix P projects 3D points into the rectified image.#
00124 #######################################################################
00125
00126 # The image dimensions with which the camera was calibrated. Normally
00127 # this will be the full camera resolution in pixels.
00128 uint32 height
00129 uint32 width
00130
00131 # The distortion model used. Supported models are listed in
00132 # sensor_msgs/distortion_models.h. For most cameras, "plumb_bob" - a
00133 # simple model of radial and tangential distortion - is sufficent.
00134 string distortion_model
00135
00136 # The distortion parameters, size depending on the distortion model.
00137 # For "plumb_bob", the 5 parameters are: (k1, k2, t1, t2, k3).
00138 float64[] D
00139
00140 # Intrinsic camera matrix for the raw (distorted) images.
00141 # [fx 0 cx]
00142 # K = [ 0 fy cy]
00143 # [ 0 0 1]
00144 # Projects 3D points in the camera coordinate frame to 2D pixel
00145 # coordinates using the focal lengths (fx, fy) and principal point
00146 # (cx, cy).
00147 float64[9] K # 3x3 row-major matrix
00148
00149 # Rectification matrix (stereo cameras only)
00150 # A rotation matrix aligning the camera coordinate system to the ideal
00151 # stereo image plane so that epipolar lines in both stereo images are
00152 # parallel.
00153 float64[9] R # 3x3 row-major matrix
00154
00155 # Projection/camera matrix
00156 # [fx' 0 cx' Tx]
00157 # P = [ 0 fy' cy' Ty]
00158 # [ 0 0 1 0]
00159 # By convention, this matrix specifies the intrinsic (camera) matrix
00160 # of the processed (rectified) image. That is, the left 3x3 portion
00161 # is the normal camera intrinsic matrix for the rectified image.
00162 # It projects 3D points in the camera coordinate frame to 2D pixel
00163 # coordinates using the focal lengths (fx', fy') and principal point
00164 # (cx', cy') - these may differ from the values in K.
00165 # For monocular cameras, Tx = Ty = 0. Normally, monocular cameras will
00166 # also have R = the identity and P[1:3,1:3] = K.
00167 # For a stereo pair, the fourth column [Tx Ty 0]' is related to the
00168 # position of the optical center of the second camera in the first
00169 # camera's frame. We assume Tz = 0 so both cameras are in the same
00170 # stereo image plane. The first camera always has Tx = Ty = 0. For
00171 # the right (second) camera of a horizontal stereo pair, Ty = 0 and
00172 # Tx = -fx' * B, where B is the baseline between the cameras.
00173 # Given a 3D point [X Y Z]', the projection (x, y) of the point onto
00174 # the rectified image is given by:
00175 # [u v w]' = P * [X Y Z 1]'
00176 # x = u / w
00177 # y = v / w
00178 # This holds for both images of a stereo pair.
00179 float64[12] P # 3x4 row-major matrix
00180
00181
00182 #######################################################################
00183 # Operational Parameters #
00184 #######################################################################
00185 # These define the image region actually captured by the camera #
00186 # driver. Although they affect the geometry of the output image, they #
00187 # may be changed freely without recalibrating the camera. #
00188 #######################################################################
00189
00190 # Binning refers here to any camera setting which combines rectangular
00191 # neighborhoods of pixels into larger "super-pixels." It reduces the
00192 # resolution of the output image to
00193 # (width / binning_x) x (height / binning_y).
00194 # The default values binning_x = binning_y = 0 is considered the same
00195 # as binning_x = binning_y = 1 (no subsampling).
00196 uint32 binning_x
00197 uint32 binning_y
00198
00199 # Region of interest (subwindow of full camera resolution), given in
00200 # full resolution (unbinned) image coordinates. A particular ROI
00201 # always denotes the same window of pixels on the camera sensor,
00202 # regardless of binning settings.
00203 # The default setting of roi (all values 0) is considered the same as
00204 # full resolution (roi.width = width, roi.height = height).
00205 RegionOfInterest roi
00206
00207 ================================================================================
00208 MSG: sensor_msgs/RegionOfInterest
00209 # This message is used to specify a region of interest within an image.
00210 #
00211 # When used to specify the ROI setting of the camera when the image was
00212 # taken, the height and width fields should either match the height and
00213 # width fields for the associated image; or height = width = 0
00214 # indicates that the full resolution image was captured.
00215
00216 uint32 x_offset # Leftmost pixel of the ROI
00217 # (0 if the ROI includes the left edge of the image)
00218 uint32 y_offset # Topmost pixel of the ROI
00219 # (0 if the ROI includes the top edge of the image)
00220 uint32 height # Height of ROI
00221 uint32 width # Width of ROI
00222
00223 # True if a distinct rectified ROI should be calculated from the "raw"
00224 # ROI in this message. Typically this should be False if the full image
00225 # is captured (ROI not used), and True if a subwindow is captured (ROI
00226 # used).
00227 bool do_rectify
00228
00229 ================================================================================
00230 MSG: sensor_msgs/PointCloud2
00231 # This message holds a collection of N-dimensional points, which may
00232 # contain additional information such as normals, intensity, etc. The
00233 # point data is stored as a binary blob, its layout described by the
00234 # contents of the "fields" array.
00235
00236 # The point cloud data may be organized 2d (image-like) or 1d
00237 # (unordered). Point clouds organized as 2d images may be produced by
00238 # camera depth sensors such as stereo or time-of-flight.
00239
00240 # Time of sensor data acquisition, and the coordinate frame ID (for 3d
00241 # points).
00242 Header header
00243
00244 # 2D structure of the point cloud. If the cloud is unordered, height is
00245 # 1 and width is the length of the point cloud.
00246 uint32 height
00247 uint32 width
00248
00249 # Describes the channels and their layout in the binary data blob.
00250 PointField[] fields
00251
00252 bool is_bigendian # Is this data bigendian?
00253 uint32 point_step # Length of a point in bytes
00254 uint32 row_step # Length of a row in bytes
00255 uint8[] data # Actual point data, size is (row_step*height)
00256
00257 bool is_dense # True if there are no invalid points
00258
00259 ================================================================================
00260 MSG: sensor_msgs/PointField
00261 # This message holds the description of one point entry in the
00262 # PointCloud2 message format.
00263 uint8 INT8 = 1
00264 uint8 UINT8 = 2
00265 uint8 INT16 = 3
00266 uint8 UINT16 = 4
00267 uint8 INT32 = 5
00268 uint8 UINT32 = 6
00269 uint8 FLOAT32 = 7
00270 uint8 FLOAT64 = 8
00271
00272 string name # Name of field
00273 uint32 offset # Offset from start of point struct
00274 uint8 datatype # Datatype enumeration, see above
00275 uint32 count # How many elements in the field
00276
00277 ================================================================================
00278 MSG: stereo_msgs/DisparityImage
00279 # Separate header for compatibility with current TimeSynchronizer.
00280 # Likely to be removed in a later release, use image.header instead.
00281 Header header
00282
00283 # Floating point disparity image. The disparities are pre-adjusted for any
00284 # x-offset between the principal points of the two cameras (in the case
00285 # that they are verged). That is: d = x_l - x_r - (cx_l - cx_r)
00286 sensor_msgs/Image image
00287
00288 # Stereo geometry. For disparity d, the depth from the camera is Z = fT/d.
00289 float32 f # Focal length, pixels
00290 float32 T # Baseline, world units
00291
00292 # Subwindow of (potentially) valid disparity values.
00293 sensor_msgs/RegionOfInterest valid_window
00294
00295 # The range of disparities searched.
00296 # In the disparity image, any disparity less than min_disparity is invalid.
00297 # The disparity search range defines the horopter, or 3D volume that the
00298 # stereo algorithm can "see". Points with Z outside of:
00299 # Z_min = fT / max_disparity
00300 # Z_max = fT / min_disparity
00301 # could not be found.
00302 float32 min_disparity
00303 float32 max_disparity
00304
00305 # Smallest allowed disparity increment. The smallest achievable depth range
00306 # resolution is delta_Z = (Z^2/fT)*delta_d.
00307 float32 delta_d
00308
00309 """
00310 __slots__ = ['image','camera_info','wide_field','wide_camera_info','point_cloud','disparity_image']
00311 _slot_types = ['sensor_msgs/Image','sensor_msgs/CameraInfo','sensor_msgs/Image','sensor_msgs/CameraInfo','sensor_msgs/PointCloud2','stereo_msgs/DisparityImage']
00312
00313 def __init__(self, *args, **kwds):
00314 """
00315 Constructor. Any message fields that are implicitly/explicitly
00316 set to None will be assigned a default value. The recommend
00317 use is keyword arguments as this is more robust to future message
00318 changes. You cannot mix in-order arguments and keyword arguments.
00319
00320 The available fields are:
00321 image,camera_info,wide_field,wide_camera_info,point_cloud,disparity_image
00322
00323 :param args: complete set of field values, in .msg order
00324 :param kwds: use keyword arguments corresponding to message field names
00325 to set specific fields.
00326 """
00327 if args or kwds:
00328 super(ObjectSegmentationGuiGoal, self).__init__(*args, **kwds)
00329
00330 if self.image is None:
00331 self.image = sensor_msgs.msg.Image()
00332 if self.camera_info is None:
00333 self.camera_info = sensor_msgs.msg.CameraInfo()
00334 if self.wide_field is None:
00335 self.wide_field = sensor_msgs.msg.Image()
00336 if self.wide_camera_info is None:
00337 self.wide_camera_info = sensor_msgs.msg.CameraInfo()
00338 if self.point_cloud is None:
00339 self.point_cloud = sensor_msgs.msg.PointCloud2()
00340 if self.disparity_image is None:
00341 self.disparity_image = stereo_msgs.msg.DisparityImage()
00342 else:
00343 self.image = sensor_msgs.msg.Image()
00344 self.camera_info = sensor_msgs.msg.CameraInfo()
00345 self.wide_field = sensor_msgs.msg.Image()
00346 self.wide_camera_info = sensor_msgs.msg.CameraInfo()
00347 self.point_cloud = sensor_msgs.msg.PointCloud2()
00348 self.disparity_image = stereo_msgs.msg.DisparityImage()
00349
00350 def _get_types(self):
00351 """
00352 internal API method
00353 """
00354 return self._slot_types
00355
00356 def serialize(self, buff):
00357 """
00358 serialize message into buffer
00359 :param buff: buffer, ``StringIO``
00360 """
00361 try:
00362 _x = self
00363 buff.write(_struct_3I.pack(_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs))
00364 _x = self.image.header.frame_id
00365 length = len(_x)
00366 if python3 or type(_x) == unicode:
00367 _x = _x.encode('utf-8')
00368 length = len(_x)
00369 buff.write(struct.pack('<I%ss'%length, length, _x))
00370 _x = self
00371 buff.write(_struct_2I.pack(_x.image.height, _x.image.width))
00372 _x = self.image.encoding
00373 length = len(_x)
00374 if python3 or type(_x) == unicode:
00375 _x = _x.encode('utf-8')
00376 length = len(_x)
00377 buff.write(struct.pack('<I%ss'%length, length, _x))
00378 _x = self
00379 buff.write(_struct_BI.pack(_x.image.is_bigendian, _x.image.step))
00380 _x = self.image.data
00381 length = len(_x)
00382
00383 if type(_x) in [list, tuple]:
00384 buff.write(struct.pack('<I%sB'%length, length, *_x))
00385 else:
00386 buff.write(struct.pack('<I%ss'%length, length, _x))
00387 _x = self
00388 buff.write(_struct_3I.pack(_x.camera_info.header.seq, _x.camera_info.header.stamp.secs, _x.camera_info.header.stamp.nsecs))
00389 _x = self.camera_info.header.frame_id
00390 length = len(_x)
00391 if python3 or type(_x) == unicode:
00392 _x = _x.encode('utf-8')
00393 length = len(_x)
00394 buff.write(struct.pack('<I%ss'%length, length, _x))
00395 _x = self
00396 buff.write(_struct_2I.pack(_x.camera_info.height, _x.camera_info.width))
00397 _x = self.camera_info.distortion_model
00398 length = len(_x)
00399 if python3 or type(_x) == unicode:
00400 _x = _x.encode('utf-8')
00401 length = len(_x)
00402 buff.write(struct.pack('<I%ss'%length, length, _x))
00403 length = len(self.camera_info.D)
00404 buff.write(_struct_I.pack(length))
00405 pattern = '<%sd'%length
00406 buff.write(struct.pack(pattern, *self.camera_info.D))
00407 buff.write(_struct_9d.pack(*self.camera_info.K))
00408 buff.write(_struct_9d.pack(*self.camera_info.R))
00409 buff.write(_struct_12d.pack(*self.camera_info.P))
00410 _x = self
00411 buff.write(_struct_6IB3I.pack(_x.camera_info.binning_x, _x.camera_info.binning_y, _x.camera_info.roi.x_offset, _x.camera_info.roi.y_offset, _x.camera_info.roi.height, _x.camera_info.roi.width, _x.camera_info.roi.do_rectify, _x.wide_field.header.seq, _x.wide_field.header.stamp.secs, _x.wide_field.header.stamp.nsecs))
00412 _x = self.wide_field.header.frame_id
00413 length = len(_x)
00414 if python3 or type(_x) == unicode:
00415 _x = _x.encode('utf-8')
00416 length = len(_x)
00417 buff.write(struct.pack('<I%ss'%length, length, _x))
00418 _x = self
00419 buff.write(_struct_2I.pack(_x.wide_field.height, _x.wide_field.width))
00420 _x = self.wide_field.encoding
00421 length = len(_x)
00422 if python3 or type(_x) == unicode:
00423 _x = _x.encode('utf-8')
00424 length = len(_x)
00425 buff.write(struct.pack('<I%ss'%length, length, _x))
00426 _x = self
00427 buff.write(_struct_BI.pack(_x.wide_field.is_bigendian, _x.wide_field.step))
00428 _x = self.wide_field.data
00429 length = len(_x)
00430
00431 if type(_x) in [list, tuple]:
00432 buff.write(struct.pack('<I%sB'%length, length, *_x))
00433 else:
00434 buff.write(struct.pack('<I%ss'%length, length, _x))
00435 _x = self
00436 buff.write(_struct_3I.pack(_x.wide_camera_info.header.seq, _x.wide_camera_info.header.stamp.secs, _x.wide_camera_info.header.stamp.nsecs))
00437 _x = self.wide_camera_info.header.frame_id
00438 length = len(_x)
00439 if python3 or type(_x) == unicode:
00440 _x = _x.encode('utf-8')
00441 length = len(_x)
00442 buff.write(struct.pack('<I%ss'%length, length, _x))
00443 _x = self
00444 buff.write(_struct_2I.pack(_x.wide_camera_info.height, _x.wide_camera_info.width))
00445 _x = self.wide_camera_info.distortion_model
00446 length = len(_x)
00447 if python3 or type(_x) == unicode:
00448 _x = _x.encode('utf-8')
00449 length = len(_x)
00450 buff.write(struct.pack('<I%ss'%length, length, _x))
00451 length = len(self.wide_camera_info.D)
00452 buff.write(_struct_I.pack(length))
00453 pattern = '<%sd'%length
00454 buff.write(struct.pack(pattern, *self.wide_camera_info.D))
00455 buff.write(_struct_9d.pack(*self.wide_camera_info.K))
00456 buff.write(_struct_9d.pack(*self.wide_camera_info.R))
00457 buff.write(_struct_12d.pack(*self.wide_camera_info.P))
00458 _x = self
00459 buff.write(_struct_6IB3I.pack(_x.wide_camera_info.binning_x, _x.wide_camera_info.binning_y, _x.wide_camera_info.roi.x_offset, _x.wide_camera_info.roi.y_offset, _x.wide_camera_info.roi.height, _x.wide_camera_info.roi.width, _x.wide_camera_info.roi.do_rectify, _x.point_cloud.header.seq, _x.point_cloud.header.stamp.secs, _x.point_cloud.header.stamp.nsecs))
00460 _x = self.point_cloud.header.frame_id
00461 length = len(_x)
00462 if python3 or type(_x) == unicode:
00463 _x = _x.encode('utf-8')
00464 length = len(_x)
00465 buff.write(struct.pack('<I%ss'%length, length, _x))
00466 _x = self
00467 buff.write(_struct_2I.pack(_x.point_cloud.height, _x.point_cloud.width))
00468 length = len(self.point_cloud.fields)
00469 buff.write(_struct_I.pack(length))
00470 for val1 in self.point_cloud.fields:
00471 _x = val1.name
00472 length = len(_x)
00473 if python3 or type(_x) == unicode:
00474 _x = _x.encode('utf-8')
00475 length = len(_x)
00476 buff.write(struct.pack('<I%ss'%length, length, _x))
00477 _x = val1
00478 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00479 _x = self
00480 buff.write(_struct_B2I.pack(_x.point_cloud.is_bigendian, _x.point_cloud.point_step, _x.point_cloud.row_step))
00481 _x = self.point_cloud.data
00482 length = len(_x)
00483
00484 if type(_x) in [list, tuple]:
00485 buff.write(struct.pack('<I%sB'%length, length, *_x))
00486 else:
00487 buff.write(struct.pack('<I%ss'%length, length, _x))
00488 _x = self
00489 buff.write(_struct_B3I.pack(_x.point_cloud.is_dense, _x.disparity_image.header.seq, _x.disparity_image.header.stamp.secs, _x.disparity_image.header.stamp.nsecs))
00490 _x = self.disparity_image.header.frame_id
00491 length = len(_x)
00492 if python3 or type(_x) == unicode:
00493 _x = _x.encode('utf-8')
00494 length = len(_x)
00495 buff.write(struct.pack('<I%ss'%length, length, _x))
00496 _x = self
00497 buff.write(_struct_3I.pack(_x.disparity_image.image.header.seq, _x.disparity_image.image.header.stamp.secs, _x.disparity_image.image.header.stamp.nsecs))
00498 _x = self.disparity_image.image.header.frame_id
00499 length = len(_x)
00500 if python3 or type(_x) == unicode:
00501 _x = _x.encode('utf-8')
00502 length = len(_x)
00503 buff.write(struct.pack('<I%ss'%length, length, _x))
00504 _x = self
00505 buff.write(_struct_2I.pack(_x.disparity_image.image.height, _x.disparity_image.image.width))
00506 _x = self.disparity_image.image.encoding
00507 length = len(_x)
00508 if python3 or type(_x) == unicode:
00509 _x = _x.encode('utf-8')
00510 length = len(_x)
00511 buff.write(struct.pack('<I%ss'%length, length, _x))
00512 _x = self
00513 buff.write(_struct_BI.pack(_x.disparity_image.image.is_bigendian, _x.disparity_image.image.step))
00514 _x = self.disparity_image.image.data
00515 length = len(_x)
00516
00517 if type(_x) in [list, tuple]:
00518 buff.write(struct.pack('<I%sB'%length, length, *_x))
00519 else:
00520 buff.write(struct.pack('<I%ss'%length, length, _x))
00521 _x = self
00522 buff.write(_struct_2f4IB3f.pack(_x.disparity_image.f, _x.disparity_image.T, _x.disparity_image.valid_window.x_offset, _x.disparity_image.valid_window.y_offset, _x.disparity_image.valid_window.height, _x.disparity_image.valid_window.width, _x.disparity_image.valid_window.do_rectify, _x.disparity_image.min_disparity, _x.disparity_image.max_disparity, _x.disparity_image.delta_d))
00523 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00524 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00525
00526 def deserialize(self, str):
00527 """
00528 unpack serialized message in str into this message instance
00529 :param str: byte array of serialized message, ``str``
00530 """
00531 try:
00532 if self.image is None:
00533 self.image = sensor_msgs.msg.Image()
00534 if self.camera_info is None:
00535 self.camera_info = sensor_msgs.msg.CameraInfo()
00536 if self.wide_field is None:
00537 self.wide_field = sensor_msgs.msg.Image()
00538 if self.wide_camera_info is None:
00539 self.wide_camera_info = sensor_msgs.msg.CameraInfo()
00540 if self.point_cloud is None:
00541 self.point_cloud = sensor_msgs.msg.PointCloud2()
00542 if self.disparity_image is None:
00543 self.disparity_image = stereo_msgs.msg.DisparityImage()
00544 end = 0
00545 _x = self
00546 start = end
00547 end += 12
00548 (_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00549 start = end
00550 end += 4
00551 (length,) = _struct_I.unpack(str[start:end])
00552 start = end
00553 end += length
00554 if python3:
00555 self.image.header.frame_id = str[start:end].decode('utf-8')
00556 else:
00557 self.image.header.frame_id = str[start:end]
00558 _x = self
00559 start = end
00560 end += 8
00561 (_x.image.height, _x.image.width,) = _struct_2I.unpack(str[start:end])
00562 start = end
00563 end += 4
00564 (length,) = _struct_I.unpack(str[start:end])
00565 start = end
00566 end += length
00567 if python3:
00568 self.image.encoding = str[start:end].decode('utf-8')
00569 else:
00570 self.image.encoding = str[start:end]
00571 _x = self
00572 start = end
00573 end += 5
00574 (_x.image.is_bigendian, _x.image.step,) = _struct_BI.unpack(str[start:end])
00575 start = end
00576 end += 4
00577 (length,) = _struct_I.unpack(str[start:end])
00578 start = end
00579 end += length
00580 self.image.data = str[start:end]
00581 _x = self
00582 start = end
00583 end += 12
00584 (_x.camera_info.header.seq, _x.camera_info.header.stamp.secs, _x.camera_info.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00585 start = end
00586 end += 4
00587 (length,) = _struct_I.unpack(str[start:end])
00588 start = end
00589 end += length
00590 if python3:
00591 self.camera_info.header.frame_id = str[start:end].decode('utf-8')
00592 else:
00593 self.camera_info.header.frame_id = str[start:end]
00594 _x = self
00595 start = end
00596 end += 8
00597 (_x.camera_info.height, _x.camera_info.width,) = _struct_2I.unpack(str[start:end])
00598 start = end
00599 end += 4
00600 (length,) = _struct_I.unpack(str[start:end])
00601 start = end
00602 end += length
00603 if python3:
00604 self.camera_info.distortion_model = str[start:end].decode('utf-8')
00605 else:
00606 self.camera_info.distortion_model = str[start:end]
00607 start = end
00608 end += 4
00609 (length,) = _struct_I.unpack(str[start:end])
00610 pattern = '<%sd'%length
00611 start = end
00612 end += struct.calcsize(pattern)
00613 self.camera_info.D = struct.unpack(pattern, str[start:end])
00614 start = end
00615 end += 72
00616 self.camera_info.K = _struct_9d.unpack(str[start:end])
00617 start = end
00618 end += 72
00619 self.camera_info.R = _struct_9d.unpack(str[start:end])
00620 start = end
00621 end += 96
00622 self.camera_info.P = _struct_12d.unpack(str[start:end])
00623 _x = self
00624 start = end
00625 end += 37
00626 (_x.camera_info.binning_x, _x.camera_info.binning_y, _x.camera_info.roi.x_offset, _x.camera_info.roi.y_offset, _x.camera_info.roi.height, _x.camera_info.roi.width, _x.camera_info.roi.do_rectify, _x.wide_field.header.seq, _x.wide_field.header.stamp.secs, _x.wide_field.header.stamp.nsecs,) = _struct_6IB3I.unpack(str[start:end])
00627 self.camera_info.roi.do_rectify = bool(self.camera_info.roi.do_rectify)
00628 start = end
00629 end += 4
00630 (length,) = _struct_I.unpack(str[start:end])
00631 start = end
00632 end += length
00633 if python3:
00634 self.wide_field.header.frame_id = str[start:end].decode('utf-8')
00635 else:
00636 self.wide_field.header.frame_id = str[start:end]
00637 _x = self
00638 start = end
00639 end += 8
00640 (_x.wide_field.height, _x.wide_field.width,) = _struct_2I.unpack(str[start:end])
00641 start = end
00642 end += 4
00643 (length,) = _struct_I.unpack(str[start:end])
00644 start = end
00645 end += length
00646 if python3:
00647 self.wide_field.encoding = str[start:end].decode('utf-8')
00648 else:
00649 self.wide_field.encoding = str[start:end]
00650 _x = self
00651 start = end
00652 end += 5
00653 (_x.wide_field.is_bigendian, _x.wide_field.step,) = _struct_BI.unpack(str[start:end])
00654 start = end
00655 end += 4
00656 (length,) = _struct_I.unpack(str[start:end])
00657 start = end
00658 end += length
00659 self.wide_field.data = str[start:end]
00660 _x = self
00661 start = end
00662 end += 12
00663 (_x.wide_camera_info.header.seq, _x.wide_camera_info.header.stamp.secs, _x.wide_camera_info.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00664 start = end
00665 end += 4
00666 (length,) = _struct_I.unpack(str[start:end])
00667 start = end
00668 end += length
00669 if python3:
00670 self.wide_camera_info.header.frame_id = str[start:end].decode('utf-8')
00671 else:
00672 self.wide_camera_info.header.frame_id = str[start:end]
00673 _x = self
00674 start = end
00675 end += 8
00676 (_x.wide_camera_info.height, _x.wide_camera_info.width,) = _struct_2I.unpack(str[start:end])
00677 start = end
00678 end += 4
00679 (length,) = _struct_I.unpack(str[start:end])
00680 start = end
00681 end += length
00682 if python3:
00683 self.wide_camera_info.distortion_model = str[start:end].decode('utf-8')
00684 else:
00685 self.wide_camera_info.distortion_model = str[start:end]
00686 start = end
00687 end += 4
00688 (length,) = _struct_I.unpack(str[start:end])
00689 pattern = '<%sd'%length
00690 start = end
00691 end += struct.calcsize(pattern)
00692 self.wide_camera_info.D = struct.unpack(pattern, str[start:end])
00693 start = end
00694 end += 72
00695 self.wide_camera_info.K = _struct_9d.unpack(str[start:end])
00696 start = end
00697 end += 72
00698 self.wide_camera_info.R = _struct_9d.unpack(str[start:end])
00699 start = end
00700 end += 96
00701 self.wide_camera_info.P = _struct_12d.unpack(str[start:end])
00702 _x = self
00703 start = end
00704 end += 37
00705 (_x.wide_camera_info.binning_x, _x.wide_camera_info.binning_y, _x.wide_camera_info.roi.x_offset, _x.wide_camera_info.roi.y_offset, _x.wide_camera_info.roi.height, _x.wide_camera_info.roi.width, _x.wide_camera_info.roi.do_rectify, _x.point_cloud.header.seq, _x.point_cloud.header.stamp.secs, _x.point_cloud.header.stamp.nsecs,) = _struct_6IB3I.unpack(str[start:end])
00706 self.wide_camera_info.roi.do_rectify = bool(self.wide_camera_info.roi.do_rectify)
00707 start = end
00708 end += 4
00709 (length,) = _struct_I.unpack(str[start:end])
00710 start = end
00711 end += length
00712 if python3:
00713 self.point_cloud.header.frame_id = str[start:end].decode('utf-8')
00714 else:
00715 self.point_cloud.header.frame_id = str[start:end]
00716 _x = self
00717 start = end
00718 end += 8
00719 (_x.point_cloud.height, _x.point_cloud.width,) = _struct_2I.unpack(str[start:end])
00720 start = end
00721 end += 4
00722 (length,) = _struct_I.unpack(str[start:end])
00723 self.point_cloud.fields = []
00724 for i in range(0, length):
00725 val1 = sensor_msgs.msg.PointField()
00726 start = end
00727 end += 4
00728 (length,) = _struct_I.unpack(str[start:end])
00729 start = end
00730 end += length
00731 if python3:
00732 val1.name = str[start:end].decode('utf-8')
00733 else:
00734 val1.name = str[start:end]
00735 _x = val1
00736 start = end
00737 end += 9
00738 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00739 self.point_cloud.fields.append(val1)
00740 _x = self
00741 start = end
00742 end += 9
00743 (_x.point_cloud.is_bigendian, _x.point_cloud.point_step, _x.point_cloud.row_step,) = _struct_B2I.unpack(str[start:end])
00744 self.point_cloud.is_bigendian = bool(self.point_cloud.is_bigendian)
00745 start = end
00746 end += 4
00747 (length,) = _struct_I.unpack(str[start:end])
00748 start = end
00749 end += length
00750 self.point_cloud.data = str[start:end]
00751 _x = self
00752 start = end
00753 end += 13
00754 (_x.point_cloud.is_dense, _x.disparity_image.header.seq, _x.disparity_image.header.stamp.secs, _x.disparity_image.header.stamp.nsecs,) = _struct_B3I.unpack(str[start:end])
00755 self.point_cloud.is_dense = bool(self.point_cloud.is_dense)
00756 start = end
00757 end += 4
00758 (length,) = _struct_I.unpack(str[start:end])
00759 start = end
00760 end += length
00761 if python3:
00762 self.disparity_image.header.frame_id = str[start:end].decode('utf-8')
00763 else:
00764 self.disparity_image.header.frame_id = str[start:end]
00765 _x = self
00766 start = end
00767 end += 12
00768 (_x.disparity_image.image.header.seq, _x.disparity_image.image.header.stamp.secs, _x.disparity_image.image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00769 start = end
00770 end += 4
00771 (length,) = _struct_I.unpack(str[start:end])
00772 start = end
00773 end += length
00774 if python3:
00775 self.disparity_image.image.header.frame_id = str[start:end].decode('utf-8')
00776 else:
00777 self.disparity_image.image.header.frame_id = str[start:end]
00778 _x = self
00779 start = end
00780 end += 8
00781 (_x.disparity_image.image.height, _x.disparity_image.image.width,) = _struct_2I.unpack(str[start:end])
00782 start = end
00783 end += 4
00784 (length,) = _struct_I.unpack(str[start:end])
00785 start = end
00786 end += length
00787 if python3:
00788 self.disparity_image.image.encoding = str[start:end].decode('utf-8')
00789 else:
00790 self.disparity_image.image.encoding = str[start:end]
00791 _x = self
00792 start = end
00793 end += 5
00794 (_x.disparity_image.image.is_bigendian, _x.disparity_image.image.step,) = _struct_BI.unpack(str[start:end])
00795 start = end
00796 end += 4
00797 (length,) = _struct_I.unpack(str[start:end])
00798 start = end
00799 end += length
00800 self.disparity_image.image.data = str[start:end]
00801 _x = self
00802 start = end
00803 end += 37
00804 (_x.disparity_image.f, _x.disparity_image.T, _x.disparity_image.valid_window.x_offset, _x.disparity_image.valid_window.y_offset, _x.disparity_image.valid_window.height, _x.disparity_image.valid_window.width, _x.disparity_image.valid_window.do_rectify, _x.disparity_image.min_disparity, _x.disparity_image.max_disparity, _x.disparity_image.delta_d,) = _struct_2f4IB3f.unpack(str[start:end])
00805 self.disparity_image.valid_window.do_rectify = bool(self.disparity_image.valid_window.do_rectify)
00806 return self
00807 except struct.error as e:
00808 raise genpy.DeserializationError(e)
00809
00810
00811 def serialize_numpy(self, buff, numpy):
00812 """
00813 serialize message with numpy array types into buffer
00814 :param buff: buffer, ``StringIO``
00815 :param numpy: numpy python module
00816 """
00817 try:
00818 _x = self
00819 buff.write(_struct_3I.pack(_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs))
00820 _x = self.image.header.frame_id
00821 length = len(_x)
00822 if python3 or type(_x) == unicode:
00823 _x = _x.encode('utf-8')
00824 length = len(_x)
00825 buff.write(struct.pack('<I%ss'%length, length, _x))
00826 _x = self
00827 buff.write(_struct_2I.pack(_x.image.height, _x.image.width))
00828 _x = self.image.encoding
00829 length = len(_x)
00830 if python3 or type(_x) == unicode:
00831 _x = _x.encode('utf-8')
00832 length = len(_x)
00833 buff.write(struct.pack('<I%ss'%length, length, _x))
00834 _x = self
00835 buff.write(_struct_BI.pack(_x.image.is_bigendian, _x.image.step))
00836 _x = self.image.data
00837 length = len(_x)
00838
00839 if type(_x) in [list, tuple]:
00840 buff.write(struct.pack('<I%sB'%length, length, *_x))
00841 else:
00842 buff.write(struct.pack('<I%ss'%length, length, _x))
00843 _x = self
00844 buff.write(_struct_3I.pack(_x.camera_info.header.seq, _x.camera_info.header.stamp.secs, _x.camera_info.header.stamp.nsecs))
00845 _x = self.camera_info.header.frame_id
00846 length = len(_x)
00847 if python3 or type(_x) == unicode:
00848 _x = _x.encode('utf-8')
00849 length = len(_x)
00850 buff.write(struct.pack('<I%ss'%length, length, _x))
00851 _x = self
00852 buff.write(_struct_2I.pack(_x.camera_info.height, _x.camera_info.width))
00853 _x = self.camera_info.distortion_model
00854 length = len(_x)
00855 if python3 or type(_x) == unicode:
00856 _x = _x.encode('utf-8')
00857 length = len(_x)
00858 buff.write(struct.pack('<I%ss'%length, length, _x))
00859 length = len(self.camera_info.D)
00860 buff.write(_struct_I.pack(length))
00861 pattern = '<%sd'%length
00862 buff.write(self.camera_info.D.tostring())
00863 buff.write(self.camera_info.K.tostring())
00864 buff.write(self.camera_info.R.tostring())
00865 buff.write(self.camera_info.P.tostring())
00866 _x = self
00867 buff.write(_struct_6IB3I.pack(_x.camera_info.binning_x, _x.camera_info.binning_y, _x.camera_info.roi.x_offset, _x.camera_info.roi.y_offset, _x.camera_info.roi.height, _x.camera_info.roi.width, _x.camera_info.roi.do_rectify, _x.wide_field.header.seq, _x.wide_field.header.stamp.secs, _x.wide_field.header.stamp.nsecs))
00868 _x = self.wide_field.header.frame_id
00869 length = len(_x)
00870 if python3 or type(_x) == unicode:
00871 _x = _x.encode('utf-8')
00872 length = len(_x)
00873 buff.write(struct.pack('<I%ss'%length, length, _x))
00874 _x = self
00875 buff.write(_struct_2I.pack(_x.wide_field.height, _x.wide_field.width))
00876 _x = self.wide_field.encoding
00877 length = len(_x)
00878 if python3 or type(_x) == unicode:
00879 _x = _x.encode('utf-8')
00880 length = len(_x)
00881 buff.write(struct.pack('<I%ss'%length, length, _x))
00882 _x = self
00883 buff.write(_struct_BI.pack(_x.wide_field.is_bigendian, _x.wide_field.step))
00884 _x = self.wide_field.data
00885 length = len(_x)
00886
00887 if type(_x) in [list, tuple]:
00888 buff.write(struct.pack('<I%sB'%length, length, *_x))
00889 else:
00890 buff.write(struct.pack('<I%ss'%length, length, _x))
00891 _x = self
00892 buff.write(_struct_3I.pack(_x.wide_camera_info.header.seq, _x.wide_camera_info.header.stamp.secs, _x.wide_camera_info.header.stamp.nsecs))
00893 _x = self.wide_camera_info.header.frame_id
00894 length = len(_x)
00895 if python3 or type(_x) == unicode:
00896 _x = _x.encode('utf-8')
00897 length = len(_x)
00898 buff.write(struct.pack('<I%ss'%length, length, _x))
00899 _x = self
00900 buff.write(_struct_2I.pack(_x.wide_camera_info.height, _x.wide_camera_info.width))
00901 _x = self.wide_camera_info.distortion_model
00902 length = len(_x)
00903 if python3 or type(_x) == unicode:
00904 _x = _x.encode('utf-8')
00905 length = len(_x)
00906 buff.write(struct.pack('<I%ss'%length, length, _x))
00907 length = len(self.wide_camera_info.D)
00908 buff.write(_struct_I.pack(length))
00909 pattern = '<%sd'%length
00910 buff.write(self.wide_camera_info.D.tostring())
00911 buff.write(self.wide_camera_info.K.tostring())
00912 buff.write(self.wide_camera_info.R.tostring())
00913 buff.write(self.wide_camera_info.P.tostring())
00914 _x = self
00915 buff.write(_struct_6IB3I.pack(_x.wide_camera_info.binning_x, _x.wide_camera_info.binning_y, _x.wide_camera_info.roi.x_offset, _x.wide_camera_info.roi.y_offset, _x.wide_camera_info.roi.height, _x.wide_camera_info.roi.width, _x.wide_camera_info.roi.do_rectify, _x.point_cloud.header.seq, _x.point_cloud.header.stamp.secs, _x.point_cloud.header.stamp.nsecs))
00916 _x = self.point_cloud.header.frame_id
00917 length = len(_x)
00918 if python3 or type(_x) == unicode:
00919 _x = _x.encode('utf-8')
00920 length = len(_x)
00921 buff.write(struct.pack('<I%ss'%length, length, _x))
00922 _x = self
00923 buff.write(_struct_2I.pack(_x.point_cloud.height, _x.point_cloud.width))
00924 length = len(self.point_cloud.fields)
00925 buff.write(_struct_I.pack(length))
00926 for val1 in self.point_cloud.fields:
00927 _x = val1.name
00928 length = len(_x)
00929 if python3 or type(_x) == unicode:
00930 _x = _x.encode('utf-8')
00931 length = len(_x)
00932 buff.write(struct.pack('<I%ss'%length, length, _x))
00933 _x = val1
00934 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00935 _x = self
00936 buff.write(_struct_B2I.pack(_x.point_cloud.is_bigendian, _x.point_cloud.point_step, _x.point_cloud.row_step))
00937 _x = self.point_cloud.data
00938 length = len(_x)
00939
00940 if type(_x) in [list, tuple]:
00941 buff.write(struct.pack('<I%sB'%length, length, *_x))
00942 else:
00943 buff.write(struct.pack('<I%ss'%length, length, _x))
00944 _x = self
00945 buff.write(_struct_B3I.pack(_x.point_cloud.is_dense, _x.disparity_image.header.seq, _x.disparity_image.header.stamp.secs, _x.disparity_image.header.stamp.nsecs))
00946 _x = self.disparity_image.header.frame_id
00947 length = len(_x)
00948 if python3 or type(_x) == unicode:
00949 _x = _x.encode('utf-8')
00950 length = len(_x)
00951 buff.write(struct.pack('<I%ss'%length, length, _x))
00952 _x = self
00953 buff.write(_struct_3I.pack(_x.disparity_image.image.header.seq, _x.disparity_image.image.header.stamp.secs, _x.disparity_image.image.header.stamp.nsecs))
00954 _x = self.disparity_image.image.header.frame_id
00955 length = len(_x)
00956 if python3 or type(_x) == unicode:
00957 _x = _x.encode('utf-8')
00958 length = len(_x)
00959 buff.write(struct.pack('<I%ss'%length, length, _x))
00960 _x = self
00961 buff.write(_struct_2I.pack(_x.disparity_image.image.height, _x.disparity_image.image.width))
00962 _x = self.disparity_image.image.encoding
00963 length = len(_x)
00964 if python3 or type(_x) == unicode:
00965 _x = _x.encode('utf-8')
00966 length = len(_x)
00967 buff.write(struct.pack('<I%ss'%length, length, _x))
00968 _x = self
00969 buff.write(_struct_BI.pack(_x.disparity_image.image.is_bigendian, _x.disparity_image.image.step))
00970 _x = self.disparity_image.image.data
00971 length = len(_x)
00972
00973 if type(_x) in [list, tuple]:
00974 buff.write(struct.pack('<I%sB'%length, length, *_x))
00975 else:
00976 buff.write(struct.pack('<I%ss'%length, length, _x))
00977 _x = self
00978 buff.write(_struct_2f4IB3f.pack(_x.disparity_image.f, _x.disparity_image.T, _x.disparity_image.valid_window.x_offset, _x.disparity_image.valid_window.y_offset, _x.disparity_image.valid_window.height, _x.disparity_image.valid_window.width, _x.disparity_image.valid_window.do_rectify, _x.disparity_image.min_disparity, _x.disparity_image.max_disparity, _x.disparity_image.delta_d))
00979 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00980 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00981
00982 def deserialize_numpy(self, str, numpy):
00983 """
00984 unpack serialized message in str into this message instance using numpy for array types
00985 :param str: byte array of serialized message, ``str``
00986 :param numpy: numpy python module
00987 """
00988 try:
00989 if self.image is None:
00990 self.image = sensor_msgs.msg.Image()
00991 if self.camera_info is None:
00992 self.camera_info = sensor_msgs.msg.CameraInfo()
00993 if self.wide_field is None:
00994 self.wide_field = sensor_msgs.msg.Image()
00995 if self.wide_camera_info is None:
00996 self.wide_camera_info = sensor_msgs.msg.CameraInfo()
00997 if self.point_cloud is None:
00998 self.point_cloud = sensor_msgs.msg.PointCloud2()
00999 if self.disparity_image is None:
01000 self.disparity_image = stereo_msgs.msg.DisparityImage()
01001 end = 0
01002 _x = self
01003 start = end
01004 end += 12
01005 (_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
01006 start = end
01007 end += 4
01008 (length,) = _struct_I.unpack(str[start:end])
01009 start = end
01010 end += length
01011 if python3:
01012 self.image.header.frame_id = str[start:end].decode('utf-8')
01013 else:
01014 self.image.header.frame_id = str[start:end]
01015 _x = self
01016 start = end
01017 end += 8
01018 (_x.image.height, _x.image.width,) = _struct_2I.unpack(str[start:end])
01019 start = end
01020 end += 4
01021 (length,) = _struct_I.unpack(str[start:end])
01022 start = end
01023 end += length
01024 if python3:
01025 self.image.encoding = str[start:end].decode('utf-8')
01026 else:
01027 self.image.encoding = str[start:end]
01028 _x = self
01029 start = end
01030 end += 5
01031 (_x.image.is_bigendian, _x.image.step,) = _struct_BI.unpack(str[start:end])
01032 start = end
01033 end += 4
01034 (length,) = _struct_I.unpack(str[start:end])
01035 start = end
01036 end += length
01037 self.image.data = str[start:end]
01038 _x = self
01039 start = end
01040 end += 12
01041 (_x.camera_info.header.seq, _x.camera_info.header.stamp.secs, _x.camera_info.header.stamp.nsecs,) = _struct_3I.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.camera_info.header.frame_id = str[start:end].decode('utf-8')
01049 else:
01050 self.camera_info.header.frame_id = str[start:end]
01051 _x = self
01052 start = end
01053 end += 8
01054 (_x.camera_info.height, _x.camera_info.width,) = _struct_2I.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.camera_info.distortion_model = str[start:end].decode('utf-8')
01062 else:
01063 self.camera_info.distortion_model = str[start:end]
01064 start = end
01065 end += 4
01066 (length,) = _struct_I.unpack(str[start:end])
01067 pattern = '<%sd'%length
01068 start = end
01069 end += struct.calcsize(pattern)
01070 self.camera_info.D = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
01071 start = end
01072 end += 72
01073 self.camera_info.K = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9)
01074 start = end
01075 end += 72
01076 self.camera_info.R = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9)
01077 start = end
01078 end += 96
01079 self.camera_info.P = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=12)
01080 _x = self
01081 start = end
01082 end += 37
01083 (_x.camera_info.binning_x, _x.camera_info.binning_y, _x.camera_info.roi.x_offset, _x.camera_info.roi.y_offset, _x.camera_info.roi.height, _x.camera_info.roi.width, _x.camera_info.roi.do_rectify, _x.wide_field.header.seq, _x.wide_field.header.stamp.secs, _x.wide_field.header.stamp.nsecs,) = _struct_6IB3I.unpack(str[start:end])
01084 self.camera_info.roi.do_rectify = bool(self.camera_info.roi.do_rectify)
01085 start = end
01086 end += 4
01087 (length,) = _struct_I.unpack(str[start:end])
01088 start = end
01089 end += length
01090 if python3:
01091 self.wide_field.header.frame_id = str[start:end].decode('utf-8')
01092 else:
01093 self.wide_field.header.frame_id = str[start:end]
01094 _x = self
01095 start = end
01096 end += 8
01097 (_x.wide_field.height, _x.wide_field.width,) = _struct_2I.unpack(str[start:end])
01098 start = end
01099 end += 4
01100 (length,) = _struct_I.unpack(str[start:end])
01101 start = end
01102 end += length
01103 if python3:
01104 self.wide_field.encoding = str[start:end].decode('utf-8')
01105 else:
01106 self.wide_field.encoding = str[start:end]
01107 _x = self
01108 start = end
01109 end += 5
01110 (_x.wide_field.is_bigendian, _x.wide_field.step,) = _struct_BI.unpack(str[start:end])
01111 start = end
01112 end += 4
01113 (length,) = _struct_I.unpack(str[start:end])
01114 start = end
01115 end += length
01116 self.wide_field.data = str[start:end]
01117 _x = self
01118 start = end
01119 end += 12
01120 (_x.wide_camera_info.header.seq, _x.wide_camera_info.header.stamp.secs, _x.wide_camera_info.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
01121 start = end
01122 end += 4
01123 (length,) = _struct_I.unpack(str[start:end])
01124 start = end
01125 end += length
01126 if python3:
01127 self.wide_camera_info.header.frame_id = str[start:end].decode('utf-8')
01128 else:
01129 self.wide_camera_info.header.frame_id = str[start:end]
01130 _x = self
01131 start = end
01132 end += 8
01133 (_x.wide_camera_info.height, _x.wide_camera_info.width,) = _struct_2I.unpack(str[start:end])
01134 start = end
01135 end += 4
01136 (length,) = _struct_I.unpack(str[start:end])
01137 start = end
01138 end += length
01139 if python3:
01140 self.wide_camera_info.distortion_model = str[start:end].decode('utf-8')
01141 else:
01142 self.wide_camera_info.distortion_model = str[start:end]
01143 start = end
01144 end += 4
01145 (length,) = _struct_I.unpack(str[start:end])
01146 pattern = '<%sd'%length
01147 start = end
01148 end += struct.calcsize(pattern)
01149 self.wide_camera_info.D = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
01150 start = end
01151 end += 72
01152 self.wide_camera_info.K = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9)
01153 start = end
01154 end += 72
01155 self.wide_camera_info.R = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9)
01156 start = end
01157 end += 96
01158 self.wide_camera_info.P = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=12)
01159 _x = self
01160 start = end
01161 end += 37
01162 (_x.wide_camera_info.binning_x, _x.wide_camera_info.binning_y, _x.wide_camera_info.roi.x_offset, _x.wide_camera_info.roi.y_offset, _x.wide_camera_info.roi.height, _x.wide_camera_info.roi.width, _x.wide_camera_info.roi.do_rectify, _x.point_cloud.header.seq, _x.point_cloud.header.stamp.secs, _x.point_cloud.header.stamp.nsecs,) = _struct_6IB3I.unpack(str[start:end])
01163 self.wide_camera_info.roi.do_rectify = bool(self.wide_camera_info.roi.do_rectify)
01164 start = end
01165 end += 4
01166 (length,) = _struct_I.unpack(str[start:end])
01167 start = end
01168 end += length
01169 if python3:
01170 self.point_cloud.header.frame_id = str[start:end].decode('utf-8')
01171 else:
01172 self.point_cloud.header.frame_id = str[start:end]
01173 _x = self
01174 start = end
01175 end += 8
01176 (_x.point_cloud.height, _x.point_cloud.width,) = _struct_2I.unpack(str[start:end])
01177 start = end
01178 end += 4
01179 (length,) = _struct_I.unpack(str[start:end])
01180 self.point_cloud.fields = []
01181 for i in range(0, length):
01182 val1 = sensor_msgs.msg.PointField()
01183 start = end
01184 end += 4
01185 (length,) = _struct_I.unpack(str[start:end])
01186 start = end
01187 end += length
01188 if python3:
01189 val1.name = str[start:end].decode('utf-8')
01190 else:
01191 val1.name = str[start:end]
01192 _x = val1
01193 start = end
01194 end += 9
01195 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
01196 self.point_cloud.fields.append(val1)
01197 _x = self
01198 start = end
01199 end += 9
01200 (_x.point_cloud.is_bigendian, _x.point_cloud.point_step, _x.point_cloud.row_step,) = _struct_B2I.unpack(str[start:end])
01201 self.point_cloud.is_bigendian = bool(self.point_cloud.is_bigendian)
01202 start = end
01203 end += 4
01204 (length,) = _struct_I.unpack(str[start:end])
01205 start = end
01206 end += length
01207 self.point_cloud.data = str[start:end]
01208 _x = self
01209 start = end
01210 end += 13
01211 (_x.point_cloud.is_dense, _x.disparity_image.header.seq, _x.disparity_image.header.stamp.secs, _x.disparity_image.header.stamp.nsecs,) = _struct_B3I.unpack(str[start:end])
01212 self.point_cloud.is_dense = bool(self.point_cloud.is_dense)
01213 start = end
01214 end += 4
01215 (length,) = _struct_I.unpack(str[start:end])
01216 start = end
01217 end += length
01218 if python3:
01219 self.disparity_image.header.frame_id = str[start:end].decode('utf-8')
01220 else:
01221 self.disparity_image.header.frame_id = str[start:end]
01222 _x = self
01223 start = end
01224 end += 12
01225 (_x.disparity_image.image.header.seq, _x.disparity_image.image.header.stamp.secs, _x.disparity_image.image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
01226 start = end
01227 end += 4
01228 (length,) = _struct_I.unpack(str[start:end])
01229 start = end
01230 end += length
01231 if python3:
01232 self.disparity_image.image.header.frame_id = str[start:end].decode('utf-8')
01233 else:
01234 self.disparity_image.image.header.frame_id = str[start:end]
01235 _x = self
01236 start = end
01237 end += 8
01238 (_x.disparity_image.image.height, _x.disparity_image.image.width,) = _struct_2I.unpack(str[start:end])
01239 start = end
01240 end += 4
01241 (length,) = _struct_I.unpack(str[start:end])
01242 start = end
01243 end += length
01244 if python3:
01245 self.disparity_image.image.encoding = str[start:end].decode('utf-8')
01246 else:
01247 self.disparity_image.image.encoding = str[start:end]
01248 _x = self
01249 start = end
01250 end += 5
01251 (_x.disparity_image.image.is_bigendian, _x.disparity_image.image.step,) = _struct_BI.unpack(str[start:end])
01252 start = end
01253 end += 4
01254 (length,) = _struct_I.unpack(str[start:end])
01255 start = end
01256 end += length
01257 self.disparity_image.image.data = str[start:end]
01258 _x = self
01259 start = end
01260 end += 37
01261 (_x.disparity_image.f, _x.disparity_image.T, _x.disparity_image.valid_window.x_offset, _x.disparity_image.valid_window.y_offset, _x.disparity_image.valid_window.height, _x.disparity_image.valid_window.width, _x.disparity_image.valid_window.do_rectify, _x.disparity_image.min_disparity, _x.disparity_image.max_disparity, _x.disparity_image.delta_d,) = _struct_2f4IB3f.unpack(str[start:end])
01262 self.disparity_image.valid_window.do_rectify = bool(self.disparity_image.valid_window.do_rectify)
01263 return self
01264 except struct.error as e:
01265 raise genpy.DeserializationError(e)
01266
01267 _struct_I = genpy.struct_I
01268 _struct_IBI = struct.Struct("<IBI")
01269 _struct_6IB3I = struct.Struct("<6IB3I")
01270 _struct_12d = struct.Struct("<12d")
01271 _struct_2f4IB3f = struct.Struct("<2f4IB3f")
01272 _struct_9d = struct.Struct("<9d")
01273 _struct_BI = struct.Struct("<BI")
01274 _struct_3I = struct.Struct("<3I")
01275 _struct_B3I = struct.Struct("<B3I")
01276 _struct_B2I = struct.Struct("<B2I")
01277 _struct_2I = struct.Struct("<2I")