This help document is an introduction to develop Plug-Ins for RoboDK. RoboDK Plug-Ins allow extending RoboDK by using the RoboDK Interface and the RoboDK API. Contrary to the default RoboDK API (provided in Python, C#, C++, Matlab, etc), this RoboDK Plug-In interface is linked natively into the core of RoboDK. Therefore, when the RoboDK API is used inside the Plugin Interface (using IItem and IRoboDK) the speed is faster than using the default API Timing tests. However, all RoboDK Plug-In applications must exist within RoboDK's environment.
Some RoboDK Example plugins are available here:
Each example includes the robodk_interface folder. This folder is required by every plug-in and defines the interface to RoboDK.
These examples include a customized robot panel applying robot forward and inverse kinematics, a real-time example, a plugin simulating the gravity and an OPC-UA interface based on Open62541 (Server and Client examples).
Double click the PluginExample.pro file to start the project with Qt. Make sure to follow the installation requirements section (Installation Requirements) to install Qt as a C++ development environment.
Each plugin must implement the IAppRoboDK class. The IAppRoboDK defines the interface to the RoboDK application.
Contrary to the standard API, the Plug-In interface allows you to interact with RoboDK's main window and customize the appearance of RoboDK through the IAppRoboDK class. The toolbar, the menu bar and windows can be customized by using the IAppRoboDK class.
You can load one of the sample plug-ins by selecting:
The IRoboDK class (or RoboDK) defines the interface to the RoboDK API. This RoboDK API is the same available by default (https://robodk.com/doc/en/RoboDK-API.html#RoboDKAPI). However the RoboDK API is faster when you use it inside a RoboDK Plug-In: Timing tests. When the plugin is loaded using class: IAppRoboDK::PluginLoad it passes a pointer to IRoboDK which is the interface to the RoboDK API.
RoboDK and IRoboDK are exactly the same type of class. RoboDK is used in the default examples to make it compatible with the standard C++ RoboDK API.
More information about the RoboDK API is available here:
The IItem class (or Item) can be used to operate on any item available in the RoboDK tree. Use functions such as class: IRoboDK::getItem or class: IRoboDK::getItemList to retrieve items from the RoboDK station tree. Item is a pointer to IItem. Items should be deleted using class: IItem::Delete (not using the class destructor).
More information about the RoboDK Item class (based on the Python API) is available here:
The robodktypes.h file defines a set of types used by the RoboDK API. Including:
The RoboDK API is a generic set of commands that allows you to interact with RoboDK and automate tasks. The RoboDK API is used by default when macros are used in RoboDK. The RoboDK Plug-In interface includes an interface to the RoboDK API.
The main advantages of using the RoboDK API through a Plug-In Inteface are the following:
You should pay attention to the following when using the RoboDK API inside a Plug-In:
The PluginExample application shows how to implement a basic plugin. Among other things it performs some timing tests to calculate the speed of RoboDK on a specific computer. By selecting the "Plugin Speed Information" button you'll obtain the timing statistics.
These statistics are generated by class: PluginExample::callback_information. For example, forward and inverse kinematics are usually under 2 micro seconds and 10 micro seconds respectively (1 micro second = 1e-6 seconds).
Each RoboDK Plug-In must be developed using the Qt Creator and follow Qt's project guidelines. It is recommended to use the PluginExample project to get started with your new RoboDK Plug-In (double click PluginExample.pro to open it with Qt Creator).
RoboDK must be installed to develop Plug-Ins. The free version of RoboDK is enough to develop a Plug-In as a proof of concept.
Requirements to make RoboDK Plug-Ins work:
The default location for RoboDK plugins is C:/RoboDK/bin/plugins
Your Plug-In release and debug binaries should not be mixed with RoboDK's release and debug binaries. RoboDK debug binaries are not provided by default.
To properly run your plugin in debug mode you should use the RoboDK debug binary files:
Important: Mixing a debug DLL with a release DLL will not work (a message will be provided as console output). Make sure you update this setting every time you switch debug and release modes.
Important: If you experience strange plugin loading issues, try to delete all plugins and build them again (all files in C:/RoboDK/bin/plugins and C:/RoboDK/bind/plugins).
RoboDK Plug-Ins must be created using the Qt Plugin Framework. Qt is based on C++, therefore, it is required to program the RoboDK Plug-In in C++.
Qt is a set of useful libraries for C++ and Qt Creator is the default development environment (IDE) for Qt. We recommneded using Qt Creator as development environment for programming a RoboDK Plug-In.
This list provides some useful links and tips for programming with Qt:
Useful links involving the RoboDK API: