_CameraNode.py
Go to the documentation of this file.
00001 """autogenerated by genpy from sba/CameraNode.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 
00009 class CameraNode(genpy.Message):
00010   _md5sum = "0605774cb8ba22085a77f85c7154baa7"
00011   _type = "sba/CameraNode"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """# Node Parameters
00014 uint32 index
00015 
00016 # Contains a translation and rotation
00017 geometry_msgs/Transform transform
00018 
00019 # Camera parameters from the K matrix
00020 float64 fx
00021 float64 fy
00022 float64 cx
00023 float64 cy
00024 
00025 # Only relevant for a stereo camera
00026 float64 baseline
00027 
00028 # Whether the camera is fixed in space: i.e., its position is known
00029 bool fixed
00030 
00031 ================================================================================
00032 MSG: geometry_msgs/Transform
00033 # This represents the transform between two coordinate frames in free space.
00034 
00035 Vector3 translation
00036 Quaternion rotation
00037 
00038 ================================================================================
00039 MSG: geometry_msgs/Vector3
00040 # This represents a vector in free space. 
00041 
00042 float64 x
00043 float64 y
00044 float64 z
00045 ================================================================================
00046 MSG: geometry_msgs/Quaternion
00047 # This represents an orientation in free space in quaternion form.
00048 
00049 float64 x
00050 float64 y
00051 float64 z
00052 float64 w
00053 
00054 """
00055   __slots__ = ['index','transform','fx','fy','cx','cy','baseline','fixed']
00056   _slot_types = ['uint32','geometry_msgs/Transform','float64','float64','float64','float64','float64','bool']
00057 
00058   def __init__(self, *args, **kwds):
00059     """
00060     Constructor. Any message fields that are implicitly/explicitly
00061     set to None will be assigned a default value. The recommend
00062     use is keyword arguments as this is more robust to future message
00063     changes.  You cannot mix in-order arguments and keyword arguments.
00064 
00065     The available fields are:
00066        index,transform,fx,fy,cx,cy,baseline,fixed
00067 
00068     :param args: complete set of field values, in .msg order
00069     :param kwds: use keyword arguments corresponding to message field names
00070     to set specific fields.
00071     """
00072     if args or kwds:
00073       super(CameraNode, self).__init__(*args, **kwds)
00074       #message fields cannot be None, assign default values for those that are
00075       if self.index is None:
00076         self.index = 0
00077       if self.transform is None:
00078         self.transform = geometry_msgs.msg.Transform()
00079       if self.fx is None:
00080         self.fx = 0.
00081       if self.fy is None:
00082         self.fy = 0.
00083       if self.cx is None:
00084         self.cx = 0.
00085       if self.cy is None:
00086         self.cy = 0.
00087       if self.baseline is None:
00088         self.baseline = 0.
00089       if self.fixed is None:
00090         self.fixed = False
00091     else:
00092       self.index = 0
00093       self.transform = geometry_msgs.msg.Transform()
00094       self.fx = 0.
00095       self.fy = 0.
00096       self.cx = 0.
00097       self.cy = 0.
00098       self.baseline = 0.
00099       self.fixed = False
00100 
00101   def _get_types(self):
00102     """
00103     internal API method
00104     """
00105     return self._slot_types
00106 
00107   def serialize(self, buff):
00108     """
00109     serialize message into buffer
00110     :param buff: buffer, ``StringIO``
00111     """
00112     try:
00113       _x = self
00114       buff.write(_struct_I12dB.pack(_x.index, _x.transform.translation.x, _x.transform.translation.y, _x.transform.translation.z, _x.transform.rotation.x, _x.transform.rotation.y, _x.transform.rotation.z, _x.transform.rotation.w, _x.fx, _x.fy, _x.cx, _x.cy, _x.baseline, _x.fixed))
00115     except struct.error as se: self._check_types(se)
00116     except TypeError as te: self._check_types(te)
00117 
00118   def deserialize(self, str):
00119     """
00120     unpack serialized message in str into this message instance
00121     :param str: byte array of serialized message, ``str``
00122     """
00123     try:
00124       if self.transform is None:
00125         self.transform = geometry_msgs.msg.Transform()
00126       end = 0
00127       _x = self
00128       start = end
00129       end += 101
00130       (_x.index, _x.transform.translation.x, _x.transform.translation.y, _x.transform.translation.z, _x.transform.rotation.x, _x.transform.rotation.y, _x.transform.rotation.z, _x.transform.rotation.w, _x.fx, _x.fy, _x.cx, _x.cy, _x.baseline, _x.fixed,) = _struct_I12dB.unpack(str[start:end])
00131       self.fixed = bool(self.fixed)
00132       return self
00133     except struct.error as e:
00134       raise genpy.DeserializationError(e) #most likely buffer underfill
00135 
00136 
00137   def serialize_numpy(self, buff, numpy):
00138     """
00139     serialize message with numpy array types into buffer
00140     :param buff: buffer, ``StringIO``
00141     :param numpy: numpy python module
00142     """
00143     try:
00144       _x = self
00145       buff.write(_struct_I12dB.pack(_x.index, _x.transform.translation.x, _x.transform.translation.y, _x.transform.translation.z, _x.transform.rotation.x, _x.transform.rotation.y, _x.transform.rotation.z, _x.transform.rotation.w, _x.fx, _x.fy, _x.cx, _x.cy, _x.baseline, _x.fixed))
00146     except struct.error as se: self._check_types(se)
00147     except TypeError as te: self._check_types(te)
00148 
00149   def deserialize_numpy(self, str, numpy):
00150     """
00151     unpack serialized message in str into this message instance using numpy for array types
00152     :param str: byte array of serialized message, ``str``
00153     :param numpy: numpy python module
00154     """
00155     try:
00156       if self.transform is None:
00157         self.transform = geometry_msgs.msg.Transform()
00158       end = 0
00159       _x = self
00160       start = end
00161       end += 101
00162       (_x.index, _x.transform.translation.x, _x.transform.translation.y, _x.transform.translation.z, _x.transform.rotation.x, _x.transform.rotation.y, _x.transform.rotation.z, _x.transform.rotation.w, _x.fx, _x.fy, _x.cx, _x.cy, _x.baseline, _x.fixed,) = _struct_I12dB.unpack(str[start:end])
00163       self.fixed = bool(self.fixed)
00164       return self
00165     except struct.error as e:
00166       raise genpy.DeserializationError(e) #most likely buffer underfill
00167 
00168 _struct_I = genpy.struct_I
00169 _struct_I12dB = struct.Struct("<I12dB")


sba
Author(s): Kurt Konolige, Helen Oleynikova
autogenerated on Thu Jan 2 2014 12:12:08