Universal Robots Forum

How to save the output value of the "get_tcp_force()"?

Hi all,

I’m using polyscope 3.5.3.
When I using the “get_tcp_force()”,

data = get_tcp_force()

how to I save the all output value(all time)?

Hello!

When you use “get_tcp_force()” you will get it as a Pose ( as p[X, Y, Z, rX, rY, rZ] ) . But if you call that variable as a regular list, so you can get each value by itself.
So to get the X, Y, Z, rX, rY and rZ values in their own int variables, you can use:

dataX = data[0]
dataY = data[1]
dataZ = data[2]
datarX = data[3]
datarY = data[4]
datarZ = data[5]

Edit: Found the UR How-To also.
https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/read-a-single-coordinate-or-axis-rotation-15379/