shadow-robot/sr-ros-interface-ethercat

[sr_tactile_sensor_controller] does not use the hand_id parameter

guihomework opened this issue · 2 comments

the tactile controller reads the prefix in the yaml file and uses that as the namespace.
it is impossible to set an empty prefix as now all the hands have joint_prefix. So this should be handled differently

I suggest the following:

  • yaml contains prefix as now.
  • controller finds the serial_id corresponding to this prefix in the joint_prefix mapping on the parameter server. The hand_finder cannot be used there as there is no public access to the mappings, only to generated stuff.
  • in the future, the serial_id could be used to extract the handlers of the tactile. Currently the joint_prefix is sufficient as the tactile are in rh_FFJ0 actuator. so prefix+"_"+FFJ0 works nice even if no serial is found
  • if there is a serial_id, one can look the hand_id for this serial_id on the parameter server and use that as the namespace. Permits to have an empty namespace, else just use prefix as namespace.

During tests, the provided code change worked nice of the tactile sensor, with or without hand_id.
However, the GUIs require a hand_id and this revealed the fact that hand_id should never be empty.
Hence, the new solution using a private parameter use_ns, that is detected in both the driver and the tactile_controller, to activate of deactivate the namespace.
I kept the protection against empty hand_id, but it could probably be removed in absolutely necessary.

This solution is backward compatible, no use_ns and/or hand_id set work as before.

tested with and without namespace on a left hand.

PR merged, so closing