Skip to content

Latest commit

 

History

History
104 lines (73 loc) · 4.5 KB

File metadata and controls

104 lines (73 loc) · 4.5 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Overview

This is the RoboDK Plug-In Interface — a C++/Qt framework for building native plugins that extend RoboDK (industrial robot simulation software). Plugins compile to DLL/SO/DYLIB files and are loaded directly into RoboDK's core, making them 10-100x faster than the standard RoboDK API.

Build Commands

All projects use qmake (not CMake). Open a .pro file in Qt Creator, or build from the command line:

Windows (Qt 5.15, MSVC2019):

qmake Plug-In-Interface.pro -spec win32-msvc CONFIG+=qtquickcompiler CONFIG+=Release
jom.exe   # or: nmake

Linux/macOS:

qmake Plug-In-Interface.pro CONFIG+=qtquickcompiler CONFIG+=Release
make

To build a single plugin, run qmake/make inside its subdirectory (e.g., PluginExample/PluginExample.pro).

The top-level Plug-In-Interface.pro builds all plugins as SUBDIRS. Note that Plugin-OPC-UA, PluginOpenGL, PluginOpenGL-Shaders, and PluginRoboUI are gated behind win32 { } and only build on Windows.

There are no automated tests — plugins are tested manually by loading them in RoboDK via Tools → Plug-Ins, or faster, by launching RoboDK with a command-line flag:

RoboDK.exe -PLUGINSLOAD                                      # start with all available plugins loaded
RoboDK.exe -PLUGINLOAD=C:/RoboDK/bin/plugins/pluginexample.dll   # load one plugin on the fly

Qt Version Requirements

Platform Qt Version Compiler
Windows 5.15 MSVC2019
macOS 6.10 (≥RoboDK 6.0), 5.15 (older) clang 64-bit
Linux 6.10 (≥RoboDK 6.0), 5.12 (older) GCC

The Qt version must match exactly what RoboDK was compiled with, or the plugin will fail to load.

Plugin Output Locations

Compiled plugins must be placed in RoboDK's plugin directory:

  • Windows release: C:/RoboDK/bin/plugins/
  • Windows debug: C:/RoboDK/bind/plugins/
  • macOS: ~/RoboDK.app/Contents/MacOS/plugins/
  • Linux: ~/RoboDK/bin/plugins/

Architecture

Core Interface (robodk_interface/)

All plugins include this shared interface via:

include($$PWD/../robodk_interface/robodk_interface.pri)

Key headers:

  • irobodk.h — Main RoboDK API (100+ methods: robot control, simulation, file I/O)
  • iitem.h — Represents any object in the station tree (robot, frame, tool, program, etc.)
  • iapprobodk.h — Base class that every plugin must implement
  • robodktypes.h — Shared enums and type definitions
  • matrix4x4.h, vector3.h, joints.h — Math utilities

Plugin Lifecycle

Every plugin implements IAppRoboDK and receives pointers to IRoboDK and IItem. Key behavioral notes:

  • Items are pointers, not value objects — check for nullptr before use
  • Screen updates are manual — call a render event explicitly after changing robot positions
  • Qt signals/slots are used for all UI callbacks and are thread-safe

Plugin Structure Pattern

Each plugin follows this structure:

PluginXxx/
├── PluginXxx.pro       # qmake project (CONFIG += plugin)
├── pluginxxx.h/.cpp    # IAppRoboDK implementation
└── [widget files]      # Optional docked Qt widgets

Add-in Apps (PluginAppLoader/Apps/)

Python-based apps loaded via the PluginAppLoader C++ plugin (built in separately, always enabled in RoboDK but disabled by default). Each app is a subfolder; every .py script inside becomes a menu item/toolbar button, and an AppConfig.ini (auto-generated on first load) controls menu placement, icons, and shortcuts. Package an app folder into a distributable .rdkp with PluginAppLoader/Apps/PackageCreate.py (or PackageCreateOne.py for a single app).

Robot Extensions (robotextensions/samplekinematics/)

Custom kinematics libraries that RoboDK loads separately. Must export SolveFK(), SolveFK_CAD(), and SolveIK() functions.

Starting a New Plugin

Copy PluginExample/ as a template. It demonstrates:

  • Plugin registration and lifecycle hooks
  • Adding menu items and toolbar buttons
  • Docked widget creation
  • Timing/performance benchmarking of the RoboDK API

Deployment

Plugins are packaged as .rdkp Add-in files using the RoboDK Add-in Manager. See the Add-ins documentation. Each plugin includes a manifest.xml (title, version, description, asset list) consumed by the Add-in Manager when packaging.