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


object_manipulation_msgs
Author(s): Matei Ciocarlie
autogenerated on Thu Jan 2 2014 11:38:12