00001 """autogenerated by genmsg_py from CameraCalibration.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geometry_msgs.msg
00006
00007 class CameraCalibration(roslib.message.Message):
00008 _md5sum = "7c56b4c541b0941c246e565a97eb5388"
00009 _type = "camera_pose_calibration/CameraCalibration"
00010 _has_header = False
00011 _full_text = """geometry_msgs/Pose[] camera_pose
00012 string[] camera_id
00013 ================================================================================
00014 MSG: geometry_msgs/Pose
00015 # A representation of pose in free space, composed of postion and orientation.
00016 Point position
00017 Quaternion orientation
00018
00019 ================================================================================
00020 MSG: geometry_msgs/Point
00021 # This contains the position of a point in free space
00022 float64 x
00023 float64 y
00024 float64 z
00025
00026 ================================================================================
00027 MSG: geometry_msgs/Quaternion
00028 # This represents an orientation in free space in quaternion form.
00029
00030 float64 x
00031 float64 y
00032 float64 z
00033 float64 w
00034
00035 """
00036 __slots__ = ['camera_pose','camera_id']
00037 _slot_types = ['geometry_msgs/Pose[]','string[]']
00038
00039 def __init__(self, *args, **kwds):
00040 """
00041 Constructor. Any message fields that are implicitly/explicitly
00042 set to None will be assigned a default value. The recommend
00043 use is keyword arguments as this is more robust to future message
00044 changes. You cannot mix in-order arguments and keyword arguments.
00045
00046 The available fields are:
00047 camera_pose,camera_id
00048
00049 @param args: complete set of field values, in .msg order
00050 @param kwds: use keyword arguments corresponding to message field names
00051 to set specific fields.
00052 """
00053 if args or kwds:
00054 super(CameraCalibration, self).__init__(*args, **kwds)
00055
00056 if self.camera_pose is None:
00057 self.camera_pose = []
00058 if self.camera_id is None:
00059 self.camera_id = []
00060 else:
00061 self.camera_pose = []
00062 self.camera_id = []
00063
00064 def _get_types(self):
00065 """
00066 internal API method
00067 """
00068 return self._slot_types
00069
00070 def serialize(self, buff):
00071 """
00072 serialize message into buffer
00073 @param buff: buffer
00074 @type buff: StringIO
00075 """
00076 try:
00077 length = len(self.camera_pose)
00078 buff.write(_struct_I.pack(length))
00079 for val1 in self.camera_pose:
00080 _v1 = val1.position
00081 _x = _v1
00082 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00083 _v2 = val1.orientation
00084 _x = _v2
00085 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00086 length = len(self.camera_id)
00087 buff.write(_struct_I.pack(length))
00088 for val1 in self.camera_id:
00089 length = len(val1)
00090 buff.write(struct.pack('<I%ss'%length, length, val1))
00091 except struct.error, se: self._check_types(se)
00092 except TypeError, te: self._check_types(te)
00093
00094 def deserialize(self, str):
00095 """
00096 unpack serialized message in str into this message instance
00097 @param str: byte array of serialized message
00098 @type str: str
00099 """
00100 try:
00101 end = 0
00102 start = end
00103 end += 4
00104 (length,) = _struct_I.unpack(str[start:end])
00105 self.camera_pose = []
00106 for i in xrange(0, length):
00107 val1 = geometry_msgs.msg.Pose()
00108 _v3 = val1.position
00109 _x = _v3
00110 start = end
00111 end += 24
00112 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00113 _v4 = val1.orientation
00114 _x = _v4
00115 start = end
00116 end += 32
00117 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00118 self.camera_pose.append(val1)
00119 start = end
00120 end += 4
00121 (length,) = _struct_I.unpack(str[start:end])
00122 self.camera_id = []
00123 for i in xrange(0, length):
00124 start = end
00125 end += 4
00126 (length,) = _struct_I.unpack(str[start:end])
00127 start = end
00128 end += length
00129 val1 = str[start:end]
00130 self.camera_id.append(val1)
00131 return self
00132 except struct.error, e:
00133 raise roslib.message.DeserializationError(e)
00134
00135
00136 def serialize_numpy(self, buff, numpy):
00137 """
00138 serialize message with numpy array types into buffer
00139 @param buff: buffer
00140 @type buff: StringIO
00141 @param numpy: numpy python module
00142 @type numpy module
00143 """
00144 try:
00145 length = len(self.camera_pose)
00146 buff.write(_struct_I.pack(length))
00147 for val1 in self.camera_pose:
00148 _v5 = val1.position
00149 _x = _v5
00150 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00151 _v6 = val1.orientation
00152 _x = _v6
00153 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00154 length = len(self.camera_id)
00155 buff.write(_struct_I.pack(length))
00156 for val1 in self.camera_id:
00157 length = len(val1)
00158 buff.write(struct.pack('<I%ss'%length, length, val1))
00159 except struct.error, se: self._check_types(se)
00160 except TypeError, te: self._check_types(te)
00161
00162 def deserialize_numpy(self, str, numpy):
00163 """
00164 unpack serialized message in str into this message instance using numpy for array types
00165 @param str: byte array of serialized message
00166 @type str: str
00167 @param numpy: numpy python module
00168 @type numpy: module
00169 """
00170 try:
00171 end = 0
00172 start = end
00173 end += 4
00174 (length,) = _struct_I.unpack(str[start:end])
00175 self.camera_pose = []
00176 for i in xrange(0, length):
00177 val1 = geometry_msgs.msg.Pose()
00178 _v7 = val1.position
00179 _x = _v7
00180 start = end
00181 end += 24
00182 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00183 _v8 = val1.orientation
00184 _x = _v8
00185 start = end
00186 end += 32
00187 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00188 self.camera_pose.append(val1)
00189 start = end
00190 end += 4
00191 (length,) = _struct_I.unpack(str[start:end])
00192 self.camera_id = []
00193 for i in xrange(0, length):
00194 start = end
00195 end += 4
00196 (length,) = _struct_I.unpack(str[start:end])
00197 start = end
00198 end += length
00199 val1 = str[start:end]
00200 self.camera_id.append(val1)
00201 return self
00202 except struct.error, e:
00203 raise roslib.message.DeserializationError(e)
00204
00205 _struct_I = roslib.message.struct_I
00206 _struct_4d = struct.Struct("<4d")
00207 _struct_3d = struct.Struct("<3d")