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

demos...

parent 792aca61
No related branches found
No related tags found
1 merge request!383Resolve "CeresManager params/autoconf"
Pipeline #5707 failed
......@@ -62,12 +62,14 @@ int main(int argc, char** argv)
SensorBasePtr sensor = new SensorBase("ODOM 2d", std::make_shared<StateBlock>(Eigen::VectorXd::Zero(2)), std::make_shared<StateBlock>(Eigen::VectorXd::Zero(1)), std::make_shared<StateBlock>(Eigen::VectorXd::Zero(2)), 2);
// Ceres wrapper
ceres::Solver::Options ceres_options;
ceres_options.minimizer_type = ceres::TRUST_REGION; //ceres::TRUST_REGION;LINE_SEARCH
ceres_options.max_line_search_step_contraction = 1e-3;
ceres_options.max_num_iterations = 1e4;
SolverCeres* ceres_manager_autodiff = new SolverCeres(wolf_problem_autodiff, ceres_options);
SolverCeres* ceres_manager_analytic = new SolverCeres(wolf_problem_analytic, ceres_options);
ceres_manager_autodiff.getSolverOptions().minimizer_type = ceres::TRUST_REGION; //ceres::TRUST_REGION;LINE_SEARCH
ceres_manager_autodiff.getSolverOptions().max_line_search_step_contraction = 1e-3;
ceres_manager_autodiff.getSolverOptions().max_num_iterations = 1e4;
ceres_manager_analytic.getSolverOptions().minimizer_type = ceres::TRUST_REGION; //ceres::TRUST_REGION;LINE_SEARCH
ceres_manager_analytic.getSolverOptions().max_line_search_step_contraction = 1e-3;
ceres_manager_analytic.getSolverOptions().max_num_iterations = 1e4;
// load graph from .txt
offLineFile_.open(file_path_.c_str(), std::ifstream::in);
......
......@@ -104,12 +104,11 @@ int main()
// Wolf problem and solver
ProblemPtr problem = Problem::create("PO", 2);
ceres::Solver::Options options;
options.max_num_iterations = 1000; // We depart far from solution, need a lot of iterations
SolverCeresPtr ceres = std::make_shared<SolverCeres>(problem, options);
SolverCeresPtr ceres = std::make_shared<SolverCeres>(problem);
ceres.getSolverOptions().max_num_iterations = 1000; // We depart far from solution, need a lot of iterations
// sensor odometer 2d
ParamsSensorOdom2dPtr intrinsics_odo = std::make_shared<ParamsSensorOdom2d>();
ParamsSensorOdom2dPtr intrinsics_odo = std::make_shared<ParamsSensorOdom2d>();
SensorBasePtr sensor_odo = problem->installSensor("SensorOdom2d", "sensor odo", Vector3d(0,0,0), intrinsics_odo);
// processor odometer 2d
......
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