Test Z Position Against A Stored Z Position

# in (mm)
tolerance := 0.001

#wrt to base
Z_value := get_actual_tcp_pose()
# returns current p[x,y,z,rx,ry,rz]

# use index value [2] for Z-value in pose, norm() is absolute value function in URscript
if( ( norm( Z_value[2] - PushdownPoint[2] ) ) > tolerance ):
   popup("Error - Check pin is seated properly.", True, True)

‘tolerance’ would need to be tweaked to right threshold value (currently i have it set to 0.001m or 1mm). This can all be done using polyscope nodes (I call them ‘nodes’ or ‘functions’ whatever you want to call them as shown in your program picture - basically two assignments, if-statement, and using expressions with functions) I wrote it in URscript code (shown above). If you plan to check continuously while in forcemode() you need to have a count or something to trigger after a set amount of try’s or time.

There may be other ways to achieve what you are after and someone else may have a better solution for you, anyways hope this is somewhat helpful, and best of luck!

3 Likes