How to record tcp_force in tool coorindate from RTDE

Hi All,

I am using a UR3e and have managed to collect tcp forces from my RTDE using actual_TCP_pose.

However, I want to collect data of my TCP forces in tool coordinate system, as opposed to a Generalized forces in the TCP from the line.

I am aware that there is a way to collect the data from this UR script HOW TO ACHIEVE FORCE AND TORQUE VALUES IN TOOL COORDINATE SYSTEM but how can I achieve this with RTDE and collecting the variable values as a CSV file?

I tried replicating the formulas to do manual calculations using MATLAB but cant seem to get past the pose_inv(tcp) part as my tcp matrix wasn’t a square matrix.