RoboDK Plug-In Interface
IRoboDK Class Referenceabstract

This class is the iterface to the RoboDK API. With the RoboDK API you can automate certain tasks and operate on items. Interactions with items in the station tree are made through Items (IItem). An item is an object in the RoboDK tree (it can be either a robot, an object, a tool, a frame, a program, ...). More...

#include <irobodk.h>

Public Types

enum  {
  INS_TYPE_INVALID = -1 , INS_TYPE_MOVE = 0 , INS_TYPE_MOVEC = 1 , INS_TYPE_CHANGESPEED = 2 ,
  INS_TYPE_CHANGEFRAME = 3 , INS_TYPE_CHANGETOOL = 4 , INS_TYPE_CHANGEROBOT = 5 , INS_TYPE_PAUSE = 6 ,
  INS_TYPE_EVENT = 7 , INS_TYPE_CODE = 8 , INS_TYPE_PRINT = 9
}
 Instruction types. More...
 
enum  {
  MOVE_TYPE_INVALID = -1 , MOVE_TYPE_JOINT = 1 , MOVE_TYPE_LINEAR = 2 , MOVE_TYPE_CIRCULAR = 3 ,
  MOVE_TYPE_LINEARSEARCH = 4
}
 Movement types. More...
 
enum  {
  RUNMODE_SIMULATE = 1 , RUNMODE_QUICKVALIDATE = 2 , RUNMODE_MAKE_ROBOTPROG = 3 , RUNMODE_MAKE_ROBOTPROG_AND_UPLOAD = 4 ,
  RUNMODE_MAKE_ROBOTPROG_AND_START = 5 , RUNMODE_RUN_ROBOT = 6
}
 Script execution types used by IRoboDK.setRunMode and IRoboDK.RunMode. More...
 
enum  { PROGRAM_RUN_ON_SIMULATOR = 1 , PROGRAM_RUN_ON_ROBOT = 2 }
 Program execution type. More...
 
enum  { CALIBRATE_TCP_BY_POINT = 0 , CALIBRATE_TCP_BY_PLANE = 1 }
 TCP calibration types. More...
 
enum  {
  CALIBRATE_FRAME_3P_P1_ON_X = 0 , CALIBRATE_FRAME_3P_P1_ORIGIN = 1 , CALIBRATE_FRAME_6P = 2 , CALIBRATE_TURNTABLE = 3 ,
  CALIBRATE_TURNTABLE_2X = 4
}
 Reference frame calibration types. More...
 
enum  {
  PROJECTION_NONE = 0 , PROJECTION_CLOSEST = 1 , PROJECTION_ALONG_NORMAL = 2 , PROJECTION_ALONG_NORMAL_RECALC = 3 ,
  PROJECTION_CLOSEST_RECALC = 4 , PROJECTION_RECALC = 5
}
 projection types (for AddCurve) More...
 
enum  {
  JOINT_FORMAT = -1 , EULER_RX_RYp_RZpp = 0 , EULER_RZ_RYp_RXpp = 1 , EULER_RZ_RYp_RZpp = 2 ,
  EULER_RZ_RXp_RZpp = 3 , EULER_RX_RY_RZ = 4 , EULER_RZ_RY_RX = 5 , EULER_QUEATERNION = 6
}
 Euler type. More...
 
enum  {
  WINDOWSTATE_HIDDEN = -1 , WINDOWSTATE_SHOW = 0 , WINDOWSTATE_MINIMIZED = 1 , WINDOWSTATE_NORMAL = 2 ,
  WINDOWSTATE_MAXIMIZED = 3 , WINDOWSTATE_FULLSCREEN = 4 , WINDOWSTATE_CINEMA = 5 , WINDOWSTATE_FULLSCREEN_CINEMA = 6 ,
  WINDOWSTATE_VIDEO = 7
}
 State of the RoboDK window. More...
 
enum  {
  INSTRUCTION_CALL_PROGRAM = 0 , INSTRUCTION_INSERT_CODE = 1 , INSTRUCTION_START_THREAD = 2 , INSTRUCTION_COMMENT = 3 ,
  INSTRUCTION_SHOW_MESSAGE = 4
}
 Instruction program call type: More...
 
enum  { FEATURE_NONE = 0 , FEATURE_SURFACE = 1 , FEATURE_CURVE = 2 , FEATURE_POINT = 3 }
 Object selection features: More...
 
enum  { SPRAY_OFF = 0 , SPRAY_ON = 1 }
 Spray gun simulation: More...
 
enum  { COLLISION_OFF = 0 , COLLISION_ON = 1 }
 Collision checking state. More...
 
enum  {
  FLAG_ROBODK_TREE_ACTIVE = 1 , FLAG_ROBODK_3DVIEW_ACTIVE = 2 , FLAG_ROBODK_LEFT_CLICK = 4 , FLAG_ROBODK_RIGHT_CLICK = 8 ,
  FLAG_ROBODK_DOUBLE_CLICK = 16 , FLAG_ROBODK_MENU_ACTIVE = 32 , FLAG_ROBODK_MENUFILE_ACTIVE = 64 , FLAG_ROBODK_MENUEDIT_ACTIVE = 128 ,
  FLAG_ROBODK_MENUPROGRAM_ACTIVE = 256 , FLAG_ROBODK_MENUTOOLS_ACTIVE = 512 , FLAG_ROBODK_MENUUTILITIES_ACTIVE = 1024 , FLAG_ROBODK_MENUCONNECT_ACTIVE = 2048 ,
  FLAG_ROBODK_WINDOWKEYS_ACTIVE = 4096 , FLAG_ROBODK_TREE_VISIBLE = 8192 , FLAG_ROBODK_REFERENCES_VISIBLE = 16384 , FLAG_ROBODK_STATUSBAR_VISIBLE = 32768 ,
  FLAG_ROBODK_NONE = 0 , FLAG_ROBODK_ALL = 0xFFFF , FLAG_ROBODK_MENU_ACTIVE_ALL = FLAG_ROBODK_MENU_ACTIVE | FLAG_ROBODK_MENUFILE_ACTIVE | FLAG_ROBODK_MENUEDIT_ACTIVE | FLAG_ROBODK_MENUPROGRAM_ACTIVE | FLAG_ROBODK_MENUTOOLS_ACTIVE | FLAG_ROBODK_MENUUTILITIES_ACTIVE | FLAG_ROBODK_MENUCONNECT_ACTIVE
}
 RoboDK Window Flags. More...
 
enum  {
  FLAG_ITEM_SELECTABLE = 1 , FLAG_ITEM_EDITABLE = 2 , FLAG_ITEM_DRAGALLOWED = 4 , FLAG_ITEM_DROPALLOWED = 8 ,
  FLAG_ITEM_ENABLED = 32 , FLAG_ITEM_AUTOTRISTATE = 64 , FLAG_ITEM_NOCHILDREN = 128 , FLAG_ITEM_USERTRISTATE = 256 ,
  FLAG_ITEM_NONE = 0 , FLAG_ITEM_ALL = 64 + 32 + 8 + 4 + 2 + 1
}
 RoboDK Item Flags. More...
 
enum  { RenderNone = 0 , RenderScreen = 1 , RenderUpdateOnly = 2 , RenderComplete = 0xff }
 Different render levels to update the screen. More...
 
enum  { DrawTriangles = 1 , DrawLines = 2 , DrawPoints = 3 , DrawSpheres = 4 }
 Display geometry in 3D, with respect to the station coordinate system. This should be called using DrawGeometry ONLY when a PluginEvent of type EventRender is triggered. More...
 

Public Member Functions

virtual Item getItem (const QString &name, int itemtype=-1)=0
 Returns an item by its name. If there is no exact match it will return the last closest match. More...
 
virtual QStringList getItemListNames (int filter=-1)=0
 Returns a list of items (list of names or Items) of all available items in the currently open station in RoboDK. Optionally, use a filter to return specific items (example: getItemListNames(filter = ITEM_TYPE_ROBOT)) More...
 
virtual QList< ItemgetItemList (int filter=-1)=0
 Returns a list of items (list of names or pointers) of all available items in the currently open station in RoboDK. Optionally, use a filter to return specific items (example: getItemListNames(filter = ITEM_CASE_ROBOT)) More...
 
virtual bool Valid (const Item item_check)=0
 Check if an item is valid (not null and available in the open station) More...
 
virtual Item ItemUserPick (const QString &message="Pick one item", int itemtype=-1)=0
 Shows a RoboDK popup to select one object from the open RoboDK station. An item type can be specified to filter desired items. If no type is specified, all items are selectable. More...
 
virtual Item ItemUserPick (const QString &message, const QList< Item > &list_choices, int id_selected=-1)=0
 Shows a RoboDK popup to select one object from the open RoboDK station. You can provide a few items to choose from and, optionally, a selected index. More...
 
virtual void ShowRoboDK ()=0
 Shows or raises the RoboDK window.
 
virtual void HideRoboDK ()=0
 Hides the RoboDK window. RoboDK will continue running in the background.
 
virtual void CloseRoboDK ()=0
 Closes RoboDK window and finishes RoboDK execution
 
virtual QString Version ()=0
 Return the vesion of RoboDK as a 4 digit string: Major.Minor.Revision.Build
 
virtual void setWindowState (int windowstate=WINDOWSTATE_NORMAL)=0
 Set the state of the RoboDK window More...
 
virtual void setFlagsRoboDK (int flags=FLAG_ROBODK_ALL)=0
 Update the RoboDK flags. RoboDK flags allow defining how much access the user has to certain RoboDK features. Use FLAG_ROBODK_* variables to set one or more flags. More...
 
virtual void setFlagsItem (int flags=FLAG_ITEM_ALL, Item item=nullptr)=0
 Update item flags. Item flags allow defining how much access the user has to item-specific features. Use FLAG_ITEM_* flags to set one or more flags. More...
 
virtual int getFlagsItem (Item item)=0
 Retrieve current item flags. Item flags allow defining how much access the user has to item-specific features. Use FLAG_ITEM_* flags to set one or more flags. More...
 
virtual void ShowMessage (const QString &message, bool popup=true)=0
 Show a message in RoboDK (it can be blocking or non blocking in the status bar) More...
 
virtual Item AddFile (const QString &filename, const Item parent=nullptr)=0
 Loads a file and attaches it to parent. It can be any file supported by RoboDK. More...
 
virtual void Save (const QString &filename, const Item itemsave=nullptr)=0
 Save an item to a file. If no item is provided, the open station is saved. More...
 
virtual Item AddShape (const tMatrix2D *trianglePoints, Item addTo=nullptr, bool shapeOverride=false, tColor *color=nullptr)=0
 Adds a shape provided triangle coordinates. Triangles must be provided as a list of vertices. A vertex normal can be provided optionally. More...
 
virtual Item AddCurve (const tMatrix2D *curvePoints, Item referenceObject=nullptr, bool addToRef=false, int ProjectionType=PROJECTION_ALONG_NORMAL_RECALC)=0
 Adds a curve provided point coordinates. The provided points must be a list of vertices. A vertex normal can be provided optionally. More...
 
virtual Item AddPoints (const tMatrix2D *points, Item referenceObject=nullptr, bool addToRef=false, int ProjectionType=PROJECTION_ALONG_NORMAL_RECALC)=0
 Adds a list of points to an object. The provided points must be a list of vertices. A vertex normal can be provided optionally. More...
 
virtual bool ProjectPoints (tMatrix2D *points, Item objectProject, int ProjectionType=PROJECTION_ALONG_NORMAL_RECALC)=0
 Projects a list of points given its coordinates. The provided points must be a list of [XYZ] coordinates. Optionally, a vertex normal can be provided [XYZijk]. More...
 
virtual void CloseStation ()=0
 Close the current station without asking to save.
 
virtual Item AddTarget (const QString &name, Item itemparent=nullptr, Item itemrobot=nullptr)=0
 Adds a new target that can be reached with a robot. More...
 
virtual Item AddFrame (const QString &name, Item itemparent=nullptr)=0
 Adds a new Frame that can be referenced by a robot. More...
 
virtual Item AddProgram (const QString &name, Item itemrobot=nullptr)=0
 Adds a new Frame that can be referenced by a robot. More...
 
virtual Item AddStation (QString name)=0
 Add a new empty station. It returns the station item added. More...
 
virtual Item AddMachiningProject (QString name="Curve follow settings", Item itemrobot=nullptr)=0
 Add a new robot machining project. Machining projects can also be used for 3D printing, following curves and following points. It returns the newly created Item containing the project settings. Tip: Use the macro /RoboDK/Library/Macros/MoveRobotThroughLine.py to see an example that creates a new "curve follow project" given a list of points to follow(Option 4). More...
 
virtual QList< ItemgetOpenStations ()=0
 Returns the list of open stations in RoboDK. More...
 
virtual void setActiveStation (Item stn)=0
 Set the active station (project currently visible). More...
 
virtual Item getActiveStation ()=0
 Returns the active station item (station currently visible). More...
 
virtual int RunProgram (const QString &function_w_params)=0
 Adds a function call in the program output. RoboDK will handle the syntax when the code is generated for a specific robot. If the program exists it will also run the program in simulate mode. More...
 
virtual int RunCode (const QString &code, bool code_is_fcn_call=false)=0
 Adds code to run in the program output. If the program exists it will also run the program in simulation mode. More...
 
virtual void RunMessage (const QString &message, bool message_is_comment=false)=0
 Shows a message or a comment in the output robot program. More...
 
virtual void Render (int flags=RenderComplete)=0
 Update the scene. More...
 
virtual bool IsInside (Item object_inside, Item object_parent)=0
 Check if an object is fully inside another one. More...
 
virtual int setCollisionActive (int check_state=COLLISION_ON)=0
 Turn collision checking ON or OFF (COLLISION_OFF/COLLISION_OFF) according to the collision map. If collision checking is activated it returns the number of pairs of objects that are currently in a collision state. More...
 
virtual bool setCollisionActivePair (int check_state, Item item1, Item item2, int id1=0, int id2=0)=0
 Set collision checking ON or OFF (COLLISION_ON/COLLISION_OFF) for a specific pair of objects. This allows altering the collision map for Collision checking. Specify the link id for robots or moving mechanisms (id 0 is the base). More...
 
virtual int Collisions ()=0
 Returns the number of pairs of objects that are currently in a collision state. If collision checking is not active it will calculate collision checking. More...
 
virtual int Collision (Item item1, Item item2)=0
 Returns 1 if item1 and item2 collided. Otherwise returns 0. More...
 
virtual QList< ItemgetCollisionItems (QList< int > *link_id_list=nullptr)=0
 Return the list of items that are in a collision state. This function can be used after calling Collisions() to retrieve the items that are in a collision state. More...
 
virtual void setSimulationSpeed (double speed)=0
 Sets the current simulation speed. Set the speed to 1 for a real-time simulation. The slowest speed allowed is 0.001 times the real speed. Set to a high value (>100) for fast simulation results. More...
 
virtual double SimulationSpeed ()=0
 Gets the current simulation speed. Set the speed to 1 for a real-time simulation. More...
 
virtual void setRunMode (int run_mode=1)=0
 Sets the behavior of the RoboDK API. By default, RoboDK shows the path simulation for movement instructions (run_mode=1=RUNMODE_SIMULATE). Setting the run_mode to RUNMODE_QUICKVALIDATE allows performing a quick check to see if the path is feasible. if robot.Connect() is used, RUNMODE_RUN_FROM_PC is selected automatically. More...
 
virtual int RunMode ()=0
 Returns the behavior of the RoboDK API. By default, RoboDK shows the path simulation for movement instructions (run_mode=1). More...
 
virtual QList< QPair< QString, QString > > getParams ()=0
 Gets all the user parameters from the open RoboDK station. The parameters can also be modified by right clicking the station and selecting "shared parameters" User parameters can be added or modified by the user More...
 
virtual QString getParam (const QString &param)=0
 Gets a global or a user parameter from the open RoboDK station. The parameters can also be modified by right clicking the station and selecting "shared parameters" Some available parameters: PATH_OPENSTATION = folder path of the current .stn file FILE_OPENSTATION = file path of the current .stn file PATH_DESKTOP = folder path of the user's folder Other parameters can be added or modified by the user More...
 
virtual void setParam (const QString &param, const QString &value)=0
 Sets a global parameter from the RoboDK station. If the parameters exists, it will be modified. If not, it will be added to the station. The parameters can also be modified by right clicking the station and selecting "shared parameters". More...
 
virtual QString Command (const QString &cmd, const QString &value="")=0
 Send a special command. These commands are meant to have a specific effect in RoboDK, such as changing a specific setting or provoke specific events. More...
 
virtual bool LaserTrackerMeasure (tXYZ xyz, const tXYZ estimate, bool search=false)=0
 Takes a laser tracker measurement with respect to its own reference frame. If an estimate point is provided, the laser tracker will first move to those coordinates. If search is True, the tracker will search for a target. More...
 
virtual bool MeasurePose (Mat *pose, double data[10], int target=-1, int time_avg_ms=0, const tXYZ tool_tip=nullptr)=0
 Takes a pose measurement (requires a supported measurement system). More...
 
virtual bool CollisionLine (const tXYZ p1, const tXYZ p2)=0
 Checks the collision between a line and any objects in the station. The line is composed by 2 points. Returns the collided item. Use Item.Valid() to check if there was a valid collision. More...
 
virtual void CalibrateTool (const tMatrix2D *poses_joints, tXYZ tcp_xyz, int format=EULER_RX_RY_RZ, int algorithm=CALIBRATE_TCP_BY_POINT, Item robot=nullptr, double *error_stats=nullptr)=0
 Calibrate a tool (TCP) given a number of points or calibration joints. Important: If the robot is calibrated, provide joint values to maximize accuracy. More...
 
virtual Mat CalibrateReference (const tMatrix2D *poses_joints, int method=CALIBRATE_FRAME_3P_P1_ON_X, bool use_joints=false, Item robot=nullptr)=0
 Calibrate a Reference Frame given a list of points or joint values. Important: If the robot is calibrated, provide joint values to maximize accuracy. More...
 
virtual bool ProgramStart (const QString &progname, const QString &defaultfolder="", const QString &postprocessor="", Item robot=nullptr)=0
 Defines the name of the program when the program is generated. It is also possible to specify the name of the post processor as well as the folder to save the program. This method must be called before any program output is generated (before any robot movement or other instruction). More...
 
virtual void setViewPose (const Mat &pose)=0
 Set the pose of the wold reference frame with respect to the user view (camera/screen). More...
 
virtual Mat ViewPose ()=0
 Get the pose of the wold reference frame with respect to the user view (camera/screen). More...
 
virtual bool SetRobotParams (Item robot, tMatrix2D dhm, Mat poseBase, Mat poseTool)=0
 Set the nominal robot parameters. More...
 
virtual Item getCursorXYZ (int x=-1, int y=-1, tXYZ xyzStation=nullptr)=0
 Returns the position of the cursor as XYZ coordinates (by default), or the 3D position of a given set of 2D coordinates of the window (x & y coordinates in pixels from the top left corner) The XYZ coordinates returned are given with respect to the RoboDK station(absolute reference). If no coordinates are provided, the current position of the cursor is retrieved. More...
 
virtual QString License ()=0
 Returns the license as a readable string (same name shown in the RoboDK's title bar, on top of the main menu). More...
 
virtual QList< ItemSelection ()=0
 Returns the list of items selected (it can be one or more items). More...
 
virtual Item Popup_ISO9283_CubeProgram (Item robot=nullptr, tXYZ center=nullptr, double side=-1)=0
 Show the popup menu to create the ISO9283 path for position accuracy, repeatability and path accuracy performance testing. More...
 
virtual QByteArray getData (const QString &param)=0
 Gets a plugin defined parameter from the open RoboDK station. Saved parameters can be viewed or deleted by right clicking the station and selecting "shared parameters". More...
 
virtual void setData (const QString &param, const QByteArray &value)=0
 Sets a data parameter saved with the RoboDK station. If the parameters exists, it will be updated. If not, it will be added to the station. Saved parameters can be viewed or deleted by right clicking the station and selecting "shared parameters". More...
 
virtual int CollisionActive ()=0
 Returns the status of collision checking (COLLISION_ON=1 if the user want to have collision checking or COLLISION_OFF=0 if the user disabled collision checking). More...
 
virtual bool DrawGeometry (int drawtype, float *vtx_pointer, int vtx_size, float color[4], float geo_size=2.0, float *vtx_normals=nullptr)=0
 Draw geometry in the RoboDK's 3D view. This function must be called only inside a PluginEvent of type EventRender is triggered. More...
 
virtual bool DrawTexture (const QImage *image, const float *vtx_pointer, const float *texture_coords, int num_triangles, float *vtx_normals=nullptr)=0
 Draw a texture in the RoboDK's 3D view. This function must be called only inside a PluginEvent of type EventRender is triggered. More...
 
virtual void setSelection (const QList< Item > &listitems)=0
 Set the selection in the tree
 
virtual void setInteractiveMode (int mode_type, int default_ref_flags, const QList< Item > *custom_object=nullptr, int custom_ref_flags=0)=0
 Set the interactive mode to define the behavior when navigating and selecting items in RoboDK's 3D view. More...
 
virtual void PluginLoad (const QString &plugin_name="", int load=1)=0
 Load or unload the specified plugin (path to DLL, dylib or SO file). If the plugin is already loaded it will unload the plugin and reload it. Pass an empty plugin_name to reload all plugins. More...
 
virtual QString PluginCommand (const QString &plugin_name="", const QString &plugin_command="", const QString &value="")=0
 Send a specific command to a RoboDK plugin. The command and value (optional) must be handled by your plugin. It returns the result as a string. More...
 
virtual QByteArray getParamBytes (const QString &param)=0
 Gets a user parameter from the open RoboDK station (Bytes type). Special QByteArray parameters can be added or modified by plugins and scripts (not by the user). More...
 
virtual void setParamBytes (const QString &param, const QByteArray &value)=0
 Gets a user parameter from the open RoboDK station (Bytes type). Special QByteArray parameters can be added or modified by plugins and scripts (not by the user). More...
 
virtual int StereoCamera_Measure (Mat pose1, Mat pose2, int &npoints1, int &npoints2, double *data=nullptr, float time_avg=0, const tXYZ tip_xyz=nullptr)=0
 Takes a measurement with a 6D measurement device. It returns two poses, the base reference frame and the measured object reference frame. Status is negative if the measurement failed. extra data is [error_avg, error_max] in mm, if we are averaging a pose. More...
 
virtual Item BuildMechanism (int type, const QList< Item > &list_obj, const double *parameters, const tJoints &joints_build, const tJoints &joints_home, const tJoints &joints_senses, const tJoints &joints_lim_low, const tJoints &joints_lim_high, const Mat base, const Mat tool, const QString &name, Item robot=nullptr)=0
 Takes a measurement with a 6D measurement device. It returns two poses, the base reference frame and the measured object reference frame. Status is negative if the measurement failed. extra data is [error_avg, error_max] in mm, if we are averaging a pose. More...
 
virtual Item Cam2D_Add (const Item attach_to, const QString &params="")=0
 Open a simulated 2D camera view. Returns a handle pointer that can be used in case more than one simulated view is used. More...
 
virtual QImage Cam2D_Snapshot (const QString &file, const Item camera=nullptr, const QString &params="")=0
 Take a snapshot from a simulated camera view and save it to a file. Returns 1 if success, 0 otherwise. More...
 
virtual Item MergeItems (const QList< Item > &listitems)=0
 Merge multiple object items as one. Source objects are not deleted and a new object is created.
 

Detailed Description

This class is the iterface to the RoboDK API. With the RoboDK API you can automate certain tasks and operate on items. Interactions with items in the station tree are made through Items (IItem). An item is an object in the RoboDK tree (it can be either a robot, an object, a tool, a frame, a program, ...).

Definition at line 14 of file irobodk.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Instruction types.

Enumerator
INS_TYPE_INVALID 

Invalid instruction.

INS_TYPE_MOVE 

Linear or joint movement instruction.

INS_TYPE_MOVEC 

Circular movement instruction.

INS_TYPE_CHANGESPEED 

Set speed instruction.

INS_TYPE_CHANGEFRAME 

Set reference frame instruction.

INS_TYPE_CHANGETOOL 

Set the tool (TCP) instruction.

INS_TYPE_CHANGEROBOT 

Set the robot instruction (obsolete).

INS_TYPE_PAUSE 

Pause instruction.

INS_TYPE_EVENT 

Simulation event instruction.

INS_TYPE_CODE 

Program call or raw code output.

INS_TYPE_PRINT 

Display message on the teach pendant.

Definition at line 23 of file irobodk.h.

◆ anonymous enum

anonymous enum

Instruction program call type:

Enumerator
INSTRUCTION_CALL_PROGRAM 

Instruction to call a program.

INSTRUCTION_INSERT_CODE 

Instructio to insert raw code (this will not provoke a program call).

INSTRUCTION_START_THREAD 

Instruction to start a parallel thread. Program execution will continue and also trigger a thread.

INSTRUCTION_COMMENT 

Comment output.

INSTRUCTION_SHOW_MESSAGE 

Instruction to pop up a message on the robot teach pendant.

Definition at line 215 of file irobodk.h.

◆ anonymous enum

anonymous enum

Object selection features:

Enumerator
FEATURE_NONE 

No selection.

FEATURE_SURFACE 

Surface selection.

FEATURE_CURVE 

Curve selection.

FEATURE_POINT 

Point selection.

Definition at line 233 of file irobodk.h.

◆ anonymous enum

anonymous enum

Spray gun simulation:

Enumerator
SPRAY_OFF 

Activate the spray simulation.

Definition at line 248 of file irobodk.h.

◆ anonymous enum

anonymous enum

Collision checking state.

Enumerator
COLLISION_OFF 

Do not use collision checking.

COLLISION_ON 

Use collision checking.

Definition at line 255 of file irobodk.h.

◆ anonymous enum

anonymous enum

RoboDK Window Flags.

Enumerator
FLAG_ROBODK_TREE_ACTIVE 

Allow using the RoboDK station tree.

FLAG_ROBODK_3DVIEW_ACTIVE 

Allow using the 3D navigation.

FLAG_ROBODK_LEFT_CLICK 

Allow left clicks on the 3D navigation screen.

FLAG_ROBODK_RIGHT_CLICK 

Allow right clicks on the 3D navigation screen.

FLAG_ROBODK_DOUBLE_CLICK 

Allow double clicks on the 3D navigation screen.

FLAG_ROBODK_MENU_ACTIVE 

Enable/display the menu bar.

FLAG_ROBODK_MENUFILE_ACTIVE 

Enable the file menu (FLAG_ROBODK_MENU_ACTIVE must be allowed).

FLAG_ROBODK_MENUEDIT_ACTIVE 

Enable the edit menu (FLAG_ROBODK_MENU_ACTIVE must be allowed).

FLAG_ROBODK_MENUPROGRAM_ACTIVE 

Enable the program menu (FLAG_ROBODK_MENU_ACTIVE must be allowed).

FLAG_ROBODK_MENUTOOLS_ACTIVE 

Enable the tools menu (FLAG_ROBODK_MENU_ACTIVE must be allowed).

FLAG_ROBODK_MENUUTILITIES_ACTIVE 

Enable the utilities menu (FLAG_ROBODK_MENU_ACTIVE must be allowed).

FLAG_ROBODK_MENUCONNECT_ACTIVE 

Enable the connect menu (FLAG_ROBODK_MENU_ACTIVE must be allowed).

FLAG_ROBODK_WINDOWKEYS_ACTIVE 

Allow using keyboard shortcuts.

FLAG_ROBODK_TREE_VISIBLE 

Make the tree visible.

FLAG_ROBODK_REFERENCES_VISIBLE 

Make the reference frames visible.

FLAG_ROBODK_STATUSBAR_VISIBLE 

Make the statusbar visible.

FLAG_ROBODK_NONE 

Disallow everything.

FLAG_ROBODK_ALL 

Allow everything (default).

FLAG_ROBODK_MENU_ACTIVE_ALL 

Allow using the full menu.

Definition at line 264 of file irobodk.h.

◆ anonymous enum

anonymous enum

RoboDK Item Flags.

Enumerator
FLAG_ITEM_SELECTABLE 

Allow selecting RoboDK items.

FLAG_ITEM_EDITABLE 

Allow modifying RoboDK items.

FLAG_ITEM_DRAGALLOWED 

Allow draggin an item.

FLAG_ITEM_DROPALLOWED 

Allow dropping to an item.

FLAG_ITEM_ENABLED 

Enable the item.

FLAG_ITEM_AUTOTRISTATE 

Allow having nested items, expand and collapse the item.

FLAG_ITEM_NOCHILDREN 

Do not allow adding nested items.

FLAG_ITEM_NONE 

Disallow everything.

FLAG_ITEM_ALL 

Allow everything (default).

Definition at line 324 of file irobodk.h.

◆ anonymous enum

anonymous enum

Different render levels to update the screen.

Enumerator
RenderNone 

Do not render the screen.

RenderScreen 

Redisplay the screen.

RenderUpdateOnly 

Update all positions of modified items (robots, references and objects) and their child items.

RenderComplete 

Provokes an update and then screen display (full update and render).

Definition at line 355 of file irobodk.h.

◆ anonymous enum

anonymous enum

Display geometry in 3D, with respect to the station coordinate system. This should be called using DrawGeometry ONLY when a PluginEvent of type EventRender is triggered.

Enumerator
DrawTriangles 

Draw surfaces.

DrawLines 

Draw lines.

DrawPoints 

Draw points.

DrawSpheres 

Draw spheres.

Definition at line 370 of file irobodk.h.

◆ anonymous enum

anonymous enum

Movement types.

Enumerator
MOVE_TYPE_INVALID 

Invalid robot movement.

MOVE_TYPE_JOINT 

Joint axes movement (MoveJ).

MOVE_TYPE_LINEAR 

Linear movement (MoveL).

MOVE_TYPE_CIRCULAR 

Circular movement (MoveC).

MOVE_TYPE_LINEARSEARCH 

Linear search function.

Definition at line 59 of file irobodk.h.

◆ anonymous enum

anonymous enum

Script execution types used by IRoboDK.setRunMode and IRoboDK.RunMode.

Enumerator
RUNMODE_SIMULATE 

Performs the simulation moving the robot (default)

RUNMODE_QUICKVALIDATE 

Performs a quick check to validate the robot movements.

RUNMODE_MAKE_ROBOTPROG 

Makes the robot program.

RUNMODE_MAKE_ROBOTPROG_AND_UPLOAD 

Makes the robot program and updates it to the robot.

RUNMODE_MAKE_ROBOTPROG_AND_START 

Makes the robot program and starts it on the robot (independently from the PC).

RUNMODE_RUN_ROBOT 

Moves the real robot from the PC (PC is the client, the robot behaves like a server).

Definition at line 77 of file irobodk.h.

◆ anonymous enum

anonymous enum

Program execution type.

Enumerator
PROGRAM_RUN_ON_SIMULATOR 

Set the robot program to run on the simulator.

PROGRAM_RUN_ON_ROBOT 

Set the robot program to run on the robot.

Definition at line 98 of file irobodk.h.

◆ anonymous enum

anonymous enum

TCP calibration types.

Enumerator
CALIBRATE_TCP_BY_POINT 

Calibrate the TCP by poses touching the same point.

CALIBRATE_TCP_BY_PLANE 

Calibrate the TCP by poses touching the same plane.

Definition at line 107 of file irobodk.h.

◆ anonymous enum

anonymous enum

Reference frame calibration types.

Enumerator
CALIBRATE_FRAME_3P_P1_ON_X 

Calibrate by 3 points: [X, X+, Y+] (p1 on X axis).

CALIBRATE_FRAME_3P_P1_ORIGIN 

Calibrate by 3 points: [Origin, X+, XY+] (p1 is origin).

CALIBRATE_FRAME_6P 

Calibrate by 6 points.

CALIBRATE_TURNTABLE 

Calibrate turntable.

CALIBRATE_TURNTABLE_2X 

Calibrate a 2 axis turntable.

Definition at line 117 of file irobodk.h.

◆ anonymous enum

anonymous enum

projection types (for AddCurve)

Enumerator
PROJECTION_NONE 

No curve projection.

PROJECTION_CLOSEST 

The projection will the closest point on the surface.

PROJECTION_ALONG_NORMAL 

The projection will be done along the normal.

PROJECTION_ALONG_NORMAL_RECALC 

The projection will be done along the normal. Furthermore, the normal will be recalculated according to the surface normal.

PROJECTION_CLOSEST_RECALC 

The projection will be the closest point on the surface and the normals will be recalculated.

PROJECTION_RECALC 

The normals are recalculated according to the surface normal of the closest projection. The points are not changed.

Definition at line 135 of file irobodk.h.

◆ anonymous enum

anonymous enum

Euler type.

Enumerator
JOINT_FORMAT 

joints.

EULER_RX_RYp_RZpp 

Staubli, Mecademic.

EULER_RZ_RYp_RXpp 

ABB RobotStudio.

EULER_RZ_RYp_RZpp 

Kawasaki, Adept, Staubli.

EULER_RZ_RXp_RZpp 

CATIA, SolidWorks.

EULER_RX_RY_RZ 

Fanuc, Kuka, Motoman, Nachi.

EULER_RZ_RY_RX 

CRS.

EULER_QUEATERNION 

ABB Rapid.

Definition at line 156 of file irobodk.h.

◆ anonymous enum

anonymous enum

State of the RoboDK window.

Enumerator
WINDOWSTATE_HIDDEN 

Hide the RoboDK window. RoboDK will keep running as a process.

WINDOWSTATE_SHOW 

Display the RoboDK window.

WINDOWSTATE_MINIMIZED 

Minimize the RoboDK window.

WINDOWSTATE_NORMAL 

Display the RoboDK window in a normal state (not maximized)

WINDOWSTATE_MAXIMIZED 

Maximize the RoboDK Window.

WINDOWSTATE_FULLSCREEN 

Make the RoboDK window fullscreen.

WINDOWSTATE_CINEMA 

Display RoboDK in cinema mode (hide the toolbar and the menu).

WINDOWSTATE_FULLSCREEN_CINEMA 

Display RoboDK in cinema mode and fullscreen.

WINDOWSTATE_VIDEO 

Display RoboDK in video mode.

Definition at line 184 of file irobodk.h.

Constructor & Destructor Documentation

◆ ~IRoboDK()

virtual ~IRoboDK ( )
inlinevirtual

Definition at line 18 of file irobodk.h.

Member Function Documentation

◆ AddCurve()

virtual Item AddCurve ( const tMatrix2D curvePoints,
Item  referenceObject = nullptr,
bool  addToRef = false,
int  ProjectionType = PROJECTION_ALONG_NORMAL_RECALC 
)
pure virtual

Adds a curve provided point coordinates. The provided points must be a list of vertices. A vertex normal can be provided optionally.

Parameters
curve_pointsmatrix 3xN or 6xN -> N must be multiple of 3
reference_objectobject to add the curve and/or project the curve to the surface
add_to_refIf True, the curve will be added as part of the object in the RoboDK item tree (a reference object must be provided)
projection_typeType of projection. For example: PROJECTION_ALONG_NORMAL_RECALC will project along the point normal and recalculate the normal vector on the surface projected.
Returns
added object/curve (null if failed)

◆ AddFile()

virtual Item AddFile ( const QString &  filename,
const Item  parent = nullptr 
)
pure virtual

Loads a file and attaches it to parent. It can be any file supported by RoboDK.

Parameters
filenameAbsolute path of the file.
parentParent to attach. Leave empty for new stations or to load an object at the station root.
Returns
Newly added object. Check with item.Valid() for a successful load.

◆ AddFrame()

virtual Item AddFrame ( const QString &  name,
Item  itemparent = nullptr 
)
pure virtual

Adds a new Frame that can be referenced by a robot.

Parameters
nameName of the reference frame.
itemparentParent to attach to (such as the robot base frame).
Returns
The new reference frame created.

◆ AddMachiningProject()

virtual Item AddMachiningProject ( QString  name = "Curve follow settings",
Item  itemrobot = nullptr 
)
pure virtual

Add a new robot machining project. Machining projects can also be used for 3D printing, following curves and following points. It returns the newly created Item containing the project settings. Tip: Use the macro /RoboDK/Library/Macros/MoveRobotThroughLine.py to see an example that creates a new "curve follow project" given a list of points to follow(Option 4).

Parameters
nameName of the project settings.
itemrobotRobot to use for the project settings(optional). It is not required to specify the robot if only one robot or mechanism is available in the RoboDK station.
Returns

◆ AddPoints()

virtual Item AddPoints ( const tMatrix2D points,
Item  referenceObject = nullptr,
bool  addToRef = false,
int  ProjectionType = PROJECTION_ALONG_NORMAL_RECALC 
)
pure virtual

Adds a list of points to an object. The provided points must be a list of vertices. A vertex normal can be provided optionally.

Parameters
pointslist of points as a matrix (3xN matrix, or 6xN to provide point normals as ijk vectors)
reference_objectitem to attach the newly added geometry (optional)
add_to_refIf True, the points will be added as part of the object in the RoboDK item tree (a reference object must be provided)
projection_typeType of projection.Use the PROJECTION_* flags.
Returns
added object/shape (0 if failed)

◆ AddProgram()

virtual Item AddProgram ( const QString &  name,
Item  itemrobot = nullptr 
)
pure virtual

Adds a new Frame that can be referenced by a robot.

Parameters
nameName of the program.
itemrobotRobot that will be used.
Returns
the new program created

◆ AddShape()

virtual Item AddShape ( const tMatrix2D trianglePoints,
Item  addTo = nullptr,
bool  shapeOverride = false,
tColor color = nullptr 
)
pure virtual

Adds a shape provided triangle coordinates. Triangles must be provided as a list of vertices. A vertex normal can be provided optionally.

Parameters
trianglePointsList of vertices grouped by triangles (3xN or 6xN matrix, N must be multiple of 3 because vertices must be stacked by groups of 3)
addToitem to attach the newly added geometry (optional). Leave empty to create a new object.
shapeOverrideSet to true to replace any other existing geometry
colorOptionally specify the color as RGBA [0-1]
Returns
Added or modified item

◆ AddStation()

virtual Item AddStation ( QString  name)
pure virtual

Add a new empty station. It returns the station item added.

Parameters
nameName of the station (the title bar will be renamed to match the station name).

◆ AddTarget()

virtual Item AddTarget ( const QString &  name,
Item  itemparent = nullptr,
Item  itemrobot = nullptr 
)
pure virtual

Adds a new target that can be reached with a robot.

Parameters
nameName of the target.
itemparentParent to attach to (such as a frame).
itemrobotMain robot that will be used to go to self target.
Returns
the new target created

◆ BuildMechanism()

virtual Item BuildMechanism ( int  type,
const QList< Item > &  list_obj,
const double *  parameters,
const tJoints joints_build,
const tJoints joints_home,
const tJoints joints_senses,
const tJoints joints_lim_low,
const tJoints joints_lim_high,
const Mat  base,
const Mat  tool,
const QString &  name,
Item  robot = nullptr 
)
pure virtual

Takes a measurement with a 6D measurement device. It returns two poses, the base reference frame and the measured object reference frame. Status is negative if the measurement failed. extra data is [error_avg, error_max] in mm, if we are averaging a pose.

Parameters
typeType of the mechanism
list_objlist of object items that build the robot
parametersrobot parameters in the same order as shown in the RoboDK menu: Utilities-Build Mechanism or robot
joints_buildCurrent state of the robot (joint axes) to build the robot
joints_homejoints for the home position (it can be changed later)
joints_sensesSense of rotation of each axis (+1 or -1)
joints_lim_lowLower joint limits
joints_lim_highUpper joint limits
baseBase pose offset (robot pose)
toolTool flange pose offset
nameRobot name
robotModify existing robot
Returns
New robot or mechanism created.

◆ CalibrateReference()

virtual Mat CalibrateReference ( const tMatrix2D poses_joints,
int  method = CALIBRATE_FRAME_3P_P1_ON_X,
bool  use_joints = false,
Item  robot = nullptr 
)
pure virtual

Calibrate a Reference Frame given a list of points or joint values. Important: If the robot is calibrated, provide joint values to maximize accuracy.

Parameters
jointspoints as a 3xN matrix or nDOFsxN) - List of points or a list of robot joints.
methodtype of algorithm(by point, plane, ...) CALIBRATE_FRAME_...
use_jointsuse points or joint values. The robot item must be provided if joint values is used.
robotRobot used for the identification (if using joint values).
Returns

◆ CalibrateTool()

virtual void CalibrateTool ( const tMatrix2D poses_joints,
tXYZ  tcp_xyz,
int  format = EULER_RX_RY_RZ,
int  algorithm = CALIBRATE_TCP_BY_POINT,
Item  robot = nullptr,
double *  error_stats = nullptr 
)
pure virtual

Calibrate a tool (TCP) given a number of points or calibration joints. Important: If the robot is calibrated, provide joint values to maximize accuracy.

Parameters
poses_jointsmatrix of poses in a given format or a list of joints
error_statsstats[mean, standard deviation, max] - Output error stats summary.
formatEuler format. Optionally, use JOINT_FORMAT and provide the robot.
algorithmtype of algorithm (by point, plane, ...)
robotRobot used for the identification (if using joint values).
Returns
TCP as [x, y, z] - calculated TCP

◆ Cam2D_Add()

virtual Item Cam2D_Add ( const Item  attach_to,
const QString &  params = "" 
)
pure virtual

Open a simulated 2D camera view. Returns a handle pointer that can be used in case more than one simulated view is used.

Returns
Camera item

◆ Cam2D_Snapshot()

virtual QImage Cam2D_Snapshot ( const QString &  file,
const Item  camera = nullptr,
const QString &  params = "" 
)
pure virtual

Take a snapshot from a simulated camera view and save it to a file. Returns 1 if success, 0 otherwise.

Returns
Valid QImage if a file was not provided or an invalid/empty QImage if we are saving the file to disk

◆ Collision()

virtual int Collision ( Item  item1,
Item  item2 
)
pure virtual

Returns 1 if item1 and item2 collided. Otherwise returns 0.

Parameters
item1
item2
Returns
0 if no collisions are found.

◆ CollisionActive()

virtual int CollisionActive ( )
pure virtual

Returns the status of collision checking (COLLISION_ON=1 if the user want to have collision checking or COLLISION_OFF=0 if the user disabled collision checking).

Returns
COLLISION_ON=1 or COLLISION_OFF=0

◆ CollisionLine()

virtual bool CollisionLine ( const tXYZ  p1,
const tXYZ  p2 
)
pure virtual

Checks the collision between a line and any objects in the station. The line is composed by 2 points. Returns the collided item. Use Item.Valid() to check if there was a valid collision.

Parameters
p1Start point of the line (absolute coordinates).
p2End point of the line (absolute coordinates).
xyz_collisionCollided point.
Returns
True if collision found.

◆ Collisions()

virtual int Collisions ( )
pure virtual

Returns the number of pairs of objects that are currently in a collision state. If collision checking is not active it will calculate collision checking.

Returns
0 if no collisions are found.

◆ Command()

virtual QString Command ( const QString &  cmd,
const QString &  value = "" 
)
pure virtual

Send a special command. These commands are meant to have a specific effect in RoboDK, such as changing a specific setting or provoke specific events.

Parameters
cmdCommand Name, such as Trace, Threads or Window.
valueComand value (optional, not all commands require a value)
Returns
Command result.

◆ DrawGeometry()

virtual bool DrawGeometry ( int  drawtype,
float *  vtx_pointer,
int  vtx_size,
float  color[4],
float  geo_size = 2.0,
float *  vtx_normals = nullptr 
)
pure virtual

Draw geometry in the RoboDK's 3D view. This function must be called only inside a PluginEvent of type EventRender is triggered.

Parameters
drawtypetype of geometry (triangles, lines, points or spheres)
vtx_pointerPointer to an array of vertexs in mm, with respect to the RoboDK station (absolute reference)
vtx_sizeSize of the geometry (number of triangles, number of vertex lines or number of points)
colorColor as RGBA [0,1]
geo_sizeSize of the lines or points (ignored for surfaces)
vtx_normalsvertex normals as unitary vectors (optional, only used to draw surfaces)
Returns
true if successful, false if input is not correct or build does not support drawing in double or single precision floating point

◆ DrawTexture()

virtual bool DrawTexture ( const QImage *  image,
const float *  vtx_pointer,
const float *  texture_coords,
int  num_triangles,
float *  vtx_normals = nullptr 
)
pure virtual

Draw a texture in the RoboDK's 3D view. This function must be called only inside a PluginEvent of type EventRender is triggered.

Parameters
imagePointer to an image in RGBA format (it is important to have it in RGBA)
vtx_pointerPointer to an array of vertexs in mm, with respect to the RoboDK station (absolute reference)
texture_coordsTexture coordinates (2D coordinates per vertex)
num_trianglesSize of the geometry (number of triangles)
vtx_normalsvertex normals as unitary vectors (optional)
Returns
true if successful, false if input is not correct or build does not support drawing in double or single precision floating point

◆ getActiveStation()

virtual Item getActiveStation ( )
pure virtual

Returns the active station item (station currently visible).

Returns

◆ getCollisionItems()

virtual QList< Item > getCollisionItems ( QList< int > *  link_id_list = nullptr)
pure virtual

Return the list of items that are in a collision state. This function can be used after calling Collisions() to retrieve the items that are in a collision state.

Parameters
link_id_listList of robot link IDs that are in collision (0 for objects and tools).
Returns
List of items that are in a collision state.

◆ getCursorXYZ()

virtual Item getCursorXYZ ( int  x = -1,
int  y = -1,
tXYZ  xyzStation = nullptr 
)
pure virtual

Returns the position of the cursor as XYZ coordinates (by default), or the 3D position of a given set of 2D coordinates of the window (x & y coordinates in pixels from the top left corner) The XYZ coordinates returned are given with respect to the RoboDK station(absolute reference). If no coordinates are provided, the current position of the cursor is retrieved.

Parameters
xX coordinate in pixels
yY coordinate in pixels
xyzStation
Returns
Item under the mouse cursor.

◆ getData()

virtual QByteArray getData ( const QString &  param)
pure virtual

Gets a plugin defined parameter from the open RoboDK station. Saved parameters can be viewed or deleted by right clicking the station and selecting "shared parameters".

Parameters
paramRoboDK data parameter
Returns
Data value.

◆ getFlagsItem()

virtual int getFlagsItem ( Item  item)
pure virtual

Retrieve current item flags. Item flags allow defining how much access the user has to item-specific features. Use FLAG_ITEM_* flags to set one or more flags.

Parameters
item
Returns

◆ getItem()

virtual Item getItem ( const QString &  name,
int  itemtype = -1 
)
pure virtual

Returns an item by its name. If there is no exact match it will return the last closest match.

Parameters
nameItem name
itemtypeFilter by item type RoboDK.ITEM_TYPE_...
Returns
Item or nullptr if no item was found

◆ getItemList()

virtual QList< Item > getItemList ( int  filter = -1)
pure virtual

Returns a list of items (list of names or pointers) of all available items in the currently open station in RoboDK. Optionally, use a filter to return specific items (example: getItemListNames(filter = ITEM_CASE_ROBOT))

Parameters
filterITEM_TYPE
Returns
List of items with a match

◆ getItemListNames()

virtual QStringList getItemListNames ( int  filter = -1)
pure virtual

Returns a list of items (list of names or Items) of all available items in the currently open station in RoboDK. Optionally, use a filter to return specific items (example: getItemListNames(filter = ITEM_TYPE_ROBOT))

Parameters
filterITEM_TYPE_...
Returns
List of item names

◆ getOpenStations()

virtual QList< Item > getOpenStations ( )
pure virtual

Returns the list of open stations in RoboDK.

Returns

◆ getParam()

virtual QString getParam ( const QString &  param)
pure virtual

Gets a global or a user parameter from the open RoboDK station. The parameters can also be modified by right clicking the station and selecting "shared parameters" Some available parameters: PATH_OPENSTATION = folder path of the current .stn file FILE_OPENSTATION = file path of the current .stn file PATH_DESKTOP = folder path of the user's folder Other parameters can be added or modified by the user

Parameters
paramRoboDK parameter
Returns
Parameter value.

◆ getParamBytes()

virtual QByteArray getParamBytes ( const QString &  param)
pure virtual

Gets a user parameter from the open RoboDK station (Bytes type). Special QByteArray parameters can be added or modified by plugins and scripts (not by the user).

Parameters
paramRoboDK parameter
Returns
Parameter data.

◆ getParams()

virtual QList< QPair< QString, QString > > getParams ( )
pure virtual

Gets all the user parameters from the open RoboDK station. The parameters can also be modified by right clicking the station and selecting "shared parameters" User parameters can be added or modified by the user

Returns
List of pairs of strings as parameter-value (list of a list)

◆ IsInside()

virtual bool IsInside ( Item  object_inside,
Item  object_parent 
)
pure virtual

Check if an object is fully inside another one.

Parameters
object_inside
object_parent
Returns
Returns true if object_inside is inside the object_parent

◆ ItemUserPick() [1/2]

virtual Item ItemUserPick ( const QString &  message,
const QList< Item > &  list_choices,
int  id_selected = -1 
)
pure virtual

Shows a RoboDK popup to select one object from the open RoboDK station. You can provide a few items to choose from and, optionally, a selected index.

Parameters
messageMessage to show in the pop up
list_choicesItems to choose from
id_selectedSelected id from list_choices if we want to select an item
Returns
Picked item or nullptr if the user selected Cancel

◆ ItemUserPick() [2/2]

virtual Item ItemUserPick ( const QString &  message = "Pick one item",
int  itemtype = -1 
)
pure virtual

Shows a RoboDK popup to select one object from the open RoboDK station. An item type can be specified to filter desired items. If no type is specified, all items are selectable.

Parameters
messageMessage to show in the pop up
itemtypeoptionally filter by RoboDK.ITEM_TYPE_*
Returns
Picked item or nullptr if the user selected Cancel

◆ LaserTrackerMeasure()

virtual bool LaserTrackerMeasure ( tXYZ  xyz,
const tXYZ  estimate,
bool  search = false 
)
pure virtual

Takes a laser tracker measurement with respect to its own reference frame. If an estimate point is provided, the laser tracker will first move to those coordinates. If search is True, the tracker will search for a target.

Parameters
xyz
estimate
searchTrue to search near the estimated value.
Returns
True if successful.

◆ License()

virtual QString License ( )
pure virtual

Returns the license as a readable string (same name shown in the RoboDK's title bar, on top of the main menu).

Returns

◆ MeasurePose()

virtual bool MeasurePose ( Mat pose,
double  data[10],
int  target = -1,
int  time_avg_ms = 0,
const tXYZ  tool_tip = nullptr 
)
pure virtual

Takes a pose measurement (requires a supported measurement system).

Parameters
poseMeasured pose
poseAdditional returned data [visible targets, button state, average error, max error]
targetTarget type
time_avg_msAverage the pose from the buffer
tool_tipXYZ position of the tool tip for average calculation
Returns
True if successful, false if unable to measure.

◆ PluginCommand()

virtual QString PluginCommand ( const QString &  plugin_name = "",
const QString &  plugin_command = "",
const QString &  value = "" 
)
pure virtual

Send a specific command to a RoboDK plugin. The command and value (optional) must be handled by your plugin. It returns the result as a string.

Parameters
plugin_nameThe plugin name must match the PluginName() implementation in the RoboDK plugin.
plugin_commandSpecific command handled by your plugin.
valueSpecific value (optional) handled by your plugin.

◆ PluginLoad()

virtual void PluginLoad ( const QString &  plugin_name = "",
int  load = 1 
)
pure virtual

Load or unload the specified plugin (path to DLL, dylib or SO file). If the plugin is already loaded it will unload the plugin and reload it. Pass an empty plugin_name to reload all plugins.

Parameters
plugin_nameName of the plugin or path (if it is not in the default directory.
loadload the plugin (1/default) or unload (0)

◆ Popup_ISO9283_CubeProgram()

virtual Item Popup_ISO9283_CubeProgram ( Item  robot = nullptr,
tXYZ  center = nullptr,
double  side = -1 
)
pure virtual

Show the popup menu to create the ISO9283 path for position accuracy, repeatability and path accuracy performance testing.

Parameters
robot
centerXYZ position of the center of the cube with respect to the robot base, in mm.
sideCube side, in mm.
Returns
IS9283 Program or nullptr if the user cancelled.

◆ ProgramStart()

virtual bool ProgramStart ( const QString &  progname,
const QString &  defaultfolder = "",
const QString &  postprocessor = "",
Item  robot = nullptr 
)
pure virtual

Defines the name of the program when the program is generated. It is also possible to specify the name of the post processor as well as the folder to save the program. This method must be called before any program output is generated (before any robot movement or other instruction).

Parameters
prognameName of the program.
defaultfolderFolder to save the program, leave empty to use the default program folder.
postprocessorName of the post processor (for a post processor in C:/RoboDK/Posts/Fanuc_post.py it is possible to provide "Fanuc_post.py" or simply "Fanuc_post").
robotRobot to link.
Returns

◆ ProjectPoints()

virtual bool ProjectPoints ( tMatrix2D points,
Item  objectProject,
int  ProjectionType = PROJECTION_ALONG_NORMAL_RECALC 
)
pure virtual

Projects a list of points given its coordinates. The provided points must be a list of [XYZ] coordinates. Optionally, a vertex normal can be provided [XYZijk].

Parameters
pointsMatrix 3xN or 6xN: list of points to project. This matrix will contain the modified points after the projection.
object_projectObject to project.
projection_typeType of projection. For example: PROJECTION_ALONG_NORMAL_RECALC will project along the point normal and recalculate the normal vector on the surface projected.
Returns
True if projection succeeded, False if input is not correct

◆ Render()

virtual void Render ( int  flags = RenderComplete)
pure virtual

Update the scene.

Parameters
flagsSet to RenderComplete for a full update or RenderScreen to redraw the scene without internally updating dependencies.

◆ RunCode()

virtual int RunCode ( const QString &  code,
bool  code_is_fcn_call = false 
)
pure virtual

Adds code to run in the program output. If the program exists it will also run the program in simulation mode.

Parameters
code
code_is_fcn_call
Returns

◆ RunMessage()

virtual void RunMessage ( const QString &  message,
bool  message_is_comment = false 
)
pure virtual

Shows a message or a comment in the output robot program.

Parameters
message
message_is_comment

◆ RunMode()

virtual int RunMode ( )
pure virtual

Returns the behavior of the RoboDK API. By default, RoboDK shows the path simulation for movement instructions (run_mode=1).

Returns
int = RUNMODE RUNMODE_SIMULATE=1 performs the simulation moving the robot (default) RUNMODE_QUICKVALIDATE=2 performs a quick check to validate the robot movements RUNMODE_MAKE_ROBOTPROG=3 makes the robot program RUNMODE_RUN_REAL=4 moves the real robot is it is connected

◆ RunProgram()

virtual int RunProgram ( const QString &  function_w_params)
pure virtual

Adds a function call in the program output. RoboDK will handle the syntax when the code is generated for a specific robot. If the program exists it will also run the program in simulate mode.

Parameters
function_w_paramsFunction name with parameters (if any).
Returns

◆ Save()

virtual void Save ( const QString &  filename,
const Item  itemsave = nullptr 
)
pure virtual

Save an item to a file. If no item is provided, the open station is saved.

Parameters
filenameAbsolute path to save the file
itemsaveObject or station to save. Leave empty to automatically save the current station.

◆ Selection()

virtual QList< Item > Selection ( )
pure virtual

Returns the list of items selected (it can be one or more items).

Returns
List of selected items.

◆ setActiveStation()

virtual void setActiveStation ( Item  stn)
pure virtual

Set the active station (project currently visible).

Parameters
stationstation item, it can be previously loaded as an RDK file.

◆ setCollisionActive()

virtual int setCollisionActive ( int  check_state = COLLISION_ON)
pure virtual

Turn collision checking ON or OFF (COLLISION_OFF/COLLISION_OFF) according to the collision map. If collision checking is activated it returns the number of pairs of objects that are currently in a collision state.

Parameters
check_state
Returns
Number of pairs of objects in a collision state (0 if no collisions).

◆ setCollisionActivePair()

virtual bool setCollisionActivePair ( int  check_state,
Item  item1,
Item  item2,
int  id1 = 0,
int  id2 = 0 
)
pure virtual

Set collision checking ON or OFF (COLLISION_ON/COLLISION_OFF) for a specific pair of objects. This allows altering the collision map for Collision checking. Specify the link id for robots or moving mechanisms (id 0 is the base).

Parameters
check_stateSet to COLLISION_ON or COLLISION_OFF
item1Item 1
item2Item 2
id1Joint id for Item 1 (if Item 1 is a robot or a mechanism)
id2Joint id for Item 2 (if Item 2 is a robot or a mechanism)
Returns
Returns true if succeeded. Returns false if setting the pair failed (wrong id was provided)

◆ setData()

virtual void setData ( const QString &  param,
const QByteArray &  value 
)
pure virtual

Sets a data parameter saved with the RoboDK station. If the parameters exists, it will be updated. If not, it will be added to the station. Saved parameters can be viewed or deleted by right clicking the station and selecting "shared parameters".

Parameters
paramRoboDK data parameter name
valuedata value
Returns

◆ setFlagsItem()

virtual void setFlagsItem ( int  flags = FLAG_ITEM_ALL,
Item  item = nullptr 
)
pure virtual

Update item flags. Item flags allow defining how much access the user has to item-specific features. Use FLAG_ITEM_* flags to set one or more flags.

Parameters
item
flagsNew flags

◆ setFlagsRoboDK()

virtual void setFlagsRoboDK ( int  flags = FLAG_ROBODK_ALL)
pure virtual

Update the RoboDK flags. RoboDK flags allow defining how much access the user has to certain RoboDK features. Use FLAG_ROBODK_* variables to set one or more flags.

Parameters
flagsstate of the window(FLAG_ROBODK_*)

◆ setInteractiveMode()

virtual void setInteractiveMode ( int  mode_type,
int  default_ref_flags,
const QList< Item > *  custom_object = nullptr,
int  custom_ref_flags = 0 
)
pure virtual

Set the interactive mode to define the behavior when navigating and selecting items in RoboDK's 3D view.

Parameters
mode_typeThe mode type defines what accion occurs when the 3D view is selected (Select object, Pan, Rotate, Zoom, Move Objects, ...)
default_ref_flagsWhen a movement is specified, we can provide what motion we allow by default with respect to the coordinate system (set apropriate flags)
custom_objectProvide a list of optional items to customize the move behavior for these specific items (important: the lenght of custom_ref_flags must match)
custom_ref_flagsProvide a matching list of flags to customize the movement behavior for specific items

◆ setParam()

virtual void setParam ( const QString &  param,
const QString &  value 
)
pure virtual

Sets a global parameter from the RoboDK station. If the parameters exists, it will be modified. If not, it will be added to the station. The parameters can also be modified by right clicking the station and selecting "shared parameters".

Parameters
paramRoboDK parameter
valuevalue
Returns

◆ setParamBytes()

virtual void setParamBytes ( const QString &  param,
const QByteArray &  value 
)
pure virtual

Gets a user parameter from the open RoboDK station (Bytes type). Special QByteArray parameters can be added or modified by plugins and scripts (not by the user).

Parameters
paramRoboDK parameter
valueData value

◆ SetRobotParams()

virtual bool SetRobotParams ( Item  robot,
tMatrix2D  dhm,
Mat  poseBase,
Mat  poseTool 
)
pure virtual

Set the nominal robot parameters.

Parameters
robot
dhmD-H Modified table (Denavit Hartenberg Modified)
poseBase
poseTool
Returns

◆ setRunMode()

virtual void setRunMode ( int  run_mode = 1)
pure virtual

Sets the behavior of the RoboDK API. By default, RoboDK shows the path simulation for movement instructions (run_mode=1=RUNMODE_SIMULATE). Setting the run_mode to RUNMODE_QUICKVALIDATE allows performing a quick check to see if the path is feasible. if robot.Connect() is used, RUNMODE_RUN_FROM_PC is selected automatically.

Parameters
run_modeint = RUNMODE RUNMODE_SIMULATE=1 performs the simulation moving the robot (default) RUNMODE_QUICKVALIDATE=2 performs a quick check to validate the robot movements RUNMODE_MAKE_ROBOTPROG=3 makes the robot program RUNMODE_RUN_REAL=4 moves the real robot is it is connected

◆ setSimulationSpeed()

virtual void setSimulationSpeed ( double  speed)
pure virtual

Sets the current simulation speed. Set the speed to 1 for a real-time simulation. The slowest speed allowed is 0.001 times the real speed. Set to a high value (>100) for fast simulation results.

Parameters
speedSimulation speed ratio (1 means real time simulation)

◆ setViewPose()

virtual void setViewPose ( const Mat pose)
pure virtual

Set the pose of the wold reference frame with respect to the user view (camera/screen).

Parameters
poseView pose.

◆ setWindowState()

virtual void setWindowState ( int  windowstate = WINDOWSTATE_NORMAL)
pure virtual

Set the state of the RoboDK window

Parameters
windowstate

◆ ShowMessage()

virtual void ShowMessage ( const QString &  message,
bool  popup = true 
)
pure virtual

Show a message in RoboDK (it can be blocking or non blocking in the status bar)

Parameters
messageMessage to display
popupSet to true to make the message blocking or set to false to make it non blocking

◆ SimulationSpeed()

virtual double SimulationSpeed ( )
pure virtual

Gets the current simulation speed. Set the speed to 1 for a real-time simulation.

Returns
Simulation speed ratio (1 means real time simulation)

◆ StereoCamera_Measure()

virtual int StereoCamera_Measure ( Mat  pose1,
Mat  pose2,
int &  npoints1,
int &  npoints2,
double *  data = nullptr,
float  time_avg = 0,
const tXYZ  tip_xyz = nullptr 
)
pure virtual

Takes a measurement with a 6D measurement device. It returns two poses, the base reference frame and the measured object reference frame. Status is negative if the measurement failed. extra data is [error_avg, error_max] in mm, if we are averaging a pose.

Parameters
pose1Pose of the main object
pose2Pose of the reference object
npoints1Number of points visible for object 1
npoints2Number of points visible for object 2t
statusStatus flag
dataAdditional data from the device
time_avgTake the measurement for a period of time and average the result.
tip_xyzOffet the measurement to the tip.
Returns
Status flags.

◆ Valid()

virtual bool Valid ( const Item  item_check)
pure virtual

Check if an item is valid (not null and available in the open station)

Parameters
item_checkItem to check
Returns
True if the item exists, false otherwise

◆ ViewPose()

virtual Mat ViewPose ( )
pure virtual

Get the pose of the wold reference frame with respect to the user view (camera/screen).

Returns
View pose.

The documentation for this class was generated from the following file: