Joint torques for a simulated UR3e robot
Hi everyone, I am simulating a UR3e in ROS gazebo and i am trying to get the motor torques of all the joints. When I read out the effort values in the joint_states topic they always remain 0.0, even when the robot is moving. How can I get the joint torques? Kind regards Dimitri
The robot controller is set to effort_controllers?
Honestly I don't know. I think its position controlled. How do I check/set that?
Probably it is in line 5, in the file ur3_robot.urdf.xacro. If I'm not say anything wrong, the default controller, is the position. And I believe with this option, there is no feedback on the effort. How ever, with effort controllers you can use the effort/position, which is a controller using effort with input in position, using a feedback loop and PID. And this one, I'm sure that gives you the effort feedback on joint_states topic.
Thank you. But I did not find any specification of a controller in any of the urdf files. But i did find under /universal_robot/ur_e_gazebo/controller the file arm_controller_ur3e.yaml with the following content (the [...] signifies there was more but it didn't fit in here):
Do I need to change the controller here?
You need change there too. However, it needs to change in the xacro file yet.
Ok. Because the file you mentioned above (ur3_robot.urdf.xacro) looks like this>
Where exactly would I need to put in the effort controller?
From: <xacro:arg name="transmission_hw_interface" default="hardware_interface/PositionJointInterface"/>
To: <xacro:arg name="transmission_hw_interface" default="hardware_interface/EffortJointInterface"/>
and on your yaml file:
I never tried this before. However, it makes sense.
Ok i did as you said. I get the following error:
and
any ideas?
ok I also changed the file ur.transmission.xacro and replaced hardwareInterface of all the transmissions from <hardwareinterface>hardware_interface/PositionJointInterface</hardwareinterface> to <hardwareinterface>hardware_interface/EffortJointInterface</hardwareinterface>
Now i get this error:
and this:
and
Ok after adding PID gains to the file arm_controller_ur3e.yaml it seems to work.
Thanks a lot Teo Cardoso!
See ros-industrial/universal_robot#227 for a PR which implements exactly this.
Thank you gvdhoorn.
The pull request you mentioned only changes the hardware interface, but I guess it is also necessary to set the controllers to be effort_controllers for it to work?
In the pull request conversation you say that there is no joint torque control interface for UR. what I need is just the values of the joint torques, I do not intend to use an effort controller on the real robot. Is this possible?