00001 """autogenerated by genmsg_py from CalibrationEstimate.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import camera_pose_calibration.msg
00006 import geometry_msgs.msg
00007 import std_msgs.msg
00008
00009 class CalibrationEstimate(roslib.message.Message):
00010 _md5sum = "35dff6bdb713fbc8b83861a1960b45f5"
00011 _type = "camera_pose_calibration/CalibrationEstimate"
00012 _has_header = True
00013 _full_text = """Header header
00014 CameraPose[] cameras
00015 geometry_msgs/Pose[] targets
00016
00017 ================================================================================
00018 MSG: std_msgs/Header
00019 # Standard metadata for higher-level stamped data types.
00020 # This is generally used to communicate timestamped data
00021 # in a particular coordinate frame.
00022 #
00023 # sequence ID: consecutively increasing ID
00024 uint32 seq
00025 #Two-integer timestamp that is expressed as:
00026 # * stamp.secs: seconds (stamp_secs) since epoch
00027 # * stamp.nsecs: nanoseconds since stamp_secs
00028 # time-handling sugar is provided by the client library
00029 time stamp
00030 #Frame this data is associated with
00031 # 0: no frame
00032 # 1: global frame
00033 string frame_id
00034
00035 ================================================================================
00036 MSG: camera_pose_calibration/CameraPose
00037 string camera_id
00038 geometry_msgs/Pose pose
00039
00040 ================================================================================
00041 MSG: geometry_msgs/Pose
00042 # A representation of pose in free space, composed of postion and orientation.
00043 Point position
00044 Quaternion orientation
00045
00046 ================================================================================
00047 MSG: geometry_msgs/Point
00048 # This contains the position of a point in free space
00049 float64 x
00050 float64 y
00051 float64 z
00052
00053 ================================================================================
00054 MSG: geometry_msgs/Quaternion
00055 # This represents an orientation in free space in quaternion form.
00056
00057 float64 x
00058 float64 y
00059 float64 z
00060 float64 w
00061
00062 """
00063 __slots__ = ['header','cameras','targets']
00064 _slot_types = ['Header','camera_pose_calibration/CameraPose[]','geometry_msgs/Pose[]']
00065
00066 def __init__(self, *args, **kwds):
00067 """
00068 Constructor. Any message fields that are implicitly/explicitly
00069 set to None will be assigned a default value. The recommend
00070 use is keyword arguments as this is more robust to future message
00071 changes. You cannot mix in-order arguments and keyword arguments.
00072
00073 The available fields are:
00074 header,cameras,targets
00075
00076 @param args: complete set of field values, in .msg order
00077 @param kwds: use keyword arguments corresponding to message field names
00078 to set specific fields.
00079 """
00080 if args or kwds:
00081 super(CalibrationEstimate, self).__init__(*args, **kwds)
00082
00083 if self.header is None:
00084 self.header = std_msgs.msg._Header.Header()
00085 if self.cameras is None:
00086 self.cameras = []
00087 if self.targets is None:
00088 self.targets = []
00089 else:
00090 self.header = std_msgs.msg._Header.Header()
00091 self.cameras = []
00092 self.targets = []
00093
00094 def _get_types(self):
00095 """
00096 internal API method
00097 """
00098 return self._slot_types
00099
00100 def serialize(self, buff):
00101 """
00102 serialize message into buffer
00103 @param buff: buffer
00104 @type buff: StringIO
00105 """
00106 try:
00107 _x = self
00108 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00109 _x = self.header.frame_id
00110 length = len(_x)
00111 buff.write(struct.pack('<I%ss'%length, length, _x))
00112 length = len(self.cameras)
00113 buff.write(_struct_I.pack(length))
00114 for val1 in self.cameras:
00115 _x = val1.camera_id
00116 length = len(_x)
00117 buff.write(struct.pack('<I%ss'%length, length, _x))
00118 _v1 = val1.pose
00119 _v2 = _v1.position
00120 _x = _v2
00121 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00122 _v3 = _v1.orientation
00123 _x = _v3
00124 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00125 length = len(self.targets)
00126 buff.write(_struct_I.pack(length))
00127 for val1 in self.targets:
00128 _v4 = val1.position
00129 _x = _v4
00130 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00131 _v5 = val1.orientation
00132 _x = _v5
00133 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00134 except struct.error, se: self._check_types(se)
00135 except TypeError, te: self._check_types(te)
00136
00137 def deserialize(self, str):
00138 """
00139 unpack serialized message in str into this message instance
00140 @param str: byte array of serialized message
00141 @type str: str
00142 """
00143 try:
00144 if self.header is None:
00145 self.header = std_msgs.msg._Header.Header()
00146 end = 0
00147 _x = self
00148 start = end
00149 end += 12
00150 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00151 start = end
00152 end += 4
00153 (length,) = _struct_I.unpack(str[start:end])
00154 start = end
00155 end += length
00156 self.header.frame_id = str[start:end]
00157 start = end
00158 end += 4
00159 (length,) = _struct_I.unpack(str[start:end])
00160 self.cameras = []
00161 for i in xrange(0, length):
00162 val1 = camera_pose_calibration.msg.CameraPose()
00163 start = end
00164 end += 4
00165 (length,) = _struct_I.unpack(str[start:end])
00166 start = end
00167 end += length
00168 val1.camera_id = str[start:end]
00169 _v6 = val1.pose
00170 _v7 = _v6.position
00171 _x = _v7
00172 start = end
00173 end += 24
00174 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00175 _v8 = _v6.orientation
00176 _x = _v8
00177 start = end
00178 end += 32
00179 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00180 self.cameras.append(val1)
00181 start = end
00182 end += 4
00183 (length,) = _struct_I.unpack(str[start:end])
00184 self.targets = []
00185 for i in xrange(0, length):
00186 val1 = geometry_msgs.msg.Pose()
00187 _v9 = val1.position
00188 _x = _v9
00189 start = end
00190 end += 24
00191 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00192 _v10 = val1.orientation
00193 _x = _v10
00194 start = end
00195 end += 32
00196 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00197 self.targets.append(val1)
00198 return self
00199 except struct.error, e:
00200 raise roslib.message.DeserializationError(e)
00201
00202
00203 def serialize_numpy(self, buff, numpy):
00204 """
00205 serialize message with numpy array types into buffer
00206 @param buff: buffer
00207 @type buff: StringIO
00208 @param numpy: numpy python module
00209 @type numpy module
00210 """
00211 try:
00212 _x = self
00213 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00214 _x = self.header.frame_id
00215 length = len(_x)
00216 buff.write(struct.pack('<I%ss'%length, length, _x))
00217 length = len(self.cameras)
00218 buff.write(_struct_I.pack(length))
00219 for val1 in self.cameras:
00220 _x = val1.camera_id
00221 length = len(_x)
00222 buff.write(struct.pack('<I%ss'%length, length, _x))
00223 _v11 = val1.pose
00224 _v12 = _v11.position
00225 _x = _v12
00226 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00227 _v13 = _v11.orientation
00228 _x = _v13
00229 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00230 length = len(self.targets)
00231 buff.write(_struct_I.pack(length))
00232 for val1 in self.targets:
00233 _v14 = val1.position
00234 _x = _v14
00235 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00236 _v15 = val1.orientation
00237 _x = _v15
00238 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00239 except struct.error, se: self._check_types(se)
00240 except TypeError, te: self._check_types(te)
00241
00242 def deserialize_numpy(self, str, numpy):
00243 """
00244 unpack serialized message in str into this message instance using numpy for array types
00245 @param str: byte array of serialized message
00246 @type str: str
00247 @param numpy: numpy python module
00248 @type numpy: module
00249 """
00250 try:
00251 if self.header is None:
00252 self.header = std_msgs.msg._Header.Header()
00253 end = 0
00254 _x = self
00255 start = end
00256 end += 12
00257 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00258 start = end
00259 end += 4
00260 (length,) = _struct_I.unpack(str[start:end])
00261 start = end
00262 end += length
00263 self.header.frame_id = str[start:end]
00264 start = end
00265 end += 4
00266 (length,) = _struct_I.unpack(str[start:end])
00267 self.cameras = []
00268 for i in xrange(0, length):
00269 val1 = camera_pose_calibration.msg.CameraPose()
00270 start = end
00271 end += 4
00272 (length,) = _struct_I.unpack(str[start:end])
00273 start = end
00274 end += length
00275 val1.camera_id = str[start:end]
00276 _v16 = val1.pose
00277 _v17 = _v16.position
00278 _x = _v17
00279 start = end
00280 end += 24
00281 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00282 _v18 = _v16.orientation
00283 _x = _v18
00284 start = end
00285 end += 32
00286 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00287 self.cameras.append(val1)
00288 start = end
00289 end += 4
00290 (length,) = _struct_I.unpack(str[start:end])
00291 self.targets = []
00292 for i in xrange(0, length):
00293 val1 = geometry_msgs.msg.Pose()
00294 _v19 = val1.position
00295 _x = _v19
00296 start = end
00297 end += 24
00298 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00299 _v20 = val1.orientation
00300 _x = _v20
00301 start = end
00302 end += 32
00303 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00304 self.targets.append(val1)
00305 return self
00306 except struct.error, e:
00307 raise roslib.message.DeserializationError(e)
00308
00309 _struct_I = roslib.message.struct_I
00310 _struct_3I = struct.Struct("<3I")
00311 _struct_4d = struct.Struct("<4d")
00312 _struct_3d = struct.Struct("<3d")