You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Torques output arrays are zero-size
Test does not properly size the torques_1 or torques_2 JntArrays. Therefor solver.CartToJnt(...) call actually returns -4 (E_SIZE_MISMATCH) because the first thing CartToJnt() method does is check that all the JntArray have the same size (matching number of joints). Unfortunately, the error value from CartToJnt() is not captured or checked/asserted.
False Positive
This test passes because the two torques_1 and 2 arrays are black (0 elements) and therefor are still considered equal but the CartToJnt() method is not actually tested.
Recommendations:
Before the CartToJnt() call, add torques_1.resize(chain.getNrOfJoints())
Also Wrap the solver.CartToJnt() call in an ASSERT() checking that it returns KDL::SolverI::E_NOERROR
perhaps also ensure that at least 1 torques_ array is non-zero?
I know we are approaching a year since this was opened, so sorry about that. If you'd be willing to open a pull request to fix the test as you think it should be, we can iterate there. Thanks for opening this issue.
Take a closer look at the code for this test:
https://github.com/ros/kdl_parser/blob/melodic-devel/kdl_parser/test/test_inertia_rpy.cpp
Torques output arrays are zero-size
Test does not properly size the torques_1 or torques_2 JntArrays. Therefor solver.CartToJnt(...) call actually returns -4 (E_SIZE_MISMATCH) because the first thing CartToJnt() method does is check that all the JntArray have the same size (matching number of joints). Unfortunately, the error value from CartToJnt() is not captured or checked/asserted.
False Positive
This test passes because the two torques_1 and 2 arrays are black (0 elements) and therefor are still considered equal but the CartToJnt() method is not actually tested.
Recommendations:
For reference, CartToJnt() method code:
http://docs.ros.org/jade/api/orocos_kdl/html/chainidsolver__recursive__newton__euler_8cpp_source.html
Thanks!
The text was updated successfully, but these errors were encountered: