robotology-playground/Robust-View-Graph-SLAM

About main.cpp

Closed this issue · 3 comments

  • line 65 : check ncams, probably without declaring it as static it will be 1 for every camera
    point_2d ( std::vector<double> a, std::vector<double> b, std::vector<int> c) : x(a), y(b), status(c) { ncams++; npts=x.size(); }.
  • line 102: in my opinion it is better to return the image points structure by reference, with a big number of cameras and points the return by copy it will be expensive.
  • line 133: Eigen::VectorXd Yz = Eigen::MatrixXd::Zero(7,7) ; why don't use a Eigen::MatrixXd Yz?
    I think that at the end the result is the same but it can be confusing.
  • line 191: as you said, the delete calls have to be moved to the destructor
  • the program crash when compute invA if A is not definite positive(?)

Line 133: the program crash using this declaration, it works with Eigen::MatrixXd Yz = Eigen::MatrixXd::Zero(7,7) ; PUSHED the code fixed

line 65: I've tested it and all the cameras has 1 as id, we have to fix it.

You have to initialise the information matrix with Zeros, this is important in order to guarantee numerical stability during optimisation.
This is why I initially used Eigen::MatrixXd::Zero(7,7).

main.cpp: is not an official code, its a test bed for the PwgOptimiser class, and the vision pipeline.
RecoverMoments: only supports positive definite at the moment, and has a memory leak.

main.cpp is not a class, and hence has no constructor/destructor.