How to save freedrive coordinates as variables on a Doosan robot

Based on contributions by bram.leinberger.

When you need to teach several positions by hand instead of typing coordinates, you can put the robot in freedrive mode, move it by hand to each position, and have a DRL script save the current pose as a variable automatically. This is faster than reading coordinates off the pendant and typing them into code.

What you need

  • A Doosan robot running a DRL program.
  • The correct payload set for your end-effector — freedrive uses gravity compensation based on the payload, so an incorrect payload makes the robot drift or feel heavy when you let go.

Steps

1. Enable freedrive mode

freedrive_mode()

This lets you move the robot freely by hand. To restrict movement to specific axes, pass freeAxes — for example, to allow motion only along Z:

freedrive_mode(freeAxes=[0, 0, 1, 0, 0, 0])

2. Prompt yourself to move to the position

popup("Move the robot to Pos X", title="Pos X", blocking=True)

With blocking=True, the script pauses here until you press Continue on the robot’s GUI — this gives you time to physically move the arm into place before the position is recorded.

3. Save the current pose as a variable

global pos_x = get_actual_tcp_pose()

get_actual_tcp_pose() reads the robot’s current Cartesian pose. Declaring it with global makes pos_x available to any other program on the robot afterwards.

4. Repeat for every position you need

Repeat steps 2 and 3 for each coordinate, with a different popup title and variable name:

freedrive_mode()

popup("Move the robot to Pos A", title="Pos A", blocking=True)
global pos_a = get_actual_tcp_pose()

popup("Move the robot to Pos B", title="Pos B", blocking=True)
global pos_b = get_actual_tcp_pose()

popup("Move the robot to Pos C", title="Pos C", blocking=True)
global pos_c = get_actual_tcp_pose()

Related


Rewritten and consolidated (Sept 2026) from the original student how-to’s: How to easily save freemove coordinates as variables.