You are reading the documentation for an older Pickit release (2.4). Documentation for the latest release (3.4) can be found here.

KUKA example picking program

This example program requires that Pickit is installed and set up with your robot. For installation instructions, please refer to the KUKA installation and setup article.


Before running the robot program for the first time, make sure that:

  • There exists a valid robot-camera calibration.

  • The Tool Center Point (TCP) has been correctly specified.

  • The robot speed is set to a low value, so unexpected behavior can be identified early enough to prevent the robot from colliding with people or the environment.

  • Pickit is in robot mode, which is enabled in the Pickit web interface.

Example program: PickitSimplePicking

This example program can be found in R1 > Program > Pickit.


This example program only works with Pickit software version of 2.2 or greater. If you are using a software version prior 2.2, please contact us at support@pickit3d.com, and we will assist you in finding a solution.

DEF  PickitSimplePicking ( )
   ;FOLD INI;%{PE}


   IF NOT Pickit_is_running() THEN
       PickitMessages(#info, 1) ;Pickit not in ROBOT mode


   BAS(#TOOL,1) ; Tool for picking
   BAS(#BASE,0) ; Robot base

   PTP Detect
   WAIT FOR Pickit_get_results()

       IF Pickit_object_found() THEN
           ;Calculate pick points
           F_PrePick=F_Pick:{X 0.0,Y 0.0,Z -100.0,A 0.0,B 0.0,C 0.0}
           F_PostPick={X 0.0,Y 0.0,Z 100.0,A 0.0,B 0.0,C 0.0}:F_Pick

           ; Check if positions are reachable
           IF (Pickit_ErrStatCheckPos1==0) AND (Pickit_ErrStatCheckPos2==0) AND (Pickit_ErrStatCheckPos3==0) THEN
               PTP AbovePickArea
               LIN F_PrePick
               LIN F_Pick
               ;Add grasping logic
               LIN F_PostPick
               LIN AbovePickArea
               PTP Detect
               PTP Dropit
               ;Add release logic
               WAIT FOR Pickit_get_results()
               PickitMessages(#info,2) ;Object not reachable requesting next object..
               WAIT FOR Pickit_get_results()
           IF Pickit_roi_empty() THEN
               PickitMessages(#info, 3) ;ROI is empty
               PickitMessages(#info, 4) ;No objects found

The idea of the program is the following:

  • First, it is checked whether or not Pickit is in Robot mode.

  • If so, the robot moves to the detect pose and a detection is triggered, otherwise the robot program is halted.

  • If an object is found, it is checked if the pick, pre-pick and post-pick points are reachable for the robot.

  • If the object is reachable, the robot moves to the object to pick it. Afterwards, the robot moves to a fixed drop-off position, Dropit. As soon as the robot is out of the field of view of the camera, a new Pickit detection is triggered, so that the detection is processed at the same time as the robot moves, optimizing cycle time.

  • If the object is not reachable, the robot requests the next detected object.

  • If the ROI is empty, the program stops.

  • If no object is found, and the ROI is not empty, a snapshot is saved on the Pickit system and the robot program stops.


Depending on which Pickit software version you are running, the example program can look different, even though the functionality is the same. We recommend to use the example program shipped with your Kuka connect version

Define the tool for picking

Create a tool with the actual TCP values. In this example #TOOL1 is used.

Set correct input arguments

The commands Pickit_configure and Pickit_detect_with_retr need input arguments. See Pickit communication functions for more information about these arguments.

Define fixed points

In this example program, 4 fixed points are used. These points need to be defined depending on the application.

  • Home: Where the robot will start the program.

  • Detect: Where to perform object detection from.

  • AbovePickArea: A point roughly above the pick area from which the above two can be reached without collision.

  • Dropit: Where to place objects.

Add grasping/releasing logic

At the F_Pick and Dropit points, grasping and releasing logic needs to be added, respectively.

Execute the picking program

Now you can run the program. Happy picking!