orocos / orocos_kinematics_dynamics

Orocos Kinematics and Dynamics C++ library
703 stars 408 forks source link

Why is nr_of_jnts a double and not unsigned int? #384

Open guru-florida opened 2 years ago

guru-florida commented 2 years ago

The constructor for TreeIkSolverPos_Online takes nr_of_jnts argument but it is a double. Looking at the source code, the argument is only used to construct the JntArray objects and that constructor takes an unsigned int...it seems to me the nr_of_jnts argument should also be an unsigned int. I can't see a use case for having non-integer number of joints. The argument is not used anywhere else but the constructor.

https://github.com/orocos/orocos_kinematics_dynamics/blob/4f705fe9e1533802578b5275ddad02b065b2be4e/orocos_kdl/src/treeiksolverpos_online.cpp#L29

I can do a PR if you like.

MatthijsBurgh commented 2 years ago

@guru-florida thanks for your comment.

I agree with you. Internally an uint is used. So this API doesn't make any sense.

Changing this API, would be a breaking change. Therefore I don't want to change it for now. So I created a milestone for the next breaking release. This could be long way down the road. But I will add this issue to that milestone.