# Correct method to get the joints torques

**URL:** <https://forum.universal-robots.com/t/correct-method-to-get-the-joints-torques/34685>\
**Category:** Technical Questions\
**Created:** [June 11, 2024, 1:33am UTC](https://forum.universal-robots.com/t/correct-method-to-get-the-joints-torques/34685 "2024-06-11T01:33:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![henry\_esp218](https://avatars.discourse-cdn.com/v4/letter/h/ce7236/32.png) [@henry\_esp218](https://forum.universal-robots.com/u/henry_esp218)\
**Post date:** [June 11, 2024, 1:33am UTC](https://forum.universal-robots.com/t/correct-method-to-get-the-joints-torques/34685/1 "2024-06-11T01:33:39Z")

</div>

Hello  
I am trying to get the joint torques of the UR5e robot. I read this post [Some doubts about URScript: get\_tcp\_foce - #6 by mmi](https://forum.universal-robots.com/t/some-doubts-about-urscript-get-tcp-foce/4481/6)

I used the RTDE Python interface ([GitHub - UniversalRobots/RTDE\_Python\_Client\_Library: RTDE client library and examples](https://github.com/UniversalRobots/RTDE_Python_Client_Library)) to get the target\_moment and target\_current.  
The torques constant kt\_i and joint torques were calculated by:  
kt\_i = target\_moment\_i/target\_current\_i  
joint\_torque\_i = actual\_current\_i\* Kti

 ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/3/36fe8c3879107d5c5df4d5c88f90663100dca405.png)

In addition, I used the get\_joint\_torques() of the URScrip reference manual  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/1/147e3d563e853c67678922c1ff6f586469cd7ed2.png)

However, when I plot the two differents methods to get the joint torques these are different.

![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/c/c302a978c3044ab1ea95d72b79b737bfca476b64.png)  
blue line: joint torques using the URscript function get\_joint\_torques  
magenta line: joint torques using the data ((target\_moment, target\_current, actual\_current) from the RTDE interface

Why?  
What is the correct way to get the joint torques using the RTDE interface (target\_moment, target\_current, actual\_current)

---

<div class="post-metadata">

**Author:** ![henry\_esp218](https://avatars.discourse-cdn.com/v4/letter/h/ce7236/32.png) [@henry\_esp218](https://forum.universal-robots.com/u/henry_esp218)\
**Post date:** [July 11, 2024, 1:41pm UTC](https://forum.universal-robots.com/t/correct-method-to-get-the-joints-torques/34685/2 "2024-07-11T13:41:31Z")

</div>

I upload the datafiles when using an external tool. In addition, I attach the jupyter notebook FYI of anyone.

> **[data\_forum.zip](https://drive.google.com/file/d/1UAb8HuSJK9nRz9ZvseuUqnCPtCafgQFj/view?usp=sharing)**
>
> Google Drive file.
