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