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