Closed gitouni closed 1 year ago
The g2o framework to this end allows to add a Cache
to edges which can be used to cache intermediate operations, such as a transformation matrix. See for example https://github.com/RainerKuemmerle/g2o/blob/2a7ea2732c2bf4c6c0ccb9d4bc650f23b54aa647/g2o/types/slam3d/edge_se3_pointxyz_disparity.cpp#L77
https://github.com/RainerKuemmerle/g2o/blob/2a7ea2732c2bf4c6c0ccb9d4bc650f23b54aa647/g2o/types/slam3d/edge_se3_pointxyz_disparity.cpp#L117
The cache is a different concept and computation of error and Jacobian in one call is currently not addressed but might be an interesting feature to implement.
Thanks for your reply. I look forward to this new feature.
Hi, @RainerKuemmerle, I'm wondering how to compute Error and Jacobian in one function, since there are many same intermediate steps betweeen them. For example, when I use compute the
Error
andJacobian
with respect to a SE3 Vertex, I need to convert the SE3 matrix to rotation and translation vectors twice incomputeError
andlinearizeOplus
respectively. How can I implement them together and avoid redundant steps? Below is an example program andstd::tie(Rab, tab, s) = v->toPose();
is a redundent step.Another example can be found in floam_g2o. Compared with the original FLOAM implemented by ceres, it cannot avoid compute variables
lp
,nu
andne
repeatedly both incomputeError
andlinearizeOplus
functions.I gratefully appreciate your reply.