Hi, community
I’m a beginner in UR development. I found two methods for obtaining TCP force within the community. However, the values obtained are inconsistent.
Is my understanding incorrect? Please advise.
demo1: get_wrench_at_tcp()
def get_wrench_at_tool_flange():
ft= get_tcp_force() #Tcp force returns the force and torques at the tool flange with base orientation
t_flange_in_base = pose_trans(get_target_tcp_pose(), pose_inv(get_tcp_offset()))
flange_rot= pose_inv(p[0, 0, 0,t_flange_in_base[3],t_flange_in_base,[4],t_flange_in_base[5]])
f= pose_trans(flange_rot,p[ft[0],ft[1],ft[2], 0, 0, 0])
t= pose_trans(flange_rot,p[ft[3],ft[4],ft[5], 0, 0, 0])
return [f[0],f[1],f[2],t[0],t[1],t[2]]
end
def get_wrench_at_tcp():
return wrench_trans(get_tcp_offset(),get_wrench_at_tool_flange())
end
demo2: get_tcp_force_tool()
def get_tcp_force_tool():
force_torque = get_tcp_force()
force_B = p[ force_torque[0], force_torque[1], force_torque[2], 0, 0, 0 ]
torque_B = p[ force_torque[3], force_torque[4], force_torque[5], 0, 0, 0 ]
tcp = get_actual_tcp_pose()
rotation_BT = p[ 0, 0, 0, tcp[3], tcp[4], tcp[5] ]
force_T = pose_trans( pose_inv(rotation_BT), force_B )
torque_T = pose_trans( pose_inv(rotation_BT), torque_B )
force_torque_T = p[ force_T[0], force_T[1], force_T[2], torque_T[0], torque_T[1], torque_T[2] ]
return force_torque_T
end
thanks