tub-rip / cmax_slam

Official implementation of IEEE T-RO 2024 paper: "CMax-SLAM: Event-based Rotational-Motion Bundle Adjustment and SLAM System using Contrast Maximization"
MIT License
43 stars 4 forks source link

Question about Contrast Maximization via Ceres Solver #1

Closed Hchu2 closed 5 months ago

Hchu2 commented 7 months ago

Thank you very much for your nice work! I have a question when I try to solve angular velocity (contrast maximization) by Ceres Solver. In a selcted event window, I found that the residual of contrast is 1 dimension,but the estimated angular velocity is 3 dimension, resulting in Rank Deficiency in nonlinear optimization. Based on your implementation, I try ITERATIVE_SCHUR and CGNR to solve the same problem but it does not converge at all. I find you release the interface “setupProblemAndOptimize_ceres” but without implementation. Have you tried something similar like me? Would you please give me some suggestion?

Shuang1997 commented 5 months ago

Hi, thanks for your interest in our work. I don’t remember it very clearly because it was a code from too long ago. I remember that I met some weird error when I tried to use Ceres to implement the CMax at the back-end (the panorama) and I could not figure out the reason. Finally, I decided to just use the GSL.

I roughly searched for the ITERATIVE_SCHUR and CGNR in the Ceres documentation, and I found that they were used to solve the Non-Linear-Least-Square (NLLS) problem, but CMax is not NLLS.

If you really want to use Ceres, my suggestion would be trying the solvers from General Unconstrained Minimization.

For the rank deficiency you mentioned, I do not understand your question well. I think it is it is normal that the objective function is a scalar (1 dimension) and the optimized variables have multiple dimensions.

wlxing1901 commented 2 months ago

Thank you very much for your nice work! I have a question when I try to solve angular velocity (contrast maximization) by Ceres Solver. In a selcted event window, I found that the residual of contrast is 1 dimension,but the estimated angular velocity is 3 dimension, resulting in Rank Deficiency in nonlinear optimization. Based on your implementation, I try ITERATIVE_SCHUR and CGNR to solve the same problem but it does not converge at all. I find you release the interface “setupProblemAndOptimize_ceres” but without implementation. Have you tried something similar like me? Would you please give me some suggestion?

Hello, @Hchu2

I happened to come across this issue and wanted to share that a few months ago, I open-sourced an implementation of contrast maximization using Ceres Solver that may be helpful:

https://github.com/FORREST1901/contrast-maximization-for-event-cameras

This implementation uses Ceres Solver for optimization and achieves near real-time performance in some cases. It includes examples for estimating both 2D translation and 3D rotation. The repository includes usage instructions and test data to get started easily.