Saving Pose information without having to re-teach points

I am working on a urscript program that puts the robot into freedrive and prompts the user to move the robot to a position which is used later in the program.

Right now if the program stops and is restarted, the operator has to re-teach those points. I am wondering if there is a way to record the [x,y,z,rx,ry,rz] output from the get_actual_tcp_pose() command so that the user does not need to re-teach those points every time a new program starts.

Code sample:
teach_points = request_boolean_from_primary_client(“Would you like to teach new points?”)
if teach_points == True:
popup(“To begin teaching points, press Continue”, title=“Pre-Start”,blocking=True)
freedrive_mode()
popup(“Move robot to FIRST point. When finished, press Continue”, title=“First Coordinate”,blocking=True)
first_coord_grab = get_actual_tcp_pose()
end

  x = first_coord[0]
  y = first_coord[1]
  z = first_coord[2]
  rx = 1.748 #first_coord[3]
  ry = -2.597 #first_coord[4]
  rz = 0.0 #first_coord[5]

movep(x,y,z,rx,ry,rz,accel,velocity,blend_radius)

If there is a different way of storing these values so that they are recorded and a user can opt out of re-teaching and use the taught data from the previous run of the program.

Any help is appreciated.

Thanks!

Hello Evan,

Define your variables as global variables in the Installation, and they will be saved between stops, shutdowns etc. :slight_smile:

1 Like