@mig is right (I'm just clarifying some details): the ur_driver
package contains a Python ROS node that connects though TCP/IP to the URScript portion of the driver that runs on the UR controller.
Commanding it is done using FollowJointTrajectory
actions, and robot state data is broadcast using appropriate publishers (JointState
, WrenchStamped
, etc). See also the ur_driver
wiki page.
As far as I understood, UR driver(driver.py) in universal package acts like an interface between ROS and URScripts.
Not really. The driver is really only meant to make it possible for ROS nodes to control the arm using an actionlib client, and to receive information about the state of the arm by subscribing to the topics provided. It is possible to extend the driver (both the Python and the URScript side) to do whatever you want, but that is not what the driver was necessarily designed for.
So all-in-all there is no linking (in the traditional compiled language sense) involved. Follow @mig's advise, and send the appropriate messages to the provided topics and / or invoke services on the ur_driver
node. To receive robot state, subscribe to the /joint_states
and other topics. This should be no different from how you work with other ROS nodes.
PS: an older version of the driver did publish joint torques in the effort
field of the JointState message, but this was removed when the driver was moved to a different state interface (see universal_robot/issues/125). You might want to comment on issue 125 to let the maintainers know that this should be fixed.