Iterator over Values Container returns (1,0,0) for Pose2D object

Issue #366 invalid
Dennis Sherman created an issue

Good day,

I am having trouble with the following block of code:

else if (NLopt)
    {
        result = NonlinearConjugateGradientOptimizer(graph,initialEstimate).optimize();
        result.print("Final Result NL:\n");
    }

    for(Values::iterator resultKV = result.begin(); resultKV != result.end(); ++resultKV)
    {
        cout << ((Pose2*)(&resultKV->value))->x() << " " << endl;
    }

When I call result.print, the estimated values for the unknown poses are printed. Loop over the values container, the ->x() returns 1 for all elements. Use of t() rather than x() returns (1,0) for all elements.

Any help would be appreciated.

Comments (3)

  1. Log in to comment