bool operator()(const T *const pose6d, const T *const point3d, T *residual) const
and returns residual.
I'm using ceres::AngleAxisRotatePoint() to rotate my world point with given pose vector.
The problem I have is that I have other pose representation, but not with T data type.
I think I couldn't access the value of T directly (Jet type?)
It utilizes some function in the Eigen library.
What's the best way to do this?
In summary, I would like to use T as double.
-Hyon
The problem I have is that I have other pose representation, but not with T data type.
In summary, I would like to use T as double.
---Hyon
--
----------------------------------------
Ceres Solver Google Group
http://groups.google.com/group/ceres-solver?hl=en?hl=en
---
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.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Hyon,
I don't know if you're familiar with Hauke Strasdat's library for working with Lie Groups (Sophus: https://github.com/strasdat/Sophus), but I have been using it successfully with Ceres and like the abstraction it offers.
I've recently added some unit tests to my own development branch of Sophus which demonstrate using Sophus::SE3 with auto-diff, though Sophus::Sim3 should work similarly:
https://github.com/stevenlovegrove/Sophus/blob/develop/test/ceres/test_ceres_se3.cpp
The Sophus library supports use of Eigen::Map for wrapping the Scalar (double / Jet) arrays within Ceres. The file local_parameterization_se3.hpp also implements the appropriate update step for SE3 parameters (internally stored as quaternion+translation). A Sim(3) local parameterization would look similar.
Steve
problem.AddParameterBlock(T_wr.data(), 7, new LocalParameterizationSe3);
CostFunction* cost_function =
new AutoDiffCostFunction<TestCostFunctor, 6, 7>(new TestCostFunctor(T_w_targ.inverse()));problem.AddResidualBlock(cost_function, NULL, T_wr.data());
and thentemplate<typename T>bool operator()( const T* const sT_wa, T* sResiduals ) const{const Eigen::Map<const Sophus::SE3Group<T> > T_wa(sT_wa);Eigen::Map<Eigen::Matrix<T,6,1> > residuals(sResiduals);residuals = (T_aw.cast<T>() * T_wa).log();return true;}
There is still two things which are error prone. One is the specification of dimensions. The user needs to know the size of the SE3 internal parameterization. I think the SE3Group class should expose that. Also the local parameterization for SE3 should also come from the group itself.I was also wondering if you had any ideas about eliminating/automating the construction of T_wa from sT_wa and making it transparent to the user?I'd be curious to hear what other things in the Ceres API can be improved/added to make geometrical problems like SLAM easier to handle.Sameer
struct SophusSE3Plus{
template<typename T>
bool operator()(const T* x_raw, const T* delta_raw, T* x_plus_delta_raw) const {
const Eigen::Map< const Sophus::SE3Group<T> > x(x_raw);
const Eigen::Map< const Eigen::Matrix<T,6,1> > delta(delta_raw);
Eigen::Map< Sophus::SE3Group<T> > x_plus_delta(x_plus_delta_raw);
x_plus_delta = x * Sophus::SE3Group<T>::exp(delta);
return true;
}
};LocalParameterization *se3_parameterization = new AutoDiffLocalParameterization<SophusSE3Plus,Sophus::SE3::num_parameters, Sophus::SE3::DoF>;
Hi all,What is the current status of Sophus SE3 integration into Ceres?
In Steven's github code from above (moved to https://github.com/stevenlovegrove/Sophus/blob/master/test/ceres/local_parameterization_se3.hpp and https://github.com/stevenlovegrove/Sophus/blob/master/test/ceres/local_parameterization_se3.hpp), the Jacobian is computed analytically, but isn't it also possible to use it with AutoDiffLocalParameterization?
It seems that Steven even contributed a lot to Sophus, as his fork https://github.com/stevenlovegrove/Sophus/ is 30 commits ahead of https://github.com/strasdat/Sophus, so which version of Sophus to use with Ceres?
Is it possible to autodiff SE3 like this?:struct SophusSE3Plus{template<typename T>bool operator()(const T* x_raw, const T* delta_raw, T* x_plus_delta_raw) const {const Eigen::Map< const Sophus::SE3Group<T> > x(x_raw);const Eigen::Map< const Eigen::Matrix<T,6,1> > delta(delta_raw);Eigen::Map< Sophus::SE3Group<T> > x_plus_delta(x_plus_delta_raw);x_plus_delta = x * Sophus::SE3Group<T>::exp(delta);return true;}};
I am currently investigating different libraries (ceres, g2o), local parameterizations (Lie-algebra twists, quaternions, angle-axis) (using ceres' rotation.h, <Eigen/Geometry>, Sophus) as well as different ways to calculate derivatives (analytic, numeric, automatic :-) ) for the problem of minimizing 3D Alignment errors in multi-view LM-ICP pose graph optimization.I have previously been using the g2o library (https://github.com/RainerKuemmerle/g2o) and GICP edges (https://github.com/RainerKuemmerle/g2o/blob/master/g2o/types/icp/types_icp.cpp) to model the point-to-point as well as point-to-plane ICP distance metrics and minimizing them on a graph, but I was not convinced that g2o is actually computing the right thing and using the correct derivatives, because my global error increases first before it gets decreased.
Then I heard about automatic derivatives in Ceres, I am even happier to hear that autodiff works for Local Parameterizations as well. I would be glad if anyone could share his experience
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/d0965180-4c23-4588-a2cc-dff36c865c90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
...
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/38d858fe-a41f-4b8b-8b32-267a9a569a40%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/7e1308ee-6950-403d-8317-3d0ddcc2482a%40googlegroups.com.