RAPID_P5 is a simple Processing program that outputs RAPID code. Requires the toxiclibs library for Processing (read how to install a Processing library). Location units are in millimeters, and rotation units are degrees. Also included below is some introductory code for Processing that can be used as a reference to understand RAPID_P5. For more a more in-depth overview of Processing, check out some of the books available on the topic.


RAPID_P5 Version 5 (April 17, 2012) – Minor bug fixes

FCNC Processing Introduction Code (April 10, 2012)


It is intended as a starting point for further explorations with RAPID code generation and has a number of limitations:

  • No preview/simulation of the robot, only positioning of the tool in 3d space
  • No checking for reach or joint limits
  • Tool orientation data is defined in Euler Angles for simplicity – beware of Gimbal Lock
  • Robot targets are generated at runtime by the controller, limiting the ability to preview specific targets in RobotStudio without a full simulation

Simulating in RobotStudio

Always simulate the code generated by RAPID_P5 before running it on the actual robot.

  • Go to the ‘Offline‘ tab of RobotStudio
  • In the left hand pane, go to ‘IRB140_5kg_0.81m_3/RAPID/T_ROB1’, right click and select “Load Program” – if a dialog pops up click yes
  • Select the .pgf file created by RAPID_P5
  • Select everything in the ‘Synchronize to Station‘ window
  • Hit the play icon in the main window