ChainIdSolver_RNE constructor get wrong nj and ns

asked 2020-06-22 05:10:32 -0500

dimitri gravatar image

I have a KDL chain and want to construct a ChainIdSolver_RNE for it. I do it the following way (MELO_LOG is just to print out what the program is doing, I changed nj and ns from private to public in order to be able to access it):

MELO_INFO("chain.getNrOfJoints(): %u, chain.getNrOfSegments(): %u", chain.getNrOfJoints(),       chain.getNrOfSegments());
KDL::ChainIdSolver_RNE TestSolver(chain, g);
MELO_INFO("nj: %u, ns: %u", TestSolver.nj, TestSolver.ns);
TestSolver.updateInternalDataStructures();
MELO_INFO("nj: %u, ns: %u", TestSolver.nj, TestSolver.ns);
MELO_INFO("chain.getNrOfJoints(): %u, chain.getNrOfSegments(): %u", chain.getNrOfJoints(), chain.getNrOfSegments());
MELO_INFO("TestSolver.chain.getNrOfJoints(): %u", TestSolver.chain.getNrOfJoints());

The output of this part of the code is:

[ INFO] [1592818814.802771651]: chain.getNrOfJoints(): 6, chain.getNrOfSegments(): 10
[ INFO] [1592818814.802839467]: nj: 0, ns: 4294954208
[ INFO] [1592818814.802874958]: nj: 0, ns: 4294954208
[ INFO] [1592818814.802902799]: chain.getNrOfJoints(): 6, chain.getNrOfSegments(): 10

Obiously this leads to an E_NOT_UP_TO_DATE = -3 when CartToJnt{} is called. This doen't really make sense to me since according to the constructor nj and ns get initialized with getNrOfJoints and getNrOfSegments.

edit retag flag offensive close merge delete