Closed YummyOu closed 3 years ago
@YummyOu I have updated your code patch. Next time, please provide an example that I is executable. So Including imports, a __main__
, etc. In your case you also use other libraries and even a URDF file. Please provide these or provide information about where to find them.
By only checking if the return value is smaller than zero, you don't check the actual value. Which already provides a lot of information. It is -4
, which corresponds to size mismatch. A small search in the code would have shown you https://github.com/orocos/orocos_kinematics_dynamics/blob/7c424ffe77e11b2b7761cd8bb7f91f3abce923df/orocos_kdl/src/chainidsolver_recursive_newton_euler.cpp#L50
Which shows that the wrenches should be of the size of the number of segments, not joints. So by changing that line to
self._wrenches = [PyKDL.Wrench()] * self._chain.getNrOfSegments()
Your problem is solved.
On the remaining questions:
Thank you so much! It works!
self._wrenches = [PyKDL.Wrench()] * self._chain.getNrOfSegments()
I would like to compute the torques of some movement and by using
PyKDL.ChainIdSolver_RNE
. But something went wrong when computeCartToJnt
.run
move_robot()
and print:I could successfully use inverse kinematics functions.
I also would like to ask:
PyKDL.Vector(0, 0, -9.81)
?self._wrenches
is zero matrix?