Skip to content
Snippets Groups Projects
Commit 1193c14f authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

compiling

parent 47c49920
No related branches found
No related tags found
1 merge request!443Resolve "Work on const / non-const in wolf base classes"
Pipeline #9509 failed
...@@ -253,11 +253,11 @@ int main() ...@@ -253,11 +253,11 @@ int main()
// GET COVARIANCES of all states // GET COVARIANCES of all states
WOLF_TRACE("======== COVARIANCES OF SOLVED PROBLEM =======") WOLF_TRACE("======== COVARIANCES OF SOLVED PROBLEM =======")
ceres->computeCovariances(SolverManager::CovarianceBlocksToBeComputed::ALL_MARGINALS); ceres->computeCovariances(SolverManager::CovarianceBlocksToBeComputed::ALL_MARGINALS);
for (auto& kf : *problem->getTrajectory()) for (auto& kf_pair : problem->getTrajectory()->getFrameMap())
{ {
Eigen::MatrixXd cov; Eigen::MatrixXd cov;
kf->getCovariance(cov); kf_pair.second->getCovariance(cov);
WOLF_TRACE("KF", kf->id(), "_cov = \n", cov); WOLF_TRACE("KF", kf_pair.second->id(), "_cov = \n", cov);
} }
for (auto& lmk : problem->getMap()->getLandmarkList()) for (auto& lmk : problem->getMap()->getLandmarkList())
{ {
......
...@@ -243,11 +243,11 @@ int main() ...@@ -243,11 +243,11 @@ int main()
// GET COVARIANCES of all states // GET COVARIANCES of all states
WOLF_INFO("======== COVARIANCES OF SOLVED PROBLEM =======") WOLF_INFO("======== COVARIANCES OF SOLVED PROBLEM =======")
ceres->computeCovariances(SolverManager::CovarianceBlocksToBeComputed::ALL_MARGINALS); ceres->computeCovariances(SolverManager::CovarianceBlocksToBeComputed::ALL_MARGINALS);
for (auto& kf : *problem->getTrajectory()) for (auto& kf_pair : problem->getTrajectory()->getFrameMap())
{ {
Eigen::MatrixXd cov; Eigen::MatrixXd cov;
kf->getCovariance(cov); kf_pair.second->getCovariance(cov);
WOLF_INFO("KF", kf->id(), "_cov = \n", cov); WOLF_INFO("KF", kf_pair.second->id(), "_cov = \n", cov);
} }
for (auto& lmk : problem->getMap()->getLandmarkList()) for (auto& lmk : problem->getMap()->getLandmarkList())
{ {
......
...@@ -53,7 +53,8 @@ class FactorFeatureDummy : public FactorBase ...@@ -53,7 +53,8 @@ class FactorFeatureDummy : public FactorBase
/** \brief Returns a vector of pointers to the states in which this factor depends /** \brief Returns a vector of pointers to the states in which this factor depends
**/ **/
std::vector<StateBlockPtr> getStateBlockPtrVector() const override {return std::vector<StateBlockPtr>(0);} std::vector<StateBlockConstPtr> getStateBlockPtrVector() const override {return std::vector<StateBlockConstPtr>(0);}
std::vector<StateBlockPtr> getStateBlockPtrVector() override {return std::vector<StateBlockPtr>(0);}
/** \brief Returns the factor residual size /** \brief Returns the factor residual size
**/ **/
......
...@@ -42,14 +42,14 @@ class FactorLandmarkDummy : public FactorBase ...@@ -42,14 +42,14 @@ class FactorLandmarkDummy : public FactorBase
/** \brief Evaluate the factor given the input parameters and returning the residuals and jacobians /** \brief Evaluate the factor given the input parameters and returning the residuals and jacobians
**/ **/
bool evaluate(double const* const* parameters, bool evaluate(double const* const* parameters,
double* residuals, double* residuals,
double** jacobians) const override {return true;}; double** jacobians) const override {return true;};
/** Returns a residual vector and a vector of Jacobian matrix corresponding to each state block evaluated in the point provided in _states_ptr /** Returns a residual vector and a vector of Jacobian matrix corresponding to each state block evaluated in the point provided in _states_ptr
**/ **/
void evaluate(const std::vector<const double*>& _states_ptr, void evaluate(const std::vector<const double*>& _states_ptr,
Eigen::VectorXd& residual_, Eigen::VectorXd& residual_,
std::vector<Eigen::MatrixXd>& jacobians_) const override {}; std::vector<Eigen::MatrixXd>& jacobians_) const override {};
/** \brief Returns the jacobians computation method /** \brief Returns the jacobians computation method
**/ **/
...@@ -57,7 +57,11 @@ class FactorLandmarkDummy : public FactorBase ...@@ -57,7 +57,11 @@ class FactorLandmarkDummy : public FactorBase
/** \brief Returns a vector of pointers to the states in which this factor depends /** \brief Returns a vector of pointers to the states in which this factor depends
**/ **/
std::vector<StateBlockPtr> getStateBlockPtrVector() const override std::vector<StateBlockConstPtr> getStateBlockPtrVector() const override
{
return std::vector<StateBlockConstPtr>(0);
}
std::vector<StateBlockPtr> getStateBlockPtrVector() override
{ {
return std::vector<StateBlockPtr>(0); return std::vector<StateBlockPtr>(0);
} }
......
...@@ -101,8 +101,9 @@ class FactorDummy : public FactorBase ...@@ -101,8 +101,9 @@ class FactorDummy : public FactorBase
Eigen::VectorXd& _residual, Eigen::VectorXd& _residual,
std::vector<Eigen::MatrixXd>& _jacobians) const override {} std::vector<Eigen::MatrixXd>& _jacobians) const override {}
JacobianMethod getJacobianMethod() const override {return JacobianMethod::JAC_ANALYTIC;} JacobianMethod getJacobianMethod() const override {return JacobianMethod::JAC_ANALYTIC;}
std::vector<StateBlockPtr> getStateBlockPtrVector() const override {std::vector<StateBlockPtr> v; return v;} std::vector<StateBlockConstPtr> getStateBlockPtrVector() const override {return std::vector<StateBlockConstPtr>();}
std::vector<unsigned int> getStateSizes() const override {std::vector<unsigned int> v; return v;} std::vector<StateBlockPtr> getStateBlockPtrVector() override {return std::vector<StateBlockPtr>();}
std::vector<unsigned int> getStateSizes() const override {return std::vector<unsigned int>();}
unsigned int getSize() const override {return 0;} unsigned int getSize() const override {return 0;}
}; };
......
...@@ -83,7 +83,7 @@ class ProcessorDiffDrivePublic : public ProcessorDiffDrive ...@@ -83,7 +83,7 @@ class ProcessorDiffDrivePublic : public ProcessorDiffDrive
Base::deltaPlusDelta(_delta1, _delta2, _dt2, _delta1_plus_delta2, _jacobian1, _jacobian2); Base::deltaPlusDelta(_delta1, _delta2, _dt2, _delta1_plus_delta2, _jacobian1, _jacobian2);
} }
VectorXd getCalibration (const CaptureBasePtr _capture) const override VectorXd getCalibration (const CaptureBaseConstPtr _capture) const override
{ {
return Base::getCalibration(_capture); return Base::getCalibration(_capture);
} }
......
...@@ -95,8 +95,9 @@ void show(const ProblemPtr& problem) ...@@ -95,8 +95,9 @@ void show(const ProblemPtr& problem)
using std::endl; using std::endl;
cout << std::setprecision(4); cout << std::setprecision(4);
for (FrameBasePtr F : *problem->getTrajectory()) for (auto F_pair : problem->getTrajectory()->getFrameMap())
{ {
auto F = F_pair.second;
cout << "----- Key Frame " << F->id() << " -----" << endl; cout << "----- Key Frame " << F->id() << " -----" << endl;
if (!F->getCaptureList().empty()) if (!F->getCaptureList().empty())
{ {
...@@ -324,8 +325,9 @@ TEST(Odom2d, VoteForKfAndSolve) ...@@ -324,8 +325,9 @@ TEST(Odom2d, VoteForKfAndSolve)
// Check the 3 KFs' states and covariances // Check the 3 KFs' states and covariances
MatrixXd computed_cov; MatrixXd computed_cov;
int n = 0; int n = 0;
for (auto F : *problem->getTrajectory()) for (auto F_pair : problem->getTrajectory()->getFrameMap())
{ {
auto F = F_pair.second;
ASSERT_POSE2d_APPROX(F->getStateVector("PO"), integrated_pose_vector[n] , 1e-6); ASSERT_POSE2d_APPROX(F->getStateVector("PO"), integrated_pose_vector[n] , 1e-6);
ASSERT_TRUE (F->getCovariance(computed_cov)); ASSERT_TRUE (F->getCovariance(computed_cov));
ASSERT_MATRIX_APPROX(computed_cov , integrated_cov_vector[n] , 1e-6); ASSERT_MATRIX_APPROX(computed_cov , integrated_cov_vector[n] , 1e-6);
......
...@@ -85,7 +85,7 @@ TEST(SolverCeresMultithread, MultiThreadingTruncatedNotifications) ...@@ -85,7 +85,7 @@ TEST(SolverCeresMultithread, MultiThreadingTruncatedNotifications)
ts += 1.0; ts += 1.0;
if (P->getTrajectory()->getFrameMap().size() > 10) if (P->getTrajectory()->getFrameMap().size() > 10)
(*P->getTrajectory()->begin())->remove(); P->getTrajectory()->getFirstFrame()->remove();
if (std::chrono::duration_cast<std::chrono::duration<double>>(std::chrono::high_resolution_clock::now() - start).count() > Dt) if (std::chrono::duration_cast<std::chrono::duration<double>>(std::chrono::high_resolution_clock::now() - start).count() > Dt)
break; break;
......
...@@ -80,7 +80,7 @@ TEST(SolverManagerMultithread, MultiThreadingTruncatedNotifications) ...@@ -80,7 +80,7 @@ TEST(SolverManagerMultithread, MultiThreadingTruncatedNotifications)
ts += 1.0; ts += 1.0;
if (P->getTrajectory()->getFrameMap().size() > 10) if (P->getTrajectory()->getFrameMap().size() > 10)
(*P->getTrajectory()->begin())->remove(); P->getTrajectory()->getFirstFrame()->remove();
if (std::chrono::duration_cast<std::chrono::duration<double>>(std::chrono::high_resolution_clock::now() - start).count() > Dt) if (std::chrono::duration_cast<std::chrono::duration<double>>(std::chrono::high_resolution_clock::now() - start).count() > Dt)
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment