_VirtualCameraParameters.py
Go to the documentation of this file.
00001 """autogenerated by genpy from virtual_camera/VirtualCameraParameters.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 VirtualCameraParameters(genpy.Message):
00009   _md5sum = "f3a12fac277c51870b3fd0aa037b2622"
00010   _type = "virtual_camera/VirtualCameraParameters"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """#Distance of lookat points of this camera
00013 float64 approxDistance
00014 # Viewport width, in pixels.
00015 int32 viewportWidth
00016 # Viewport height, in pixels.
00017 int32 viewportHeight
00018 #Frame_ID of the frame the camera frame is positioned in
00019 string parentFrameId
00020 #X position of the camera in the parent frame
00021 float64 posX
00022 #Y position of the camera in the parent frame
00023 float64 posY
00024 #Z position of the camera in the parent frame
00025 float64 posZ
00026 # Horizontal pan (i.e. azimuth) of the camera, in degrees.
00027 # Angular displacement measured from the positive x axis of the /omnicam frame.
00028 # Positive pan corresponds to looking left.
00029 float64 pan
00030 # Vertical tilt (i.e. elevation) of the camera, in degrees.
00031 # Angular displacement measured from the x-y plane of the /omnicam frame.
00032 # Positive tilt corresponds to looking up.
00033 float64 tilt
00034 # Field of view in horizontal direction, fills the viewport in horizontal direction, in degrees.
00035 float64 horizontalFov
00036 # Field of view in vertical direction, fills the viewport in vertical direction, in degrees.
00037 float64 verticalFov
00038 #encoding of the cameras image. Currently supported 
00039 #encodings are(case sensitive): bgr8
00040 string encoding
00041 # Camera frame rate
00042 float64 frameRate
00043 #Camera model. Possible values: pinhole, cylindric, spherical.
00044 #If the value is invalid then the pinhole camera model is used.
00045 string model
00046 # Whether to compose images only when the source timestamps are the same.
00047 #0 for not synchronizing, 1 for synchronizing
00048 int32 synchronize
00049 
00050 
00051 """
00052   __slots__ = ['approxDistance','viewportWidth','viewportHeight','parentFrameId','posX','posY','posZ','pan','tilt','horizontalFov','verticalFov','encoding','frameRate','model','synchronize']
00053   _slot_types = ['float64','int32','int32','string','float64','float64','float64','float64','float64','float64','float64','string','float64','string','int32']
00054 
00055   def __init__(self, *args, **kwds):
00056     """
00057     Constructor. Any message fields that are implicitly/explicitly
00058     set to None will be assigned a default value. The recommend
00059     use is keyword arguments as this is more robust to future message
00060     changes.  You cannot mix in-order arguments and keyword arguments.
00061 
00062     The available fields are:
00063        approxDistance,viewportWidth,viewportHeight,parentFrameId,posX,posY,posZ,pan,tilt,horizontalFov,verticalFov,encoding,frameRate,model,synchronize
00064 
00065     :param args: complete set of field values, in .msg order
00066     :param kwds: use keyword arguments corresponding to message field names
00067     to set specific fields.
00068     """
00069     if args or kwds:
00070       super(VirtualCameraParameters, self).__init__(*args, **kwds)
00071       #message fields cannot be None, assign default values for those that are
00072       if self.approxDistance is None:
00073         self.approxDistance = 0.
00074       if self.viewportWidth is None:
00075         self.viewportWidth = 0
00076       if self.viewportHeight is None:
00077         self.viewportHeight = 0
00078       if self.parentFrameId is None:
00079         self.parentFrameId = ''
00080       if self.posX is None:
00081         self.posX = 0.
00082       if self.posY is None:
00083         self.posY = 0.
00084       if self.posZ is None:
00085         self.posZ = 0.
00086       if self.pan is None:
00087         self.pan = 0.
00088       if self.tilt is None:
00089         self.tilt = 0.
00090       if self.horizontalFov is None:
00091         self.horizontalFov = 0.
00092       if self.verticalFov is None:
00093         self.verticalFov = 0.
00094       if self.encoding is None:
00095         self.encoding = ''
00096       if self.frameRate is None:
00097         self.frameRate = 0.
00098       if self.model is None:
00099         self.model = ''
00100       if self.synchronize is None:
00101         self.synchronize = 0
00102     else:
00103       self.approxDistance = 0.
00104       self.viewportWidth = 0
00105       self.viewportHeight = 0
00106       self.parentFrameId = ''
00107       self.posX = 0.
00108       self.posY = 0.
00109       self.posZ = 0.
00110       self.pan = 0.
00111       self.tilt = 0.
00112       self.horizontalFov = 0.
00113       self.verticalFov = 0.
00114       self.encoding = ''
00115       self.frameRate = 0.
00116       self.model = ''
00117       self.synchronize = 0
00118 
00119   def _get_types(self):
00120     """
00121     internal API method
00122     """
00123     return self._slot_types
00124 
00125   def serialize(self, buff):
00126     """
00127     serialize message into buffer
00128     :param buff: buffer, ``StringIO``
00129     """
00130     try:
00131       _x = self
00132       buff.write(_struct_d2i.pack(_x.approxDistance, _x.viewportWidth, _x.viewportHeight))
00133       _x = self.parentFrameId
00134       length = len(_x)
00135       if python3 or type(_x) == unicode:
00136         _x = _x.encode('utf-8')
00137         length = len(_x)
00138       buff.write(struct.pack('<I%ss'%length, length, _x))
00139       _x = self
00140       buff.write(_struct_7d.pack(_x.posX, _x.posY, _x.posZ, _x.pan, _x.tilt, _x.horizontalFov, _x.verticalFov))
00141       _x = self.encoding
00142       length = len(_x)
00143       if python3 or type(_x) == unicode:
00144         _x = _x.encode('utf-8')
00145         length = len(_x)
00146       buff.write(struct.pack('<I%ss'%length, length, _x))
00147       buff.write(_struct_d.pack(self.frameRate))
00148       _x = self.model
00149       length = len(_x)
00150       if python3 or type(_x) == unicode:
00151         _x = _x.encode('utf-8')
00152         length = len(_x)
00153       buff.write(struct.pack('<I%ss'%length, length, _x))
00154       buff.write(_struct_i.pack(self.synchronize))
00155     except struct.error as se: self._check_types(se)
00156     except TypeError as te: self._check_types(te)
00157 
00158   def deserialize(self, str):
00159     """
00160     unpack serialized message in str into this message instance
00161     :param str: byte array of serialized message, ``str``
00162     """
00163     try:
00164       end = 0
00165       _x = self
00166       start = end
00167       end += 16
00168       (_x.approxDistance, _x.viewportWidth, _x.viewportHeight,) = _struct_d2i.unpack(str[start:end])
00169       start = end
00170       end += 4
00171       (length,) = _struct_I.unpack(str[start:end])
00172       start = end
00173       end += length
00174       if python3:
00175         self.parentFrameId = str[start:end].decode('utf-8')
00176       else:
00177         self.parentFrameId = str[start:end]
00178       _x = self
00179       start = end
00180       end += 56
00181       (_x.posX, _x.posY, _x.posZ, _x.pan, _x.tilt, _x.horizontalFov, _x.verticalFov,) = _struct_7d.unpack(str[start:end])
00182       start = end
00183       end += 4
00184       (length,) = _struct_I.unpack(str[start:end])
00185       start = end
00186       end += length
00187       if python3:
00188         self.encoding = str[start:end].decode('utf-8')
00189       else:
00190         self.encoding = str[start:end]
00191       start = end
00192       end += 8
00193       (self.frameRate,) = _struct_d.unpack(str[start:end])
00194       start = end
00195       end += 4
00196       (length,) = _struct_I.unpack(str[start:end])
00197       start = end
00198       end += length
00199       if python3:
00200         self.model = str[start:end].decode('utf-8')
00201       else:
00202         self.model = str[start:end]
00203       start = end
00204       end += 4
00205       (self.synchronize,) = _struct_i.unpack(str[start:end])
00206       return self
00207     except struct.error as e:
00208       raise genpy.DeserializationError(e) #most likely buffer underfill
00209 
00210 
00211   def serialize_numpy(self, buff, numpy):
00212     """
00213     serialize message with numpy array types into buffer
00214     :param buff: buffer, ``StringIO``
00215     :param numpy: numpy python module
00216     """
00217     try:
00218       _x = self
00219       buff.write(_struct_d2i.pack(_x.approxDistance, _x.viewportWidth, _x.viewportHeight))
00220       _x = self.parentFrameId
00221       length = len(_x)
00222       if python3 or type(_x) == unicode:
00223         _x = _x.encode('utf-8')
00224         length = len(_x)
00225       buff.write(struct.pack('<I%ss'%length, length, _x))
00226       _x = self
00227       buff.write(_struct_7d.pack(_x.posX, _x.posY, _x.posZ, _x.pan, _x.tilt, _x.horizontalFov, _x.verticalFov))
00228       _x = self.encoding
00229       length = len(_x)
00230       if python3 or type(_x) == unicode:
00231         _x = _x.encode('utf-8')
00232         length = len(_x)
00233       buff.write(struct.pack('<I%ss'%length, length, _x))
00234       buff.write(_struct_d.pack(self.frameRate))
00235       _x = self.model
00236       length = len(_x)
00237       if python3 or type(_x) == unicode:
00238         _x = _x.encode('utf-8')
00239         length = len(_x)
00240       buff.write(struct.pack('<I%ss'%length, length, _x))
00241       buff.write(_struct_i.pack(self.synchronize))
00242     except struct.error as se: self._check_types(se)
00243     except TypeError as te: self._check_types(te)
00244 
00245   def deserialize_numpy(self, str, numpy):
00246     """
00247     unpack serialized message in str into this message instance using numpy for array types
00248     :param str: byte array of serialized message, ``str``
00249     :param numpy: numpy python module
00250     """
00251     try:
00252       end = 0
00253       _x = self
00254       start = end
00255       end += 16
00256       (_x.approxDistance, _x.viewportWidth, _x.viewportHeight,) = _struct_d2i.unpack(str[start:end])
00257       start = end
00258       end += 4
00259       (length,) = _struct_I.unpack(str[start:end])
00260       start = end
00261       end += length
00262       if python3:
00263         self.parentFrameId = str[start:end].decode('utf-8')
00264       else:
00265         self.parentFrameId = str[start:end]
00266       _x = self
00267       start = end
00268       end += 56
00269       (_x.posX, _x.posY, _x.posZ, _x.pan, _x.tilt, _x.horizontalFov, _x.verticalFov,) = _struct_7d.unpack(str[start:end])
00270       start = end
00271       end += 4
00272       (length,) = _struct_I.unpack(str[start:end])
00273       start = end
00274       end += length
00275       if python3:
00276         self.encoding = str[start:end].decode('utf-8')
00277       else:
00278         self.encoding = str[start:end]
00279       start = end
00280       end += 8
00281       (self.frameRate,) = _struct_d.unpack(str[start:end])
00282       start = end
00283       end += 4
00284       (length,) = _struct_I.unpack(str[start:end])
00285       start = end
00286       end += length
00287       if python3:
00288         self.model = str[start:end].decode('utf-8')
00289       else:
00290         self.model = str[start:end]
00291       start = end
00292       end += 4
00293       (self.synchronize,) = _struct_i.unpack(str[start:end])
00294       return self
00295     except struct.error as e:
00296       raise genpy.DeserializationError(e) #most likely buffer underfill
00297 
00298 _struct_I = genpy.struct_I
00299 _struct_d2i = struct.Struct("<d2i")
00300 _struct_i = struct.Struct("<i")
00301 _struct_7d = struct.Struct("<7d")
00302 _struct_d = struct.Struct("<d")
 All Classes Namespaces Files Functions Variables Typedefs Defines


virtual_camera
Author(s): Jan Brabec; maintained by Tomas Petricek / petrito1@cmp.felk.cvut
autogenerated on Tue Dec 10 2013 14:58:11