Hello everybody!
I am using ceres solver for simple geometric constraint calculations!
I need to define an AutoDiffCostFunction which computes a 1-dimensional residual based on one 2-dimensional input and another one computing a 2-dimensional residual based on a 2-dimensional input.
Following the tutorial and instruction this should be achieved by:
ceres::CostFunction* cf = new ceres::AutoDiffCostFunction<PointOnPoint, 1, 2>( new PointOnPoint() );
ceres::CostFunction* cf = new ceres::AutoDiffCostFunction<PointDistance, 2, 2>( new PointDistance() );
Setting up the problem by
ceres::Problem problem;
problem.AddResidualBlock( cf, NULL, vec);
and solving will lead to the following error:
Check failed: parameter_blocks.size() == cost_function->parameter_block_sizes().size()
vec is a std::vector<double*> containing two pointers to double values which is checked before passing it to the Problem.
Thanks for your help!!