Move gripper relative to base or feature from user input

I am building a script. At some point in the script the robot is supose to move the gripper relative to the Base or feature Z-axis.

The TCP Frame and Base frame are not aligned.

I have tried to do this using pose_trans.

pose_trans(Pose,p[0,0,-0.25,0,0,0])

where Pose is: get_actual_tcp_pose()

The problem with this is that it’s moving relative to the TCP Z-axis.

Is there a smart way to do this? or should a manually do the transformation from frame to frame?

pose_add(…) can be used to move in base coordinates. Moving in feature coordinates requires extra transformations. There is support article on that topic: Universal Robots - URScript: Move with respect to a custom feature/frame