are manifold boxplus boxminus constraints numerical?

15 views
Skip to first unread message

Roger Labbe

unread,
Jan 30, 2023, 2:48:10 PM1/30/23
to Ceres Solver
We have this constraint  +(x, -(y, x)) == y for the boxplus/minus operators. As far as the ceres implementation goes, should this be considered a numerical constraint?

For example, in 2D pose we may have yaw in the interval [-pi, pi). If we perform the operation above we can end up with the boxplus being ~pi (pi-tiny eps) when x=-pi. And sure, pi==-pi on the manifold, and so these are nearly equal in that sense. But numerically they are very different. Is ceres sensitive to this? 

Using examples\slam\pose_graph_2d\angle_manifold.h

int main()
{
    AngleManifold am;
    double y = -M_PI;
    double x = 52 * (M_PI / 180.);
    double res, res2;

    am.Minus(&y, &x, &res);
    am.Plus(&x, &res, &res2);
    std::cout << std::format("{} vs {}", y, res2);
    return 0;
}

prints "-3.141592653589793 vs 3.1415926535897927"

Similar problems occur if you compute -(+(x, delta), x), where the answers may differ by pi.

I'm guessing it is okay since Ceres' parameter steps are on the Lie algebra of the manifold (if I understand it correctly), and the cost function should also work on that algebra, hence the round trip is never done. But I want to be sure I have this correct. In general I'll be working in quaternions, so I don't 'care' about this exact example, but numerically we do 'butt up against' the open subset limits which I think of as numerically failing the bijection requirement of homeomorphism. 

Sameer Agarwal

unread,
Jan 30, 2023, 3:22:55 PM1/30/23
to ceres-...@googlegroups.com
Roger,
Ceres internally does not check this constraint (except for some test helpers which my check for this). As long as it is the same point on the manifold you should be fine. And if you violate it, ceres will still happily chug along, likely doing something silly along the way (Silly In Silly Out).
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/0caa89d3-b7e7-48e9-a059-516ac2569343n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages