Get TCP Speed relative to a pose different than Base

Continuing the discussion from Accessing speed in tool space:

Hello,

i need to get or calculate the TCP speed relative to a pose like a custom Feature as example.

get_actual_tcp_speed() and get_target_tcp_pose_along_path() both return the speed relative to base.

i tried the solution mentioned Here but it didn’t work and i didn’t understand the math behind it if its a correct solution.

Thanks in advance,