提交 14e408a1 编写于 作者: Z zhouyao 提交者: Liangliang Zhang

fix order of fstream operation

上级 c22b6eda
......@@ -79,9 +79,10 @@ void PosesInterpolation::LoadPCDTimestamp() {
void PosesInterpolation::WritePCDPoses() {
std::ofstream fout;
fout.open(out_poses_path_.c_str(), std::ofstream::out);
fout.setf(std::ios::fixed, std::ios::floatfield);
if (fout.is_open()) {
fout.setf(std::ios::fixed, std::ios::floatfield);
fout.precision(6);
for (size_t i = 0; i < out_poses_.size(); i++) {
double timestamp = out_timestamps_[i];
......@@ -93,11 +94,11 @@ void PosesInterpolation::WritePCDPoses() {
double qz = quatd.z();
double qr = quatd.w();
fout.precision(6);
fout << out_indexes_[i] << " " << timestamp << " " << transd.x() << " "
<< transd.y() << " " << transd.z() << " " << qx << " " << qy << " "
<< qz << " " << qr << "\n";
}
fout.close();
} else {
std::cerr << "Can't open file to write: " << out_poses_path_ << std::endl;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册