_GetCameraInfo.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_clutter_helper/GetCameraInfoRequest.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 GetCameraInfoRequest(genpy.Message):
00009   _md5sum = "13abbc87c0c0b2fc9a6d87f74375a5d7"
00010   _type = "pr2_clutter_helper/GetCameraInfoRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """string topic_name
00013 string msg_type
00014 
00015 """
00016   __slots__ = ['topic_name','msg_type']
00017   _slot_types = ['string','string']
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        topic_name,msg_type
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(GetCameraInfoRequest, self).__init__(*args, **kwds)
00035       #message fields cannot be None, assign default values for those that are
00036       if self.topic_name is None:
00037         self.topic_name = ''
00038       if self.msg_type is None:
00039         self.msg_type = ''
00040     else:
00041       self.topic_name = ''
00042       self.msg_type = ''
00043 
00044   def _get_types(self):
00045     """
00046     internal API method
00047     """
00048     return self._slot_types
00049 
00050   def serialize(self, buff):
00051     """
00052     serialize message into buffer
00053     :param buff: buffer, ``StringIO``
00054     """
00055     try:
00056       _x = self.topic_name
00057       length = len(_x)
00058       if python3 or type(_x) == unicode:
00059         _x = _x.encode('utf-8')
00060         length = len(_x)
00061       buff.write(struct.pack('<I%ss'%length, length, _x))
00062       _x = self.msg_type
00063       length = len(_x)
00064       if python3 or type(_x) == unicode:
00065         _x = _x.encode('utf-8')
00066         length = len(_x)
00067       buff.write(struct.pack('<I%ss'%length, length, _x))
00068     except struct.error as se: self._check_types(se)
00069     except TypeError as te: self._check_types(te)
00070 
00071   def deserialize(self, str):
00072     """
00073     unpack serialized message in str into this message instance
00074     :param str: byte array of serialized message, ``str``
00075     """
00076     try:
00077       end = 0
00078       start = end
00079       end += 4
00080       (length,) = _struct_I.unpack(str[start:end])
00081       start = end
00082       end += length
00083       if python3:
00084         self.topic_name = str[start:end].decode('utf-8')
00085       else:
00086         self.topic_name = str[start:end]
00087       start = end
00088       end += 4
00089       (length,) = _struct_I.unpack(str[start:end])
00090       start = end
00091       end += length
00092       if python3:
00093         self.msg_type = str[start:end].decode('utf-8')
00094       else:
00095         self.msg_type = str[start:end]
00096       return self
00097     except struct.error as e:
00098       raise genpy.DeserializationError(e) #most likely buffer underfill
00099 
00100 
00101   def serialize_numpy(self, buff, numpy):
00102     """
00103     serialize message with numpy array types into buffer
00104     :param buff: buffer, ``StringIO``
00105     :param numpy: numpy python module
00106     """
00107     try:
00108       _x = self.topic_name
00109       length = len(_x)
00110       if python3 or type(_x) == unicode:
00111         _x = _x.encode('utf-8')
00112         length = len(_x)
00113       buff.write(struct.pack('<I%ss'%length, length, _x))
00114       _x = self.msg_type
00115       length = len(_x)
00116       if python3 or type(_x) == unicode:
00117         _x = _x.encode('utf-8')
00118         length = len(_x)
00119       buff.write(struct.pack('<I%ss'%length, length, _x))
00120     except struct.error as se: self._check_types(se)
00121     except TypeError as te: self._check_types(te)
00122 
00123   def deserialize_numpy(self, str, numpy):
00124     """
00125     unpack serialized message in str into this message instance using numpy for array types
00126     :param str: byte array of serialized message, ``str``
00127     :param numpy: numpy python module
00128     """
00129     try:
00130       end = 0
00131       start = end
00132       end += 4
00133       (length,) = _struct_I.unpack(str[start:end])
00134       start = end
00135       end += length
00136       if python3:
00137         self.topic_name = str[start:end].decode('utf-8')
00138       else:
00139         self.topic_name = str[start:end]
00140       start = end
00141       end += 4
00142       (length,) = _struct_I.unpack(str[start:end])
00143       start = end
00144       end += length
00145       if python3:
00146         self.msg_type = str[start:end].decode('utf-8')
00147       else:
00148         self.msg_type = str[start:end]
00149       return self
00150     except struct.error as e:
00151       raise genpy.DeserializationError(e) #most likely buffer underfill
00152 
00153 _struct_I = genpy.struct_I
00154 """autogenerated by genpy from pr2_clutter_helper/GetCameraInfoResponse.msg. Do not edit."""
00155 import sys
00156 python3 = True if sys.hexversion > 0x03000000 else False
00157 import genpy
00158 import struct
00159 
00160 import std_msgs.msg
00161 import sensor_msgs.msg
00162 
00163 class GetCameraInfoResponse(genpy.Message):
00164   _md5sum = "1802ea5c04df755ec7e68bc4bf07a06d"
00165   _type = "pr2_clutter_helper/GetCameraInfoResponse"
00166   _has_header = False #flag to mark the presence of a Header object
00167   _full_text = """sensor_msgs/CameraInfo info
00168 
00169 
00170 ================================================================================
00171 MSG: sensor_msgs/CameraInfo
00172 # This message defines meta information for a camera. It should be in a
00173 # camera namespace on topic "camera_info" and accompanied by up to five
00174 # image topics named:
00175 #
00176 #   image_raw - raw data from the camera driver, possibly Bayer encoded
00177 #   image            - monochrome, distorted
00178 #   image_color      - color, distorted
00179 #   image_rect       - monochrome, rectified
00180 #   image_rect_color - color, rectified
00181 #
00182 # The image_pipeline contains packages (image_proc, stereo_image_proc)
00183 # for producing the four processed image topics from image_raw and
00184 # camera_info. The meaning of the camera parameters are described in
00185 # detail at http://www.ros.org/wiki/image_pipeline/CameraInfo.
00186 #
00187 # The image_geometry package provides a user-friendly interface to
00188 # common operations using this meta information. If you want to, e.g.,
00189 # project a 3d point into image coordinates, we strongly recommend
00190 # using image_geometry.
00191 #
00192 # If the camera is uncalibrated, the matrices D, K, R, P should be left
00193 # zeroed out. In particular, clients may assume that K[0] == 0.0
00194 # indicates an uncalibrated camera.
00195 
00196 #######################################################################
00197 #                     Image acquisition info                          #
00198 #######################################################################
00199 
00200 # Time of image acquisition, camera coordinate frame ID
00201 Header header    # Header timestamp should be acquisition time of image
00202                  # Header frame_id should be optical frame of camera
00203                  # origin of frame should be optical center of camera
00204                  # +x should point to the right in the image
00205                  # +y should point down in the image
00206                  # +z should point into the plane of the image
00207 
00208 
00209 #######################################################################
00210 #                      Calibration Parameters                         #
00211 #######################################################################
00212 # These are fixed during camera calibration. Their values will be the #
00213 # same in all messages until the camera is recalibrated. Note that    #
00214 # self-calibrating systems may "recalibrate" frequently.              #
00215 #                                                                     #
00216 # The internal parameters can be used to warp a raw (distorted) image #
00217 # to:                                                                 #
00218 #   1. An undistorted image (requires D and K)                        #
00219 #   2. A rectified image (requires D, K, R)                           #
00220 # The projection matrix P projects 3D points into the rectified image.#
00221 #######################################################################
00222 
00223 # The image dimensions with which the camera was calibrated. Normally
00224 # this will be the full camera resolution in pixels.
00225 uint32 height
00226 uint32 width
00227 
00228 # The distortion model used. Supported models are listed in
00229 # sensor_msgs/distortion_models.h. For most cameras, "plumb_bob" - a
00230 # simple model of radial and tangential distortion - is sufficent.
00231 string distortion_model
00232 
00233 # The distortion parameters, size depending on the distortion model.
00234 # For "plumb_bob", the 5 parameters are: (k1, k2, t1, t2, k3).
00235 float64[] D
00236 
00237 # Intrinsic camera matrix for the raw (distorted) images.
00238 #     [fx  0 cx]
00239 # K = [ 0 fy cy]
00240 #     [ 0  0  1]
00241 # Projects 3D points in the camera coordinate frame to 2D pixel
00242 # coordinates using the focal lengths (fx, fy) and principal point
00243 # (cx, cy).
00244 float64[9]  K # 3x3 row-major matrix
00245 
00246 # Rectification matrix (stereo cameras only)
00247 # A rotation matrix aligning the camera coordinate system to the ideal
00248 # stereo image plane so that epipolar lines in both stereo images are
00249 # parallel.
00250 float64[9]  R # 3x3 row-major matrix
00251 
00252 # Projection/camera matrix
00253 #     [fx'  0  cx' Tx]
00254 # P = [ 0  fy' cy' Ty]
00255 #     [ 0   0   1   0]
00256 # By convention, this matrix specifies the intrinsic (camera) matrix
00257 #  of the processed (rectified) image. That is, the left 3x3 portion
00258 #  is the normal camera intrinsic matrix for the rectified image.
00259 # It projects 3D points in the camera coordinate frame to 2D pixel
00260 #  coordinates using the focal lengths (fx', fy') and principal point
00261 #  (cx', cy') - these may differ from the values in K.
00262 # For monocular cameras, Tx = Ty = 0. Normally, monocular cameras will
00263 #  also have R = the identity and P[1:3,1:3] = K.
00264 # For a stereo pair, the fourth column [Tx Ty 0]' is related to the
00265 #  position of the optical center of the second camera in the first
00266 #  camera's frame. We assume Tz = 0 so both cameras are in the same
00267 #  stereo image plane. The first camera always has Tx = Ty = 0. For
00268 #  the right (second) camera of a horizontal stereo pair, Ty = 0 and
00269 #  Tx = -fx' * B, where B is the baseline between the cameras.
00270 # Given a 3D point [X Y Z]', the projection (x, y) of the point onto
00271 #  the rectified image is given by:
00272 #  [u v w]' = P * [X Y Z 1]'
00273 #         x = u / w
00274 #         y = v / w
00275 #  This holds for both images of a stereo pair.
00276 float64[12] P # 3x4 row-major matrix
00277 
00278 
00279 #######################################################################
00280 #                      Operational Parameters                         #
00281 #######################################################################
00282 # These define the image region actually captured by the camera       #
00283 # driver. Although they affect the geometry of the output image, they #
00284 # may be changed freely without recalibrating the camera.             #
00285 #######################################################################
00286 
00287 # Binning refers here to any camera setting which combines rectangular
00288 #  neighborhoods of pixels into larger "super-pixels." It reduces the
00289 #  resolution of the output image to
00290 #  (width / binning_x) x (height / binning_y).
00291 # The default values binning_x = binning_y = 0 is considered the same
00292 #  as binning_x = binning_y = 1 (no subsampling).
00293 uint32 binning_x
00294 uint32 binning_y
00295 
00296 # Region of interest (subwindow of full camera resolution), given in
00297 #  full resolution (unbinned) image coordinates. A particular ROI
00298 #  always denotes the same window of pixels on the camera sensor,
00299 #  regardless of binning settings.
00300 # The default setting of roi (all values 0) is considered the same as
00301 #  full resolution (roi.width = width, roi.height = height).
00302 RegionOfInterest roi
00303 
00304 ================================================================================
00305 MSG: std_msgs/Header
00306 # Standard metadata for higher-level stamped data types.
00307 # This is generally used to communicate timestamped data 
00308 # in a particular coordinate frame.
00309 # 
00310 # sequence ID: consecutively increasing ID 
00311 uint32 seq
00312 #Two-integer timestamp that is expressed as:
00313 # * stamp.secs: seconds (stamp_secs) since epoch
00314 # * stamp.nsecs: nanoseconds since stamp_secs
00315 # time-handling sugar is provided by the client library
00316 time stamp
00317 #Frame this data is associated with
00318 # 0: no frame
00319 # 1: global frame
00320 string frame_id
00321 
00322 ================================================================================
00323 MSG: sensor_msgs/RegionOfInterest
00324 # This message is used to specify a region of interest within an image.
00325 #
00326 # When used to specify the ROI setting of the camera when the image was
00327 # taken, the height and width fields should either match the height and
00328 # width fields for the associated image; or height = width = 0
00329 # indicates that the full resolution image was captured.
00330 
00331 uint32 x_offset  # Leftmost pixel of the ROI
00332                  # (0 if the ROI includes the left edge of the image)
00333 uint32 y_offset  # Topmost pixel of the ROI
00334                  # (0 if the ROI includes the top edge of the image)
00335 uint32 height    # Height of ROI
00336 uint32 width     # Width of ROI
00337 
00338 # True if a distinct rectified ROI should be calculated from the "raw"
00339 # ROI in this message. Typically this should be False if the full image
00340 # is captured (ROI not used), and True if a subwindow is captured (ROI
00341 # used).
00342 bool do_rectify
00343 
00344 """
00345   __slots__ = ['info']
00346   _slot_types = ['sensor_msgs/CameraInfo']
00347 
00348   def __init__(self, *args, **kwds):
00349     """
00350     Constructor. Any message fields that are implicitly/explicitly
00351     set to None will be assigned a default value. The recommend
00352     use is keyword arguments as this is more robust to future message
00353     changes.  You cannot mix in-order arguments and keyword arguments.
00354 
00355     The available fields are:
00356        info
00357 
00358     :param args: complete set of field values, in .msg order
00359     :param kwds: use keyword arguments corresponding to message field names
00360     to set specific fields.
00361     """
00362     if args or kwds:
00363       super(GetCameraInfoResponse, self).__init__(*args, **kwds)
00364       #message fields cannot be None, assign default values for those that are
00365       if self.info is None:
00366         self.info = sensor_msgs.msg.CameraInfo()
00367     else:
00368       self.info = sensor_msgs.msg.CameraInfo()
00369 
00370   def _get_types(self):
00371     """
00372     internal API method
00373     """
00374     return self._slot_types
00375 
00376   def serialize(self, buff):
00377     """
00378     serialize message into buffer
00379     :param buff: buffer, ``StringIO``
00380     """
00381     try:
00382       _x = self
00383       buff.write(_struct_3I.pack(_x.info.header.seq, _x.info.header.stamp.secs, _x.info.header.stamp.nsecs))
00384       _x = self.info.header.frame_id
00385       length = len(_x)
00386       if python3 or type(_x) == unicode:
00387         _x = _x.encode('utf-8')
00388         length = len(_x)
00389       buff.write(struct.pack('<I%ss'%length, length, _x))
00390       _x = self
00391       buff.write(_struct_2I.pack(_x.info.height, _x.info.width))
00392       _x = self.info.distortion_model
00393       length = len(_x)
00394       if python3 or type(_x) == unicode:
00395         _x = _x.encode('utf-8')
00396         length = len(_x)
00397       buff.write(struct.pack('<I%ss'%length, length, _x))
00398       length = len(self.info.D)
00399       buff.write(_struct_I.pack(length))
00400       pattern = '<%sd'%length
00401       buff.write(struct.pack(pattern, *self.info.D))
00402       buff.write(_struct_9d.pack(*self.info.K))
00403       buff.write(_struct_9d.pack(*self.info.R))
00404       buff.write(_struct_12d.pack(*self.info.P))
00405       _x = self
00406       buff.write(_struct_6IB.pack(_x.info.binning_x, _x.info.binning_y, _x.info.roi.x_offset, _x.info.roi.y_offset, _x.info.roi.height, _x.info.roi.width, _x.info.roi.do_rectify))
00407     except struct.error as se: self._check_types(se)
00408     except TypeError as te: self._check_types(te)
00409 
00410   def deserialize(self, str):
00411     """
00412     unpack serialized message in str into this message instance
00413     :param str: byte array of serialized message, ``str``
00414     """
00415     try:
00416       if self.info is None:
00417         self.info = sensor_msgs.msg.CameraInfo()
00418       end = 0
00419       _x = self
00420       start = end
00421       end += 12
00422       (_x.info.header.seq, _x.info.header.stamp.secs, _x.info.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00423       start = end
00424       end += 4
00425       (length,) = _struct_I.unpack(str[start:end])
00426       start = end
00427       end += length
00428       if python3:
00429         self.info.header.frame_id = str[start:end].decode('utf-8')
00430       else:
00431         self.info.header.frame_id = str[start:end]
00432       _x = self
00433       start = end
00434       end += 8
00435       (_x.info.height, _x.info.width,) = _struct_2I.unpack(str[start:end])
00436       start = end
00437       end += 4
00438       (length,) = _struct_I.unpack(str[start:end])
00439       start = end
00440       end += length
00441       if python3:
00442         self.info.distortion_model = str[start:end].decode('utf-8')
00443       else:
00444         self.info.distortion_model = str[start:end]
00445       start = end
00446       end += 4
00447       (length,) = _struct_I.unpack(str[start:end])
00448       pattern = '<%sd'%length
00449       start = end
00450       end += struct.calcsize(pattern)
00451       self.info.D = struct.unpack(pattern, str[start:end])
00452       start = end
00453       end += 72
00454       self.info.K = _struct_9d.unpack(str[start:end])
00455       start = end
00456       end += 72
00457       self.info.R = _struct_9d.unpack(str[start:end])
00458       start = end
00459       end += 96
00460       self.info.P = _struct_12d.unpack(str[start:end])
00461       _x = self
00462       start = end
00463       end += 25
00464       (_x.info.binning_x, _x.info.binning_y, _x.info.roi.x_offset, _x.info.roi.y_offset, _x.info.roi.height, _x.info.roi.width, _x.info.roi.do_rectify,) = _struct_6IB.unpack(str[start:end])
00465       self.info.roi.do_rectify = bool(self.info.roi.do_rectify)
00466       return self
00467     except struct.error as e:
00468       raise genpy.DeserializationError(e) #most likely buffer underfill
00469 
00470 
00471   def serialize_numpy(self, buff, numpy):
00472     """
00473     serialize message with numpy array types into buffer
00474     :param buff: buffer, ``StringIO``
00475     :param numpy: numpy python module
00476     """
00477     try:
00478       _x = self
00479       buff.write(_struct_3I.pack(_x.info.header.seq, _x.info.header.stamp.secs, _x.info.header.stamp.nsecs))
00480       _x = self.info.header.frame_id
00481       length = len(_x)
00482       if python3 or type(_x) == unicode:
00483         _x = _x.encode('utf-8')
00484         length = len(_x)
00485       buff.write(struct.pack('<I%ss'%length, length, _x))
00486       _x = self
00487       buff.write(_struct_2I.pack(_x.info.height, _x.info.width))
00488       _x = self.info.distortion_model
00489       length = len(_x)
00490       if python3 or type(_x) == unicode:
00491         _x = _x.encode('utf-8')
00492         length = len(_x)
00493       buff.write(struct.pack('<I%ss'%length, length, _x))
00494       length = len(self.info.D)
00495       buff.write(_struct_I.pack(length))
00496       pattern = '<%sd'%length
00497       buff.write(self.info.D.tostring())
00498       buff.write(self.info.K.tostring())
00499       buff.write(self.info.R.tostring())
00500       buff.write(self.info.P.tostring())
00501       _x = self
00502       buff.write(_struct_6IB.pack(_x.info.binning_x, _x.info.binning_y, _x.info.roi.x_offset, _x.info.roi.y_offset, _x.info.roi.height, _x.info.roi.width, _x.info.roi.do_rectify))
00503     except struct.error as se: self._check_types(se)
00504     except TypeError as te: self._check_types(te)
00505 
00506   def deserialize_numpy(self, str, numpy):
00507     """
00508     unpack serialized message in str into this message instance using numpy for array types
00509     :param str: byte array of serialized message, ``str``
00510     :param numpy: numpy python module
00511     """
00512     try:
00513       if self.info is None:
00514         self.info = sensor_msgs.msg.CameraInfo()
00515       end = 0
00516       _x = self
00517       start = end
00518       end += 12
00519       (_x.info.header.seq, _x.info.header.stamp.secs, _x.info.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00520       start = end
00521       end += 4
00522       (length,) = _struct_I.unpack(str[start:end])
00523       start = end
00524       end += length
00525       if python3:
00526         self.info.header.frame_id = str[start:end].decode('utf-8')
00527       else:
00528         self.info.header.frame_id = str[start:end]
00529       _x = self
00530       start = end
00531       end += 8
00532       (_x.info.height, _x.info.width,) = _struct_2I.unpack(str[start:end])
00533       start = end
00534       end += 4
00535       (length,) = _struct_I.unpack(str[start:end])
00536       start = end
00537       end += length
00538       if python3:
00539         self.info.distortion_model = str[start:end].decode('utf-8')
00540       else:
00541         self.info.distortion_model = str[start:end]
00542       start = end
00543       end += 4
00544       (length,) = _struct_I.unpack(str[start:end])
00545       pattern = '<%sd'%length
00546       start = end
00547       end += struct.calcsize(pattern)
00548       self.info.D = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00549       start = end
00550       end += 72
00551       self.info.K = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9)
00552       start = end
00553       end += 72
00554       self.info.R = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9)
00555       start = end
00556       end += 96
00557       self.info.P = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=12)
00558       _x = self
00559       start = end
00560       end += 25
00561       (_x.info.binning_x, _x.info.binning_y, _x.info.roi.x_offset, _x.info.roi.y_offset, _x.info.roi.height, _x.info.roi.width, _x.info.roi.do_rectify,) = _struct_6IB.unpack(str[start:end])
00562       self.info.roi.do_rectify = bool(self.info.roi.do_rectify)
00563       return self
00564     except struct.error as e:
00565       raise genpy.DeserializationError(e) #most likely buffer underfill
00566 
00567 _struct_I = genpy.struct_I
00568 _struct_6IB = struct.Struct("<6IB")
00569 _struct_3I = struct.Struct("<3I")
00570 _struct_12d = struct.Struct("<12d")
00571 _struct_2I = struct.Struct("<2I")
00572 _struct_9d = struct.Struct("<9d")
00573 class GetCameraInfo(object):
00574   _type          = 'pr2_clutter_helper/GetCameraInfo'
00575   _md5sum = '75a8d4fa267e2c751b523292013a06ab'
00576   _request_class  = GetCameraInfoRequest
00577   _response_class = GetCameraInfoResponse


pr2_clutter_helper
Author(s): Jason Okerman, Advisors: Prof. Charlie Kemp and Jim Regh, Lab: Healthcare Robotics Lab at Georgia Tech
autogenerated on Wed Nov 27 2013 11:53:06