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 byIRoboDK.setRunModeandIRoboDK.RunMode.More...
enum {PROGRAM_RUN_ON_SIMULATOR= 1 ,PROGRAM_RUN_ON_ROBOT= 2 }
箴gram 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 }
碰撞检查状态。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 usingDrawGeometryONLY when a PluginEvent of type EventRender is triggered.More...

Public Member Functions

virtualItem 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<Item> getItemList(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(constItemitem_check)=0
Check if an item is valid (not null and available in the open station)More...
virtualItem 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...
virtualItem 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 windowMore...
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,Itemitem=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(Itemitem)=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...
virtualItem AddFile(const QString &filename, constItemparent=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, constItemitemsave=nullptr)=0
Save an item to a file. If no item is provided, the open station is saved.More...
virtualItem AddShape(consttMatrix2D*trianglePoints,ItemaddTo=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...
virtualItem AddCurve(consttMatrix2D*curvePoints,ItemreferenceObject=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...
virtualItem AddPoints(consttMatrix2D*points,ItemreferenceObject=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 箴jectPoints(tMatrix2D*points,ItemobjectProject, int ProjectionType=PROJECTION_ALONG_NORMAL_RECALC)=0
箴jects 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.
virtualItem AddTarget(const QString &name,Itemitemparent=nullptr,Itemitemrobot=nullptr)=0
Adds a new target that can be reached with a robot.More...
virtualItem AddFrame(const QString &name,Itemitemparent=nullptr)=0
Adds a new Frame that can be referenced by a robot.More...
virtualItem AddProgram(const QString &name,Itemitemrobot=nullptr)=0
Adds a new Frame that can be referenced by a robot.More...
virtualItem AddStation(QString name)=0
Add a new empty station. It returns the station item added.More...
virtualItem 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<Item> getOpenStations()=0
Returns the list of open stations in RoboDK.More...
virtual void setActiveStation(Itemstn)=0
Set the active station (project currently visible).More...
virtualItem 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(Itemobject_inside,Itemobject_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,Itemitem1,Itemitem2, 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 科尔isions()=0
返回的数量对铜的对象rrently in a collision state. If collision checking is not active it will calculate collision checking.More...
virtual int 科尔ision(Itemitem1,Itemitem2)=0
Returns 1 if item1 and item2 collided. Otherwise returns 0.More...
virtual QList<Item> getCollisionItems(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科尔isions()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 userMore...
virtual QString getParam(const QString ¶m)=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 userMore...
virtual void setParam(const QString ¶m, 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 科尔isionLine(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(consttMatrix2D*poses_joints, tXYZ tcp_xyz, int format=EULER_RX_RY_RZ, int algorithm=CALIBRATE_TCP_BY_POINT,Itemrobot=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...
virtualMat CalibrateReference(consttMatrix2D*poses_joints, int method=CALIBRATE_FRAME_3P_P1_ON_X, bool use_joints=false,Itemrobot=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 箴gramStart(const QString &progname, const QString &defaultfolder="", const QString &postprocessor="",Itemrobot=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(constMat&pose)=0
Set the pose of the wold reference frame with respect to the user view (camera/screen).More...
virtualMat ViewPose()=0
Get the pose of the wold reference frame with respect to the user view (camera/screen).More...
virtual bool SetRobotParams(Itemrobot,tMatrix2Ddhm,MatposeBase,MatposeTool)=0
Set the nominal robot parameters.More...
virtualItem 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<Item> Selection()=0
Returns the list of items selected (it can be one or more items).More...
virtualItem Popup_ISO9283_CubeProgram(Itemrobot=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 ¶m)=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 ¶m, 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 科尔isionActive()=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 ¶m)=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 ¶m, 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(Matpose1,Matpose2, 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...
virtualItem BuildMechanism(int type, const QList<Item> &list_obj, const double *parameters, consttJoints&joints_build, consttJoints&joints_home, consttJoints&joints_senses, consttJoints&joints_lim_low, consttJoints&joints_lim_high, constMatbase, constMattool, const QString &name,Itemrobot=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...
virtualItem Cam2D_Add(constItemattach_to, const QString ¶ms="")=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, constItemcamera=nullptr, const QString ¶ms="")=0
Take a snapshot from a simulated camera view and save it to a file. Returns 1 if success, 0 otherwise.More...
virtualItem 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 line14of fileirobodk.h.

Member Enumeration Documentation

anonymous enum

anonymous enum

Instruction types.

Enumerator
INS_TYPE_INVALID

无效的指令。

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

箴gram call or raw code output.

INS_TYPE_PRINT

Display message on the teach pendant.

Definition at line23of fileirobodk.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 line215of fileirobodk.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 line233of fileirobodk.h.

anonymous enum

anonymous enum

Spray gun simulation:

Enumerator
SPRAY_OFF

Activate the spray simulation.

Definition at line248of fileirobodk.h.

anonymous enum

anonymous enum

碰撞检查状态。

Enumerator
COLLISION_OFF

Do not use collision checking.

COLLISION_ON

Use collision checking.

Definition at line255of fileirobodk.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 line264of fileirobodk.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 line324of fileirobodk.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

箴vokes an update and then screen display (full update and render).

Definition at line355of fileirobodk.h.

anonymous enum

anonymous enum

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

Enumerator
DrawTriangles

Draw surfaces.

DrawLines

Draw lines.

DrawPoints

画点。

DrawSpheres

Draw spheres.

Definition at line370of fileirobodk.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 line59of fileirobodk.h.

anonymous enum

anonymous enum

Script execution types used byIRoboDK.setRunModeandIRoboDK.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 line77of fileirobodk.h.

anonymous enum

anonymous enum

箴gram 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 line98of fileirobodk.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 line107of fileirobodk.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 line117of fileirobodk.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

投影将沿着正常完成。

PROJECTION_ALONG_NORMAL_RECALC

投影将沿着正常完成。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 line135of fileirobodk.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 line156of fileirobodk.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 line184of fileirobodk.h.

Constructor & Destructor Documentation

~IRoboDK()

virtual ~IRoboDK ( )
inlinevirtual

Definition at line18of fileirobodk.h.

Member Function Documentation

AddCurve()

virtualItemAddCurve ( consttMatrix2D* curvePoints,
Item referenceObject=nullptr,
bool addToRef=false,
int 箴jectionType=PROJECTION_ALONG_NORMAL_RECALC
)
纯虚拟

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

Parameters
curve_points matrix 3xN or 6xN -> N must be multiple of 3
reference_object object to add the curve and/or project the curve to the surface
add_to_ref If True, the curve will be added as part of the object in the RoboDK item tree (a reference object must be provided)
projection_type Type 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()

virtualItemAddFile ( const QString & filename,
constItem parent=nullptr
)
纯虚拟

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

Parameters
filename Absolute path of the file.
parent Parent 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()

virtualItemAddFrame ( const QString & name,
Item itemparent=nullptr
)
纯虚拟

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

Parameters
name Name of the reference frame.
itemparent Parent to attach to (such as the robot base frame).
Returns
The new reference frame created.

AddMachiningProject()

virtualItemAddMachiningProject ( QString name="Curve follow settings",
Item itemrobot=nullptr
)
纯虚拟

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
name Name of the project settings.
itemrobot Robot 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()

virtualItemAddPoints ( consttMatrix2D* points,
Item referenceObject=nullptr,
bool addToRef=false,
int 箴jectionType=PROJECTION_ALONG_NORMAL_RECALC
)
纯虚拟

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
points list of points as a matrix (3xN matrix, or 6xN to provide point normals as ijk vectors)
reference_object item to attach the newly added geometry (optional)
add_to_ref If True, the points will be added as part of the object in the RoboDK item tree (a reference object must be provided)
projection_type Type of projection.Use the PROJECTION_* flags.
Returns
added object/shape (0 if failed)

AddProgram()

virtualItemAddProgram ( const QString & name,
Item itemrobot=nullptr
)
纯虚拟

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

Parameters
name Name of the program.
itemrobot Robot that will be used.
Returns
the new program created

AddShape()

virtualItemAddShape ( consttMatrix2D* trianglePoints,
Item addTo=nullptr,
bool shapeOverride=false,
tColor* color=nullptr
)
纯虚拟

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

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

AddStation()

virtualItemAddStation ( QString name )
纯虚拟

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

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

AddTarget()

virtualItemAddTarget ( const QString & name,
Item itemparent=nullptr,
Item itemrobot=nullptr
)
纯虚拟

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

Parameters
name Name of the target.
itemparent Parent to attach to (such as a frame).
itemrobot Main robot that will be used to go to self target.
Returns
the new target created

BuildMechanism()

virtualItemBuildMechanism ( int type,
const QList<Item> & list_obj,
const double * parameters,
consttJoints& joints_build,
consttJoints& joints_home,
consttJoints& joints_senses,
consttJoints& joints_lim_low,
consttJoints& joints_lim_high,
constMat base,
constMat tool,
const QString & name,
Item robot=nullptr
)
纯虚拟

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
type Type of the mechanism
list_obj list of object items that build the robot
parameters robot parameters in the same order as shown in the RoboDK menu: Utilities-Build Mechanism or robot
joints_build Current state of the robot (joint axes) to build the robot
joints_home joints for the home position (it can be changed later)
joints_senses Sense of rotation of each axis (+1 or -1)
joints_lim_low Lower joint limits
joints_lim_high Upper joint limits
base Base pose offset (robot pose)
tool Tool flange pose offset
name Robot name
robot Modify existing robot
Returns
New robot or mechanism created.

CalibrateReference()

virtualMatCalibrateReference ( consttMatrix2D* poses_joints,
int method=CALIBRATE_FRAME_3P_P1_ON_X,
bool use_joints=false,
Item robot=nullptr
)
纯虚拟

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
joints points as a 3xN matrix or nDOFsxN) - List of points or a list of robot joints.
method type of algorithm(by point, plane, ...) CALIBRATE_FRAME_...
use_joints use points or joint values. The robot item must be provided if joint values is used.
robot Robot used for the identification (if using joint values).
Returns

CalibrateTool()

virtual void CalibrateTool ( consttMatrix2D* poses_joints,
tXYZ tcp_xyz,
int format=EULER_RX_RY_RZ,
int 算法rithm=CALIBRATE_TCP_BY_POINT,
Item robot=nullptr,
double * error_stats=nullptr
)
纯虚拟

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_joints matrix of poses in a given format or a list of joints
error_stats stats[mean, standard deviation, max] - Output error stats summary.
format Euler format. Optionally, use JOINT_FORMAT and provide the robot.
算法rithm type of algorithm (by point, plane, ...)
robot Robot used for the identification (if using joint values).
Returns
TCP as [x, y, z] - calculated TCP

Cam2D_Add()

virtualItemCam2D_Add ( constItem attach_to,
const QString & params=""
)
纯虚拟

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,
constItem camera=nullptr,
const QString & params=""
)
纯虚拟

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

科尔ision()

virtual int Collision ( Item item1,
Item item2
)
纯虚拟

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

Parameters
item1
item2
Returns
0 if no collisions are found.

科尔isionActive()

virtual int CollisionActive ( )
纯虚拟

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

科尔isionLine()

virtual bool CollisionLine ( const tXYZ p1,
const tXYZ p2
)
纯虚拟

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
p1 Start point of the line (absolute coordinates).
p2 End point of the line (absolute coordinates).
xyz_collision 科尔ided point.
Returns
True if collision found.

科尔isions()

virtual int Collisions ( )
纯虚拟

返回的数量对铜的对象rrently 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=""
)
纯虚拟

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
cmd Command Name, such as Trace, Threads or Window.
value Comand 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
)
纯虚拟

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

Parameters
drawtype type of geometry (triangles, lines, points or spheres)
vtx_pointer Pointer to an array of vertexs in mm, with respect to the RoboDK station (absolute reference)
vtx_size Size of the geometry (number of triangles, number of vertex lines or number of points)
color Color as RGBA [0,1]
geo_size Size of the lines or points (ignored for surfaces)
vtx_normals 顶点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
)
纯虚拟

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

Parameters
image Pointer to an image in RGBA format (it is important to have it in RGBA)
vtx_pointer Pointer to an array of vertexs in mm, with respect to the RoboDK station (absolute reference)
texture_coords Texture coordinates (2D coordinates per vertex)
num_triangles Size of the geometry (number of triangles)
vtx_normals 顶点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()

virtualItemgetActiveStation ( )
纯虚拟

Returns the active station item (station currently visible).

Returns

getCollisionItems()

virtual QList<Item> getCollisionItems ( QList< int > * link_id_list=nullptr )
纯虚拟

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

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

getCursorXYZ()

virtualItemgetCursorXYZ ( int x=-1,
int y=-1,
tXYZ xyzStation=nullptr
)
纯虚拟

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
x X coordinate in pixels
y Y coordinate in pixels
xyzStation
Returns
Item under the mouse cursor.

getData()

virtual QByteArray getData ( const QString & param )
纯虚拟

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
param RoboDK data parameter
Returns
Data value.

getFlagsItem()

virtual int getFlagsItem ( Item item )
纯虚拟

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()

virtualItemgetItem ( const QString & name,
int itemtype=-1
)
纯虚拟

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

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

getItemList()

virtual QList<Item> getItemList ( int filter=-1 )
纯虚拟

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
filter ITEM_TYPE
Returns
List of items with a match

getItemListNames()

virtual QStringList getItemListNames ( int filter=-1 )
纯虚拟

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
filter ITEM_TYPE_...
Returns
List of item names

getOpenStations()

virtual QList<Item> getOpenStations ( )
纯虚拟

Returns the list of open stations in RoboDK.

Returns

getParam()

virtual QString getParam ( const QString & param )
纯虚拟

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
param RoboDK parameter
Returns
Parameter value.

getParamBytes()

virtual QByteArray getParamBytes ( const QString & param )
纯虚拟

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
param RoboDK parameter
Returns
Parameter data.

getParams()

virtual QList< QPair< QString, QString > > getParams ( )
纯虚拟

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
)
纯虚拟

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]

virtualItemItemUserPick ( const QString & message,
const QList<Item> & list_choices,
int id_selected=-1
)
纯虚拟

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
message Message to show in the pop up
list_choices Items to choose from
id_selected Selected id from list_choices if we want to select an item
Returns
Picked item or nullptr if the user selected Cancel

ItemUserPick()[2/2]

virtualItemItemUserPick ( const QString & message="Pick one item",
int itemtype=-1
)
纯虚拟

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
message Message to show in the pop up
itemtype optionally 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
)
纯虚拟

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
search True to search near the estimated value.
Returns
True if successful.

License()

virtual QString License ( )
纯虚拟

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
)
纯虚拟

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

Parameters
pose Measured pose
pose Additional returned data [visible targets, button state, average error, max error]
target Target type
time_avg_ms Average the pose from the buffer
tool_tip XYZ 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=""
)
纯虚拟

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_name The plugin name must match the PluginName() implementation in the RoboDK plugin.
plugin_command Specific command handled by your plugin.
value Specific value (optional) handled by your plugin.

PluginLoad()

virtual void PluginLoad ( const QString & plugin_name="",
int load=1
)
纯虚拟

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_name Name of the plugin or path (if it is not in the default directory.
load load the plugin (1/default) or unload (0)

Popup_ISO9283_CubeProgram ()

virtualItemPopup_ISO9283_CubeProgram ( Item robot=nullptr,
tXYZ center=nullptr,
double side=-1
)
纯虚拟

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

Parameters
robot
center XYZ position of the center of the cube with respect to the robot base, in mm.
side Cube 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
)
纯虚拟

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
progname Name of the program.
defaultfolder Folder to save the program, leave empty to use the default program folder.
postprocessor Name 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").
robot Robot to link.
Returns

箴jectPoints()

virtual bool ProjectPoints ( tMatrix2D* points,
Item objectProject,
int 箴jectionType=PROJECTION_ALONG_NORMAL_RECALC
)
纯虚拟

箴jects 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
points Matrix 3xN or 6xN: list of points to project. This matrix will contain the modified points after the projection.
object_project Object to project.
projection_type Type 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 )
纯虚拟

Update the scene.

Parameters
flags Set 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
)
纯虚拟

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
)
纯虚拟

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

Parameters
message
message_is_comment

RunMode()

virtual int RunMode ( )
纯虚拟

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 )
纯虚拟

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_params Function name with parameters (if any).
Returns

Save()

virtual void Save ( const QString & filename,
constItem itemsave=nullptr
)
纯虚拟

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

Parameters
filename Absolute path to save the file
itemsave Object or station to save. Leave empty to automatically save the current station.

Selection()

virtual QList<Item> Selection ( )
纯虚拟

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

Returns
List of selected items.

setActiveStation()

virtual void setActiveStation ( Item stn )
纯虚拟

Set the active station (project currently visible).

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

setCollisionActive()

virtual int setCollisionActive ( int check_state=COLLISION_ON )
纯虚拟

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
)
纯虚拟

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_state Set to COLLISION_ON or COLLISION_OFF
item1 Item 1
item2 Item 2
id1 Joint id for Item 1 (if Item 1 is a robot or a mechanism)
id2 Joint 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
)
纯虚拟

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
param RoboDK data parameter name
value data value
Returns

setFlagsItem()

virtual void setFlagsItem ( int flags=FLAG_ITEM_ALL,
Item item=nullptr
)
纯虚拟

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
flags New flags

setFlagsRoboDK()

virtual void setFlagsRoboDK ( int flags=FLAG_ROBODK_ALL )
纯虚拟

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
flags state 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
)
纯虚拟

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

Parameters
mode_type The mode type defines what accion occurs when the 3D view is selected (Select object, Pan, Rotate, Zoom, Move Objects, ...)
default_ref_flags When a movement is specified, we can provide what motion we allow by default with respect to the coordinate system (set apropriate flags)
custom_object 箴vide 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_flags 箴vide a matching list of flags to customize the movement behavior for specific items

setParam()

virtual void setParam ( const QString & param,
const QString & value
)
纯虚拟

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
param RoboDK parameter
value value
Returns

setParamBytes()

virtual void setParamBytes ( const QString & param,
const QByteArray & value
)
纯虚拟

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
param RoboDK parameter
value Data value

SetRobotParams()

virtual bool SetRobotParams ( Item robot,
tMatrix2D dhm,
Mat poseBase,
Mat poseTool
)
纯虚拟

Set the nominal robot parameters.

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

setRunMode()

virtual void setRunMode ( int run_mode=1 )
纯虚拟

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_mode 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

setSimulationSpeed()

virtual void setSimulationSpeed ( double speed )
纯虚拟

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
speed Simulation speed ratio (1 means real time simulation)

setViewPose()

virtual void setViewPose ( constMat& pose )
纯虚拟

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

Parameters
pose View pose.

setWindowState()

virtual void setWindowState ( int windowstate=WINDOWSTATE_NORMAL )
纯虚拟

Set the state of the RoboDK window

Parameters
windowstate

ShowMessage()

virtual void ShowMessage ( const QString & message,
bool popup=true
)
纯虚拟

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

Parameters
message Message to display
popup Set to true to make the message blocking or set to false to make it non blocking

SimulationSpeed()

virtual double SimulationSpeed ( )
纯虚拟

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
)
纯虚拟

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
pose1 Pose of the main object
pose2 Pose of the reference object
npoints1 Number of points visible for object 1
npoints2 Number of points visible for object 2t
status Status flag
data Additional data from the device
time_avg Take the measurement for a period of time and average the result.
tip_xyz Offet the measurement to the tip.
Returns
Status flags.

Valid()

virtual bool Valid ( constItem item_check )
纯虚拟

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

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

ViewPose()

virtualMatViewPose ( )
纯虚拟

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: