shadow-robot / sr-ros-interface

A ROS interface for Shadow Robot's hand.
GNU General Public License v2.0
22 stars 12 forks source link

Remove assumptions about actuator name length from sr-ros-interface #331

Open dg-shadow opened 9 years ago

dg-shadow commented 9 years ago

Change made to sr_mechanism_controllers/src/srh_fake_joint_calibration_controller.cpp in #328 means there is a tacit assumption of 4 letter actuator names. Discussion seems to suggest there are likely to be other places in the code that this is assumed...

Not causing any problems right now, but concievably could in the future.

guihomework commented 9 years ago

From previous discussions on how to handle prefix, I think it was said there is a convention for joint naming (an actuator naming too then) There must be some convention somewhere. The trimming on is risky too, in case prefix are not called "xxxx" I will soon propose a PR with code in python where I used regex to find the joint names in the middle of the controller name, assuming there are always constructed like this splitted = re.split('[tfmrlw][fhr]j[0-5]_',controller.name)

this will wall in the same issue then

sr_mechanism_description assumes the joint number is always at the end. joint_name_[joint_name_.size()-1] == '0'