Hello Folks,
I am solving a graph optimization problem by using Ceres.
I have my initial guess T_ij ( T_12,T_13,T_23) for the transformation between nodes, I wish to optimize my transformation matrix P_k refer to the reference node 1.
Thus I can declare my residual[k]=log_map(P_k)-log_map(T_1k).
Thus my code is like:
for (k=0;k<n;k++){
cost_function = new ceres::AutoDiffCostFunction<ceres_cost_function, 6,6>(new ceres_cost_function(T_1k));
problem.AddResidualBlock(cost_function, NULL, P_k.initial);
}
problem.SetParameterBlockConstant(P_1);
ceres::Solver::Options options;
options.linear_solver_type = ceres::DENSE_QR;
options.minimizer_progress_to_stdout = true;
ceres::Solver::Summary summary;
Solve(options, &problem, &summary);
And now I want to add several constraints on the optimization process: T_ij*P_i=P_j.
Would you please instruct me how to modify the code?