头文件可以根据函数去搜一下:
写入txt并且后面加了重复的次数用于处理
std::ofstream fout("recordData.txt");
fout << pFound[maxZ].centerXmm << " "
<< pFound[maxZ].centerYmm << " "
<< pFound[maxZ].centerZmm << " "
<< pFound[maxZ].rotX << " "
<< pFound[maxZ].rotY << " "
<< pFound[maxZ].rotZ << " "
<< std::to_string(repeatTime + 1) << std::endl;
fout.close();
读取坐标值:
std::ifstream fin("recordData.txt");
fin >> comparePos->X >> comparePos->Y >> comparePos->Z >> comparePos->Rx >> comparePos->Ry >> comparePos->Rz >> repeatTime;
fin.close();