I need to open a bottle cap with threads having shape as shown in figure. I have a UR-5 robot with 2F-85 gripper and FT-300 sensor. I am finding the plane of the cap using a 3D sensor. Now my task is to precisely move the robot gripper towards the cap and attach gripper to the central ridge of cap. Then robot needs to be moved in compliance along z axis to open the cap in order to loosen the threads. How to proceed with this programmatically?