stack-of-tasks / sot-torque-control

Collection of dynamic-graph entities aimed at implementing torque control on different robots.
Other
9 stars 15 forks source link

ControlManager::convertJointNameToJointId: pb on error handling #60

Closed olivier-stasse closed 5 years ago

olivier-stasse commented 5 years ago

Warning rightly mention that https://github.com/stack-of-tasks/sot-torque-control/blob/9750072dfff1ed5c6edd10a6f8f86ddb2a67bf47/src/control-manager.cpp#L663 is always false as jid is unsigned.

Using Index is the right way. A good solution would be to add a boolean argument to the robot_utils method get_id_from_name. This boolean argument would be false if the results is not found with a return value set to zero.

olivier-stasse commented 5 years ago

Well after reading more the code, robot_utils returns a Eigen::VectorXd::Index which is a long it and therefore is an int value.

olivier-stasse commented 5 years ago

Fix by 6c0da11