Add constraints in non-linear Least Squares

682 views
Skip to first unread message

Ruoyu Tan

unread,
Aug 1, 2015, 2:21:28 PM8/1/15
to Ceres Solver
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?

Sameer Agarwal

unread,
Aug 2, 2015, 12:20:49 AM8/2/15
to Ceres Solver
Equality constraints are not supported in ceres. 
The kind of constraints you are describing are easily incorporated though by analytically eliminating P_j from your system and using T_ij * P_i instead. Assuming I am understanding your problem right.
Sameer


--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/74c3b015-871c-4eca-aaae-a0192456abb2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages