rubengooj / stvo-pl

Stereo Visual Odometry by combining point and line segment features
GNU General Public License v3.0
222 stars 96 forks source link

How to save the estimated trajectory of kitti format #20

Closed weiningwei closed 3 years ago

weiningwei commented 3 years ago

In the function of sceneRepresentation.cpp bool sceneRepresentation::updateScene(list<PointFeature *> matched_pt, list<LineFeature *> matched_ls), after pose = pose + x_aux;, I added the following code: ` string savePath = "trajout.txt"; ofstream f; f.open(savePath.c_str(), ios::app); f << fixed; Eigen::Vector3d poseTran; Eigen::Vector3d t(pose.x(), pose.y(), pose.z()); poseTran = t; //cout << pose << endl;

Eigen::Matrix3d rotMat = pose.getRotationMatrix();
f << setprecision(7)
  << rotMat(0, 0) << " " << rotMat(0, 1) << " " << rotMat(0, 2) << " " << poseTran.x() << " "
  << rotMat(1, 0) << " " << rotMat(1, 1) << " " << rotMat(1, 2) << " " << poseTran.y() << " "
  << rotMat(2, 0) << " " << rotMat(2, 1) << " " << rotMat(2, 2) << " " << poseTran.z() << endl;
f << flush;
f.close();`

But the estimated trajectory has a large error from the groundtruth.