RoboDK Plug-In Interface
IItem Class Referenceabstract

The Item class represents an item in RoboDK station. An item can be a robot, a frame, a tool, an object, a target, ... any item visible in the station tree. An item can also be seen as a node where other items can be attached to (child items). Every item has one parent item/node and can have one or more child items/nodes. More...

#include <iitem.h>

Public Types

enum  {
  ITEM_TYPE_ANY = -1 , ITEM_TYPE_STATION = 1 , ITEM_TYPE_ROBOT = 2 , ITEM_TYPE_FRAME = 3 ,
  ITEM_TYPE_TOOL = 4 , ITEM_TYPE_OBJECT = 5 , ITEM_TYPE_TARGET = 6 , ITEM_TYPE_PROGRAM = 8 ,
  ITEM_TYPE_INSTRUCTION = 9 , ITEM_TYPE_PROGRAM_PYTHON = 10 , ITEM_TYPE_MACHINING = 11 , ITEM_TYPE_BALLBARVALIDATION = 12 ,
  ITEM_TYPE_CALIBPROJECT = 13 , ITEM_TYPE_VALID_ISO9283 = 14 , ITEM_TYPE_FOLDER =17 , ITEM_TYPE_ROBOT_ARM =18 ,
  ITEM_TYPE_CAMERA =19 , ITEM_TYPE_GENERIC =20 , ITEM_TYPE_ROBOT_AXES =21
}
 Tree item types. More...
 

Public Member Functions

virtual int Type ()=0
 Item type (object, robot, tool, reference, robot machining project, ...)
 
virtual bool Save (const QString &filename)=0
 Save a station, a robot, a tool or an object to a file More...
 
virtual void Delete ()=0
 Deletes an item and its childs from the station.
 
virtual void setParent (Item parent)=0
 Attaches the item to a new parent while maintaining the relative position with its parent. The absolute position is changed. More...
 
virtual void setParentStatic (Item parent)=0
 Attaches the item to another parent while maintaining the current absolute position in the station. The relationship between this item and its parent is changed to maintain the abosolute position. More...
 
virtual Item Parent ()=0
 Return the parent item of this item More...
 
virtual QList< ItemChilds ()=0
 Returns a list of the item childs that are attached to the provided item. Exceptionally, if Childs is called on a program it will return the list of subprograms called by this program. More...
 
virtual bool Visible ()=0
 Returns 1 if the item is visible, otherwise, returns 0 More...
 
virtual void setVisible (bool visible, int visible_frame=-1)=0
 Sets the item visiblity status More...
 
virtual QString Name ()=0
 Returns the name of an item. The name of the item is always displayed in the RoboDK station tree More...
 
virtual void setName (const QString &name)=0
 Set the name of a RoboDK item. 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 global setting or provoke specific events. More...
 
virtual bool setPose (const Mat pose)=0
 Sets the local position (pose) of an object, target or reference frame. For example, the position of an object/frame/target with respect to its parent. If a robot is provided, it will set the pose of the end efector. More...
 
virtual Mat Pose ()=0
 Returns the local position (pose) of an object, target or reference frame. For example, the position of an object/frame/target with respect to its parent. If a robot is provided, it will get the pose of the end efector More...
 
virtual void setGeometryPose (Mat pose, bool apply_transf=false)=0
 Sets the position (pose) the object geometry with respect to its own reference frame. This procedure works for tools and objects. More...
 
virtual Mat GeometryPose ()=0
 Returns the position (pose) the object geometry with respect to its own reference frame. This procedure works for tools and objects. More...
 
virtual Mat PoseTool ()=0
 Returns the tool pose of an item. If a robot is provided it will get the tool pose of the active tool held by the robot. More...
 
virtual Mat PoseFrame ()=0
 Returns the reference frame pose of an item. If a robot is provided it will get the tool pose of the active reference frame used by the robot. More...
 
virtual void setPoseFrame (const Mat frame_pose)=0
 Sets the reference frame of a robot(user frame). The frame can be either an item or a pose. If "frame" is an item, it links the robot to the frame item. If frame is a pose, it updates the linked pose of the robot frame (with respect to the robot reference frame). More...
 
virtual void setPoseFrame (const Item frame_item)=0
 Sets the tool of a robot or a tool object (Tool Center Point, or TCP). The tool pose can be either an item or a 4x4 Matrix. If the item is a tool, it links the robot to the tool item.If tool is a pose, it updates the current robot TCP. More...
 
virtual void setPoseTool (const Mat tool_pose)=0
 Sets the tool of a robot or a tool object (Tool Center Point, or TCP). The tool pose can be either an item or a 4x4 Matrix. If the item is a tool, it links the robot to the tool item.If tool is a pose, it updates the current robot TCP. More...
 
virtual void setPoseTool (const Item tool_item)=0
 Sets the tool of a robot or a tool object (Tool Center Point, or TCP). The tool pose can be either an item or a 4x4 Matrix. If the item is a tool, it links the robot to the tool item.If tool is a pose, it updates the current robot TCP. More...
 
virtual void setPoseAbs (const Mat pose)=0
 Sets the global position (pose) of an item. For example, the position of an object/frame/target with respect to the station origin. More...
 
virtual Mat PoseAbs ()=0
 Returns the global position (pose) of an item. For example, the position of an object/frame/target with respect to the station origin. More...
 
virtual void setColor (const tColor &clr)=0
 Set the color of an object, tool or robot. A color must in the format COLOR=[R, G, B,(A = 1)] where all values range from 0 to 1. Optionally set the RBG to -1 to modify the Alpha channel (transparency) More...
 
virtual void Scale (double scale)=0
 Apply a scale to an object to make it bigger or smaller. The scale can be uniform (if scale is a float value) or per axis (if scale is a vector).
 
virtual void Scale (double scale_xyz[3])=0
 Apply a per-axis scale to an object to make it bigger or smaller. The scale can be uniform (if scale is a float value) or per axis (if scale is a vector). More...
 
virtual void setAsCartesianTarget ()=0
 Sets a target as a cartesian target. A cartesian target moves to cartesian coordinates.
 
virtual void setAsJointTarget ()=0
 Sets a target as a joint target. A joint target moves to a joints position without regarding the cartesian coordinates.
 
virtual bool isJointTarget ()=0
 Returns True if a target is a joint target (green icon). Otherwise, the target is a Cartesian target (red icon).
 
virtual tJoints Joints ()=0
 Returns the current joints of a robot or the joints of a target. If the item is a cartesian target, it returns the preferred joints (configuration) to go to that cartesian position. More...
 
virtual tJoints JointsHome ()=0
 Returns the home joints of a robot. These joints can be manually set in the robot "Parameters" menu, then select "Set home position" More...
 
virtual void setJointsHome (const tJoints &jnts)=0
 Set robot joints for the home position
 
virtual Item ObjectLink (int link_id=0)=0
 Returns an item pointer to the geometry of a robot link. This is useful to show/hide certain robot links or alter their geometry. More...
 
virtual Item getLink (int type_linked=ITEM_TYPE_ROBOT)=0
 Returns an item linked to a robot, object, tool, program or robot machining project. This is useful to retrieve the relationship between programs, robots, tools and other specific projects. More...
 
virtual void setJoints (const tJoints &jnts)=0
 Set robot joints or the joints of a target
 
virtual int JointLimits (tJoints *lower_limits, tJoints *upper_limits)=0
 Retrieve the joint limits of a robot
 
virtual int setJointLimits (const tJoints &lower_limits, const tJoints &upper_limits)=0
 Set the joint limits of a robot
 
virtual void setRobot (const Item &robot)=0
 Sets the robot of a program or a target. You must set the robot linked to a program or a target every time you copy paste these objects. If the robot is not provided, the first available robot will be chosen automatically. More...
 
virtual Item AddTool (const Mat &tool_pose, const QString &tool_name="New TCP")=0
 Adds an empty tool to the robot provided the tool pose (4x4 Matrix) and the tool name. More...
 
virtual Mat SolveFK (const tJoints &joints, const Mat *tool_pose=nullptr, const Mat *reference_pose=nullptr)=0
 Computes the forward kinematics of the robot for the provided joints. The tool and the reference frame are not taken into account. More...
 
virtual void JointsConfig (const tJoints &joints, tConfig config)=0
 Returns the robot configuration state for a set of robot joints. More...
 
virtual tJoints SolveIK (const Mat &pose, const tJoints *joints_close=nullptr, const Mat *tool_pose=nullptr, const Mat *reference_pose=nullptr)=0
 Computes the inverse kinematics for the specified robot and pose. The joints returned are the closest to the current robot configuration (see SolveIK_All()) More...
 
virtual QList< tJointsSolveIK_All (const Mat &pose, const Mat *tool_pose=nullptr, const Mat *reference_pose=nullptr)=0
 Computes the inverse kinematics for the specified robot and pose. The function returns all available joint solutions as a 2D matrix. More...
 
virtual bool Connect (const QString &robot_ip="")=0
 Connect to a real robot using the corresponding robot driver. More...
 
virtual bool Disconnect ()=0
 Disconnect from a real robot (when the robot driver is used) More...
 
virtual bool MoveJ (const Item &itemtarget)=0
 Add a joint move to a program or move a robot to a target item ("Move Joint" mode). This function does not block. More...
 
virtual bool MoveJ (const tJoints &joints)=0
 Add a joint move to a program or move a robot to a joint target ("Move Joint" mode). This function does not block. More...
 
virtual bool MoveJ (const Mat &target)=0
 Add a joint move to a program or move a robot to a pose target ("Move Joint" mode). This function does not block. More...
 
virtual bool MoveL (const Item &itemtarget)=0
 Add a linear move to a program or move a robot to a target item ("Move Linear" mode). This function does not block. More...
 
virtual bool MoveL (const tJoints &joints)=0
 Add a linear move to a program or move a robot to a joint target ("Move Linear" mode). This function does not block. More...
 
virtual bool MoveL (const Mat &target)=0
 Add a linear move to a program or move a robot to a pose target ("Move Linear" mode). This function does not block. More...
 
virtual bool MoveC (const Item &itemtarget1, const Item &itemtarget2)=0
 Add a circular move to a program or move a robot through an arc given two target items ("Move Circular" mode). This function does not block. More...
 
virtual bool MoveC (const tJoints &joints1, const tJoints &joints2)=0
 Add a circular move to a program or move a robot through an arc given two joint targets ("Move Circular" mode). This function does not block. More...
 
virtual bool MoveC (const Mat &target1, const Mat &target2)=0
 Add a circular move to a program or move a robot through an arc given two pose targets ("Move Circular" mode). This function does not block. More...
 
virtual int MoveJ_Test (const tJoints &j1, const tJoints &j2, double minstep_deg=-1)=0
 Checks if a joint movement is possible and, optionally, free of collisions. More...
 
virtual int MoveL_Test (const tJoints &joints1, const Mat &pose2, double minstep_mm=-1)=0
 Checks if a linear movement is free of issues and, optionally, collisions. More...
 
virtual void setSpeed (double speed_linear, double accel_linear=-1, double speed_joints=-1, double accel_joints=-1)=0
 Sets the speed and/or the acceleration of a robot. More...
 
virtual void setRounding (double zonedata)=0
 Sets the robot movement smoothing accuracy (also known as zone data value). More...
 
virtual void ShowSequence (tMatrix2D *sequence)=0
 Displays a sequence of joints More...
 
virtual bool Busy ()=0
 Checks if a robot or program is currently running (busy or moving) More...
 
virtual void Stop ()=0
 Stops a program or a robot
 
virtual bool MakeProgram (const QString &filename)=0
 Saves a program to a file. More...
 
virtual void setRunType (int program_run_type)=0
 Sets if the program will be run in simulation mode or on the real robot (same flag obtained when right clicking a program and checking/unchecking the "Run on robot" option). Use: "PROGRAM_RUN_ON_SIMULATOR" to set the program to run on the simulator only or "PROGRAM_RUN_ON_ROBOT" to force the program to run on the robot. More...
 
virtual bool RunProgram (const QString &params="")=0
 Runs a program. It returns the number of instructions that can be executed successfully (a quick program check is performed before the program starts) This is a non-blocking call. Use IsBusy() to check if the program execution finished. Notes: if setRunMode(RUNMODE_SIMULATE) is used -> the program will be simulated (default run mode) if setRunMode(RUNMODE_RUN_ROBOT) is used -> the program will run on the robot (default when RUNMODE_RUN_ROBOT is used) if setRunMode(RUNMODE_RUN_ROBOT) is used together with program.setRunType(PROGRAM_RUN_ON_ROBOT) -> the program will run sequentially on the robot the same way as if we right clicked the program and selected "Run on robot" in the RoboDK GUI More...
 
virtual int RunInstruction (const QString &code, int run_type=RoboDK::INSTRUCTION_CALL_PROGRAM)=0
 Adds a program call, code, message or comment inside a program. More...
 
virtual void Pause (double time_ms=-1)=0
 Generates a pause instruction for a robot or a program when generating code. Set it to -1 (default) if you want the robot to stop and let the user resume the program anytime. More...
 
virtual void setDO (const QString &io_var, const QString &io_value)=0
 Sets a variable (output) to a given value. This can also be used to set any variables to a desired value. More...
 
virtual void waitDI (const QString &io_var, const QString &io_value, double timeout_ms=-1)=0
 Waits for an input io_id to attain a given value io_value. Optionally, a timeout can be provided. More...
 
virtual void customInstruction (const QString &name, const QString &path_run, const QString &path_icon="", bool blocking=true, const QString &cmd_run_on_robot="")=0
 Add a custom instruction. This instruction will execute a Python file or an executable file. More...
 
virtual void ShowInstructions (bool visible=true)=0
 Show or hide instruction items of a program in the RoboDK tree More...
 
virtual void ShowTargets (bool visible=true)=0
 Show or hide targets of a program in the RoboDK tree More...
 
virtual int InstructionCount ()=0
 Returns the number of instructions of a program. More...
 
virtual void InstructionAt (int ins_id, QString &name, int &instype, int &movetype, bool &isjointtarget, Mat &target, tJoints &joints)=0
 Returns the program instruction at position id More...
 
virtual void setInstruction (int ins_id, const QString &name, int instype, int movetype, bool isjointtarget, const Mat &target, const tJoints &joints)=0
 Sets the program instruction at position id More...
 
virtual int InstructionList (tMatrix2D *instructions)=0
 Returns the list of program instructions as an MxN matrix, where N is the number of instructions and M equals to 1 plus the number of robot axes. More...
 
virtual double Update (double out_nins_time_dist[4], int collision_check=RoboDK::COLLISION_OFF, double mm_step=-1, double deg_step=-1)=0
 Updates a program and returns the estimated time and the number of valid instructions. An update can also be applied to a robot machining project. The update is performed on the generated program. More...
 
virtual Item setMachiningParameters (const QString &ncfile="", Item part_obj=nullptr, const QString &options="")=0
 Update the robot milling path input and parameters. Parameter input can be an NC file (G-code or APT file) or an object item in RoboDK. A curve or a point follow project will be automatically set up for a robot manufacturing project.
Tip: Use getLink() and setLink() to get/set the robot tool, reference frame, robot and program linked to the project.
Tip: Use setPose() and setJoints() to update the path to tool orientation or the preferred start joints.
Tip: Use setPoseTool() and setPoseFrame() to link to the corresponding tool and reference frames. More...
 
virtual int ConnectedState (QString *msg=nullptr)=0
 Retrieve the robot connection status. More...
 
virtual bool Selected ()=0
 Returns true if the item is selected by the user (in the tree or the screen) More...
 
virtual bool Collided (int *id=nullptr)=0
 Returns true if the object is in a collision state (collision checking must be activated manually or using setCollisionActive. Alternatively, use RDK->Collisions() to update collision flags) More...
 
virtual bool JointsValid (const tJoints &jnts)=0
 Check if a set of joints are valid
 
virtual int RunType ()=0
 Get if the program will be run in simulation mode or on the real robot (same flag obtained when right clicking a program and checking/unchecking the "Run on robot" option). Use: "PROGRAM_RUN_ON_SIMULATOR" to set the program to run on the simulator only or "PROGRAM_RUN_ON_ROBOT" to force the program to run on the robot. More...
 
virtual bool Scale (const double scalexyz[3], const Mat *tr_pre_scale, const Mat *tr_post_scale=nullptr)=0
 Scale an object given a per-axis scale. Optionally provide a transformation matrix before and after the scale takes place. If the transformation after scaling is not provided it will use the inverse transformation of the pre-scaled pose automatically. More...
 
virtual Item InstructionTargetAt (int ins_id)=0
 Returns the target item at the specified program instruction. It returns a null pointer if the instruction does not have a target or is not a movement instruction. More...
 
virtual Item AttachClosest ()=0
 Attach the closest object to the tool. Returns the item that was attached. More...
 
virtual Item DetachClosest (Item parent=nullptr)=0
 Detach the closest object attached to the tool (see also setParentStatic). More...
 
virtual void DetachAll (Item parent=nullptr)=0
 Detach any object attached to a tool.
 
virtual int InstructionListJoints (QString &error_msg, tMatrix2D *matrix, double step_mm=1, double step_deg=1, int check_collisions=IRoboDK::COLLISION_OFF, int flags=0, double time_step=0.1)=0
 Returns a list of joints an MxN matrix, where M is the number of robot axes plus 4 columns. Linear moves are rounded according to the smoothing parameter set inside the program. More...
 
virtual void Copy ()=0
 Copy this item (similar to Ctrl+C). The user clipboard is not altered.
 
virtual Item Paste ()=0
 Paste the copied item to this item (similar to Ctrl+V). For example, you can paste to a station, or coordinate system. Paste should be used after Copy(). It returns the newly created item.
 
virtual QString setParam (const QString &param, const QString &value="", QList< Item > *itemlist=nullptr, double *values=nullptr, tMatrix2D *matrix=nullptr)=0
 Set a specific parameter associated with an item (used for specific parameters, commands and internal use).
 
virtual bool setParam (const QString &name, const QByteArray &value)=0
 Set a custom parameter to store data with an item. If the parameter name does not exist it will create a new parameter. This function always returns true.
 
virtual bool getParam (const QString &name, QByteArray &value)=0
 Get a custom parameter associated with an item. Returns False if the parameter name does not exist.
 
virtual void setAccuracyActive (bool accurate=true)=0
 Sets the accuracy of the robot active or inactive. A robot must have been calibrated to properly use this option.
 
virtual tJoints SimulatorJoints ()=0
 Return the current joint position of a robot (only from the simulator, never from the real robot). More...
 
virtual int InstructionSelect (int ins_id=-1)=0
 Select an instruction in the program as a reference to add new instructions. New instructions will be added after the selected instruction. If no instruction ID is specified, the active instruction will be selected and returned.
 
virtual int InstructionDelete (int ins_id=0)=0
 Delete an instruction of a program
 
virtual void setAO (const QString &io_var, const QString &io_value)=0
 Set an Analog Output (AO). More...
 
virtual QString getDI (const QString &io_var)=0
 Get a Digital Input (DI). This function is only useful when connected to a real robot using the robot driver. It returns a string related to the state of the Digital Input (1=True, 0=False). This function returns an empty string if the script is not executed on the robot. More...
 
virtual void ConnectionParams (QString &robotIP, int &port, QString &remote_path, QString &FTP_user, QString &FTP_pass)=0
 Returns the robot connection parameters More...
 
virtual void setConnectionParams (const QString &robotIP, const int &port=2000, const QString &remote_path="/", const QString &FTP_user="", const QString &FTP_pass="")=0
 Set the robot connection parameters More...
 
virtual void Color (tColor &clr_out)=0
 Return the color of an :class:.Item (object, tool or robot). If the item has multiple colors it returns the first color available).
 
virtual void SelectedFeature (bool &is_selected, int feature_type, int &feature_id)=0
 Retrieve the currently selected feature for this object.
 
virtual QList< MatJointPoses (const tJoints &jnts)=0
 Returns the positions of the joint links for a provided robot configuration (joints). If no joints are provided it will return the poses for the current robot position. Out 1 : 4x4 x n -> array of 4x4 homogeneous matrices. Index 0 is the base frame reference (it never moves when the joints move). More...
 

Detailed Description

The Item class represents an item in RoboDK station. An item can be a robot, a frame, a tool, an object, a target, ... any item visible in the station tree. An item can also be seen as a node where other items can be attached to (child items). Every item has one parent item/node and can have one or more child items/nodes.

Definition at line 14 of file iitem.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Tree item types.

Enumerator
ITEM_TYPE_ANY 

Any item type.

ITEM_TYPE_STATION 

Item of type station (RDK file)

ITEM_TYPE_ROBOT 

Item of type robot (.robot file)

ITEM_TYPE_FRAME 

Item of type reference frame.

ITEM_TYPE_TOOL 

Item of type tool (.tool)

ITEM_TYPE_OBJECT 

Item of type object (.stl, .step or .iges for example)

ITEM_TYPE_TARGET 

Target item.

ITEM_TYPE_PROGRAM 

Program item.

ITEM_TYPE_INSTRUCTION 

Instruction.

ITEM_TYPE_PROGRAM_PYTHON 

Python script.

ITEM_TYPE_MACHINING 

Robot machining project, curve follow, point follow or 3D printing project.

ITEM_TYPE_BALLBARVALIDATION 

Ballbar validation project.

ITEM_TYPE_CALIBPROJECT 

Robot calibration project.

ITEM_TYPE_VALID_ISO9283 

Robot path accuracy validation project.

ITEM_TYPE_FOLDER 

Folders.

ITEM_TYPE_ROBOT_ARM 

Robot arms only.

ITEM_TYPE_CAMERA 

Camera.

ITEM_TYPE_GENERIC 

Generic custom items (customizable)

ITEM_TYPE_ROBOT_AXES 

Mechanisms and axes of up to 3 degrees of freedom.

Definition at line 18 of file iitem.h.

Constructor & Destructor Documentation

◆ ~IItem()

virtual ~IItem ( )
inlinevirtual

Definition at line 79 of file iitem.h.

Member Function Documentation

◆ AddTool()

virtual Item AddTool ( const Mat tool_pose,
const QString &  tool_name = "New TCP" 
)
pure virtual

Adds an empty tool to the robot provided the tool pose (4x4 Matrix) and the tool name.

Parameters
tool_poseTCP as a 4x4 Matrix (pose of the tool frame)
tool_nameNew tool name
Returns
new item created

◆ AttachClosest()

virtual Item AttachClosest ( )
pure virtual

Attach the closest object to the tool. Returns the item that was attached.

Returns
Attached item

◆ Busy()

virtual bool Busy ( )
pure virtual

Checks if a robot or program is currently running (busy or moving)

Returns
busy status (true=moving, false=stopped)

◆ Childs()

virtual QList< Item > Childs ( )
pure virtual

Returns a list of the item childs that are attached to the provided item. Exceptionally, if Childs is called on a program it will return the list of subprograms called by this program.

Returns
item x n: list of child items

◆ Collided()

virtual bool Collided ( int *  id = nullptr)
pure virtual

Returns true if the object is in a collision state (collision checking must be activated manually or using setCollisionActive. Alternatively, use RDK->Collisions() to update collision flags)

Parameters
idOptionally retrieve the index of the object (used for robot joints)
Returns

◆ 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 global setting or provoke specific events.

Parameters
cmdCommand Name, such as Trace, Threads or Window.
valueComand value (optional, not all commands require a value)
Returns
Response ("OK" if success)

◆ Connect()

virtual bool Connect ( const QString &  robot_ip = "")
pure virtual

Connect to a real robot using the corresponding robot driver.

Parameters
robot_ipIP of the robot to connect. Leave empty to use the one defined in RoboDK
Returns
true if connected successfully, false if connection failed

◆ ConnectedState()

virtual int ConnectedState ( QString *  msg = nullptr)
pure virtual

Retrieve the robot connection status.

Parameters
msgpass a non null pointer to retrieve a readable message (same message seen in the roboto connection status bar)
Returns
Robot connection status: 0 = ready ; > 0 = busy/working ; -1 = connection problems

◆ ConnectionParams()

virtual void ConnectionParams ( QString &  robotIP,
int &  port,
QString &  remote_path,
QString &  FTP_user,
QString &  FTP_pass 
)
pure virtual

Returns the robot connection parameters

Parameters
robotIPRobot IP
portCommunication port
remote_pathRemote path to place sent programs
FTP_userFTP User
FTP_passFTP Password

◆ customInstruction()

virtual void customInstruction ( const QString &  name,
const QString &  path_run,
const QString &  path_icon = "",
bool  blocking = true,
const QString &  cmd_run_on_robot = "" 
)
pure virtual

Add a custom instruction. This instruction will execute a Python file or an executable file.

Parameters
name
path_runpath to run(relative to RoboDK/bin folder or absolute path)
path_iconicon path(relative to RoboDK/bin folder or absolute path)
blockingTrue if blocking, 0 if it is a non blocking executable trigger
cmd_run_on_robotCommand to run through the driver when connected to the robot

:param name: digital input (string or number)

◆ DetachClosest()

virtual Item DetachClosest ( Item  parent = nullptr)
pure virtual

Detach the closest object attached to the tool (see also setParentStatic).

Returns
Detached item

◆ Disconnect()

virtual bool Disconnect ( )
pure virtual

Disconnect from a real robot (when the robot driver is used)

Returns
true if disconnected successfully, false if it failed. It can fail if it was previously disconnected manually for example.

◆ GeometryPose()

virtual Mat GeometryPose ( )
pure virtual

Returns the position (pose) the object geometry with respect to its own reference frame. This procedure works for tools and objects.

Returns
4x4 homogeneous matrix (pose)

◆ getDI()

virtual QString getDI ( const QString &  io_var)
pure virtual

Get a Digital Input (DI). This function is only useful when connected to a real robot using the robot driver. It returns a string related to the state of the Digital Input (1=True, 0=False). This function returns an empty string if the script is not executed on the robot.

Parameters
io_varDigital Input (string or number)

◆ getLink()

virtual Item getLink ( int  type_linked = ITEM_TYPE_ROBOT)
pure virtual

Returns an item linked to a robot, object, tool, program or robot machining project. This is useful to retrieve the relationship between programs, robots, tools and other specific projects.

Parameters
type_linkedtype of linked object to retrieve
Returns
Linked object

◆ InstructionAt()

virtual void InstructionAt ( int  ins_id,
QString &  name,
int &  instype,
int &  movetype,
bool &  isjointtarget,
Mat target,
tJoints joints 
)
pure virtual

Returns the program instruction at position id

Parameters
ins_id
name
instype
movetype
isjointtarget
target
joints

◆ InstructionCount()

virtual int InstructionCount ( )
pure virtual

Returns the number of instructions of a program.

Returns

◆ InstructionList()

virtual int InstructionList ( tMatrix2D instructions)
pure virtual

Returns the list of program instructions as an MxN matrix, where N is the number of instructions and M equals to 1 plus the number of robot axes.

Parameters
instructionsthe matrix of instructions
Returns
Returns 0 if success

◆ InstructionListJoints()

virtual int InstructionListJoints ( QString &  error_msg,
tMatrix2D matrix,
double  step_mm = 1,
double  step_deg = 1,
int  check_collisions = IRoboDK::COLLISION_OFF,
int  flags = 0,
double  time_step = 0.1 
)
pure virtual

Returns a list of joints an MxN matrix, where M is the number of robot axes plus 4 columns. Linear moves are rounded according to the smoothing parameter set inside the program.

Parameters
error_msgReturns a human readable error message (if any)
joint_listReturns the list of joints as [J1, J2, ..., Jn, ERROR, MM_STEP, DEG_STEP, MOVE_ID] if a file name is not specified

If flags == LISTJOINTS_SPEED: [J1, J2, ..., Jn, ERROR, MM_STEP, DEG_STEP, MOVE_ID, TIME, X_TCP, Y_TCP, Z_TCP, Speed_J1, Speed_J2, ..., Speed_Jn] If flags == LISTJOINTS_ACCEL: [J1, J2, ..., Jn, ERROR, MM_STEP, DEG_STEP, MOVE_ID, TIME, X_TCP, Y_TCP, Z_TCP, Speed_J1, Speed_J2, ..., Speed_Jn, Accel_J1, Accel_J2, ..., Accel_Jn]

Parameters
mm_stepMaximum step in millimeters for linear movements (millimeters)
deg_stepMaximum step for joint movements (degrees)
collision_checkCheck for collisions
result_flagset to 1 to include the timings between movements, set to 2 to also include the joint speeds (deg/s), set to 3 to also include the accelerations, set to 4 to include all previous information and make the splitting time-based.
time_step_s(optional) set the time step in seconds for time based calculation. This value is only used when the result flag is set to 4 (time based).
Returns
Returns 0 if success, otherwise, it will return negative values

◆ InstructionTargetAt()

virtual Item InstructionTargetAt ( int  ins_id)
pure virtual

Returns the target item at the specified program instruction. It returns a null pointer if the instruction does not have a target or is not a movement instruction.

Parameters
ins_id

◆ JointPoses()

virtual QList< Mat > JointPoses ( const tJoints jnts)
pure virtual

Returns the positions of the joint links for a provided robot configuration (joints). If no joints are provided it will return the poses for the current robot position. Out 1 : 4x4 x n -> array of 4x4 homogeneous matrices. Index 0 is the base frame reference (it never moves when the joints move).

Returns
List of poses

◆ Joints()

virtual tJoints Joints ( )
pure virtual

Returns the current joints of a robot or the joints of a target. If the item is a cartesian target, it returns the preferred joints (configuration) to go to that cartesian position.

Returns
double x n: joints matrix

◆ JointsConfig()

virtual void JointsConfig ( const tJoints joints,
tConfig  config 
)
pure virtual

Returns the robot configuration state for a set of robot joints.

Parameters
jointsarray of joints
configconfiguration status as [REAR, LOWERARM, FLIP]

◆ JointsHome()

virtual tJoints JointsHome ( )
pure virtual

Returns the home joints of a robot. These joints can be manually set in the robot "Parameters" menu, then select "Set home position"

Returns
joint values for the home position

◆ MakeProgram()

virtual bool MakeProgram ( const QString &  filename)
pure virtual

Saves a program to a file.

Parameters
filenameFile path of the program
run_modeRUNMODE_MAKE_ROBOTPROG to generate the program file.Alternatively, Use RUNMODE_MAKE_ROBOTPROG_AND_UPLOAD or RUNMODE_MAKE_ROBOTPROG_AND_START to transfer the program through FTP and execute the program.
Returns
Transfer succeeded is True if there was a successful program transfer (if RUNMODE_MAKE_ROBOTPROG_AND_UPLOAD or RUNMODE_MAKE_ROBOTPROG_AND_START are used)

◆ MoveC() [1/3]

virtual bool MoveC ( const Item itemtarget1,
const Item itemtarget2 
)
pure virtual

Add a circular move to a program or move a robot through an arc given two target items ("Move Circular" mode). This function does not block.

Parameters
itemtarget1Intermediate target to move to as a target item (target item)
itemtarget2Final target to move to as a target item (target item)

◆ MoveC() [2/3]

virtual bool MoveC ( const Mat target1,
const Mat target2 
)
pure virtual

Add a circular move to a program or move a robot through an arc given two pose targets ("Move Circular" mode). This function does not block.

Parameters
target1Intermediate pose target to move to. It must be a 4x4 Homogeneous matrix
target2Final pose target to move to. It must be a 4x4 Homogeneous matrix

◆ MoveC() [3/3]

virtual bool MoveC ( const tJoints joints1,
const tJoints joints2 
)
pure virtual

Add a circular move to a program or move a robot through an arc given two joint targets ("Move Circular" mode). This function does not block.

Parameters
joints1Intermediate joint target to move to.
joints2Final joint target to move to.

◆ MoveJ() [1/3]

virtual bool MoveJ ( const Item itemtarget)
pure virtual

Add a joint move to a program or move a robot to a target item ("Move Joint" mode). This function does not block.

Parameters
targetTarget to move to as a target item (RoboDK target item)

◆ MoveJ() [2/3]

virtual bool MoveJ ( const Mat target)
pure virtual

Add a joint move to a program or move a robot to a pose target ("Move Joint" mode). This function does not block.

Parameters
targetPose target to move to. It must be a 4x4 Homogeneous matrix

◆ MoveJ() [3/3]

virtual bool MoveJ ( const tJoints joints)
pure virtual

Add a joint move to a program or move a robot to a joint target ("Move Joint" mode). This function does not block.

Parameters
targetRobot joints to move to

◆ MoveJ_Test()

virtual int MoveJ_Test ( const tJoints j1,
const tJoints j2,
double  minstep_deg = -1 
)
pure virtual

Checks if a joint movement is possible and, optionally, free of collisions.

Parameters
j1Start joints
j2Destination joints
minstep_degMaximum joint step in degrees. If this value is not provided it will use the path step defined in Tools-Options-Motion (degrees).
Returns
collision : returns 0 if the movement is free of collision. Otherwise it returns the number of pairs of objects that collided if there was a collision.

◆ MoveL() [1/3]

virtual bool MoveL ( const Item itemtarget)
pure virtual

Add a linear move to a program or move a robot to a target item ("Move Linear" mode). This function does not block.

Parameters
itemtargetTarget to move to as a target item (RoboDK target item)

◆ MoveL() [2/3]

virtual bool MoveL ( const Mat target)
pure virtual

Add a linear move to a program or move a robot to a pose target ("Move Linear" mode). This function does not block.

Parameters
targetPose target to move to. It must be a 4x4 Homogeneous matrix

◆ MoveL() [3/3]

virtual bool MoveL ( const tJoints joints)
pure virtual

Add a linear move to a program or move a robot to a joint target ("Move Linear" mode). This function does not block.

Parameters
jointsRobot joints to move to

◆ MoveL_Test()

virtual int MoveL_Test ( const tJoints joints1,
const Mat pose2,
double  minstep_mm = -1 
)
pure virtual

Checks if a linear movement is free of issues and, optionally, collisions.

Parameters
joints1Start joints
pose2Destination pose (active tool with respect to the active reference frame)
minstep_mmMaximum joint step in mm. If this value is not provided it will use the path step defined in Tools-Options-Motion (mm).
Returns
collision : returns 0 if the movement is free of collision. Otherwise it returns the number of pairs of objects that collided if there was a collision.

◆ Name()

virtual QString Name ( )
pure virtual

Returns the name of an item. The name of the item is always displayed in the RoboDK station tree

Returns
name of the item

◆ ObjectLink()

virtual Item ObjectLink ( int  link_id = 0)
pure virtual

Returns an item pointer to the geometry of a robot link. This is useful to show/hide certain robot links or alter their geometry.

Parameters
link_idlink index(0 for the robot base, 1 for the first link, ...)
Returns
Internal geometry item

◆ Parent()

virtual Item Parent ( )
pure virtual

Return the parent item of this item

Returns
Parent item

◆ Pause()

virtual void Pause ( double  time_ms = -1)
pure virtual

Generates a pause instruction for a robot or a program when generating code. Set it to -1 (default) if you want the robot to stop and let the user resume the program anytime.

Parameters
time_msTime in milliseconds

◆ Pose()

virtual Mat Pose ( )
pure virtual

Returns the local position (pose) of an object, target or reference frame. For example, the position of an object/frame/target with respect to its parent. If a robot is provided, it will get the pose of the end efector

Returns
4x4 homogeneous matrix (pose)

◆ PoseAbs()

virtual Mat PoseAbs ( )
pure virtual

Returns the global position (pose) of an item. For example, the position of an object/frame/target with respect to the station origin.

Returns
4x4 homogeneous matrix (pose)

◆ PoseFrame()

virtual Mat PoseFrame ( )
pure virtual

Returns the reference frame pose of an item. If a robot is provided it will get the tool pose of the active reference frame used by the robot.

Returns
4x4 homogeneous matrix (pose)

◆ PoseTool()

virtual Mat PoseTool ( )
pure virtual

Returns the tool pose of an item. If a robot is provided it will get the tool pose of the active tool held by the robot.

Returns
4x4 homogeneous matrix (pose)

◆ RunInstruction()

virtual int RunInstruction ( const QString &  code,
int  run_type = RoboDK::INSTRUCTION_CALL_PROGRAM 
)
pure virtual

Adds a program call, code, message or comment inside a program.

Parameters
code<string of the code or program to run/param>
Parameters
run_typeINSTRUCTION_* variable to specify if the code is a progra

◆ RunProgram()

virtual bool RunProgram ( const QString &  params = "")
pure virtual

Runs a program. It returns the number of instructions that can be executed successfully (a quick program check is performed before the program starts) This is a non-blocking call. Use IsBusy() to check if the program execution finished. Notes: if setRunMode(RUNMODE_SIMULATE) is used -> the program will be simulated (default run mode) if setRunMode(RUNMODE_RUN_ROBOT) is used -> the program will run on the robot (default when RUNMODE_RUN_ROBOT is used) if setRunMode(RUNMODE_RUN_ROBOT) is used together with program.setRunType(PROGRAM_RUN_ON_ROBOT) -> the program will run sequentially on the robot the same way as if we right clicked the program and selected "Run on robot" in the RoboDK GUI

Returns
True if successful

◆ RunType()

virtual int RunType ( )
pure virtual

Get if the program will be run in simulation mode or on the real robot (same flag obtained when right clicking a program and checking/unchecking the "Run on robot" option). Use: "PROGRAM_RUN_ON_SIMULATOR" to set the program to run on the simulator only or "PROGRAM_RUN_ON_ROBOT" to force the program to run on the robot.

Returns
number of instructions that can be executed

◆ Save()

virtual bool Save ( const QString &  filename)
pure virtual

Save a station, a robot, a tool or an object to a file

Parameters
filenamepath and file name

◆ Scale() [1/2]

virtual bool Scale ( const double  scalexyz[3],
const Mat tr_pre_scale,
const Mat tr_post_scale = nullptr 
)
pure virtual

Scale an object given a per-axis scale. Optionally provide a transformation matrix before and after the scale takes place. If the transformation after scaling is not provided it will use the inverse transformation of the pre-scaled pose automatically.

Parameters
ins_id

◆ Scale() [2/2]

virtual void Scale ( double  scale_xyz[3])
pure virtual

Apply a per-axis scale to an object to make it bigger or smaller. The scale can be uniform (if scale is a float value) or per axis (if scale is a vector).

Parameters
scalescale to apply as [scale_x, scale_y, scale_z]

◆ Selected()

virtual bool Selected ( )
pure virtual

Returns true if the item is selected by the user (in the tree or the screen)

Returns

◆ setAO()

virtual void setAO ( const QString &  io_var,
const QString &  io_value 
)
pure virtual

Set an Analog Output (AO).

Parameters
io_varanalog output (string or number)
io_valuevalue (string or number)

◆ setColor()

virtual void setColor ( const tColor clr)
pure virtual

Set the color of an object, tool or robot. A color must in the format COLOR=[R, G, B,(A = 1)] where all values range from 0 to 1. Optionally set the RBG to -1 to modify the Alpha channel (transparency)

Parameters
clrcolor to set

◆ setConnectionParams()

virtual void setConnectionParams ( const QString &  robotIP,
const int &  port = 2000,
const QString &  remote_path = "/",
const QString &  FTP_user = "",
const QString &  FTP_pass = "" 
)
pure virtual

Set the robot connection parameters

Parameters
robotIPRobot IP
portCommunication port
remote_pathRemote path to place sent programs
FTP_userFTP User
FTP_passFTP Password

◆ setDO()

virtual void setDO ( const QString &  io_var,
const QString &  io_value 
)
pure virtual

Sets a variable (output) to a given value. This can also be used to set any variables to a desired value.

Parameters
io_vario_var -> digital output (string or number)
io_valueio_value -> value (string or number)

◆ setGeometryPose()

virtual void setGeometryPose ( Mat  pose,
bool  apply_transf = false 
)
pure virtual

Sets the position (pose) the object geometry with respect to its own reference frame. This procedure works for tools and objects.

Parameters
pose4x4 homogeneous matrix
apply_movementApply the movement to the inner geometry and not as a pose shift

◆ setInstruction()

virtual void setInstruction ( int  ins_id,
const QString &  name,
int  instype,
int  movetype,
bool  isjointtarget,
const Mat target,
const tJoints joints 
)
pure virtual

Sets the program instruction at position id

Parameters
ins_id
name
instype
movetype
isjointtarget
target
joints

◆ setMachiningParameters()

virtual Item setMachiningParameters ( const QString &  ncfile = "",
Item  part_obj = nullptr,
const QString &  options = "" 
)
pure virtual

Update the robot milling path input and parameters. Parameter input can be an NC file (G-code or APT file) or an object item in RoboDK. A curve or a point follow project will be automatically set up for a robot manufacturing project.
Tip: Use getLink() and setLink() to get/set the robot tool, reference frame, robot and program linked to the project.
Tip: Use setPose() and setJoints() to update the path to tool orientation or the preferred start joints.
Tip: Use setPoseTool() and setPoseFrame() to link to the corresponding tool and reference frames.

Item object_curves = RDK->ItemUserPick("Select an object with curves or points to follow", RoboDK::ITEM_TYPE_OBJECT);
if (!object_curves.Valid()){
// operation cancelled
return;
}
// Assuming ROBOT is a robot item
Item project = RDK->AddMachiningProject("Curve1 Settings", ROBOT);
// set the reference link:
project.setPoseFrame(ROBOT->getLink(RoboDK::ITEM_TYPE_FRAME));
// set the tool link:
project.setPoseTool(ROBOT->getLink(RoboDK::ITEM_TYPE_TOOL));
// set preferred start joints position (value automatically set by default)
project.setJoints(ROBOT->JointsHome());
// link the project to the part and provide additional settings
QString additional_options = "RotZ_Range=45 RotZ_Step=5 NormalApproach=50 No_Update";
project.setMachiningParameters("", object_curves, additional_options);
// in this example:
//RotZ_Range=45 RotZ_Step=5
//allow a tool z rotation of +/- 45 deg by steps of 5 deg
// NormalApproach=50
//Use 50 mm as normal approach by default
// No_Update
// Do not attempt to solve the path. It can be later updated by running project.Update()
The Item class represents an item in RoboDK station. An item can be a robot, a frame,...
Definition: iitem.h:14
virtual Item setMachiningParameters(const QString &ncfile="", Item part_obj=nullptr, const QString &options="")=0
Update the robot milling path input and parameters. Parameter input can be an NC file (G-code or APT ...
virtual void setPoseFrame(const Mat frame_pose)=0
Sets the reference frame of a robot(user frame). The frame can be either an item or a pose....
virtual void setJoints(const tJoints &jnts)=0
Set robot joints or the joints of a target
virtual void setPoseTool(const Mat tool_pose)=0
Sets the tool of a robot or a tool object (Tool Center Point, or TCP). The tool pose can be either an...
Parameters
ncfilepath to the NC (G-code/APT/Point cloud) file to load (optional)
part_objobject holding curves or points to automatically set up a curve/point follow project (optional)
optionsAdditional options (optional)
Returns
Program (can be null it has not been updated). Use Update() to retrieve the result

◆ setName()

virtual void setName ( const QString &  name)
pure virtual

Set the name of a RoboDK item.

Parameters
nameNew item name

◆ setParent()

virtual void setParent ( Item  parent)
pure virtual

Attaches the item to a new parent while maintaining the relative position with its parent. The absolute position is changed.

Parameters
parent

◆ setParentStatic()

virtual void setParentStatic ( Item  parent)
pure virtual

Attaches the item to another parent while maintaining the current absolute position in the station. The relationship between this item and its parent is changed to maintain the abosolute position.

Parameters
parentparent item to attach this item to

◆ setPose()

virtual bool setPose ( const Mat  pose)
pure virtual

Sets the local position (pose) of an object, target or reference frame. For example, the position of an object/frame/target with respect to its parent. If a robot is provided, it will set the pose of the end efector.

Parameters
pose4x4 homogeneous matrix

◆ setPoseAbs()

virtual void setPoseAbs ( const Mat  pose)
pure virtual

Sets the global position (pose) of an item. For example, the position of an object/frame/target with respect to the station origin.

Parameters
pose4x4 homogeneous matrix (pose)

◆ setPoseFrame() [1/2]

virtual void setPoseFrame ( const Item  frame_item)
pure virtual

Sets the tool of a robot or a tool object (Tool Center Point, or TCP). The tool pose can be either an item or a 4x4 Matrix. If the item is a tool, it links the robot to the tool item.If tool is a pose, it updates the current robot TCP.

Parameters
pose4x4 homogeneous matrix (pose)

◆ setPoseFrame() [2/2]

virtual void setPoseFrame ( const Mat  frame_pose)
pure virtual

Sets the reference frame of a robot(user frame). The frame can be either an item or a pose. If "frame" is an item, it links the robot to the frame item. If frame is a pose, it updates the linked pose of the robot frame (with respect to the robot reference frame).

Parameters
frame_pose4x4 homogeneous matrix (pose)

◆ setPoseTool() [1/2]

virtual void setPoseTool ( const Item  tool_item)
pure virtual

Sets the tool of a robot or a tool object (Tool Center Point, or TCP). The tool pose can be either an item or a 4x4 Matrix. If the item is a tool, it links the robot to the tool item.If tool is a pose, it updates the current robot TCP.

Parameters
tool_itemTool item

◆ setPoseTool() [2/2]

virtual void setPoseTool ( const Mat  tool_pose)
pure virtual

Sets the tool of a robot or a tool object (Tool Center Point, or TCP). The tool pose can be either an item or a 4x4 Matrix. If the item is a tool, it links the robot to the tool item.If tool is a pose, it updates the current robot TCP.

Parameters
tool_pose4x4 homogeneous matrix (pose)

◆ setRobot()

virtual void setRobot ( const Item robot)
pure virtual

Sets the robot of a program or a target. You must set the robot linked to a program or a target every time you copy paste these objects. If the robot is not provided, the first available robot will be chosen automatically.

Parameters
robotRobot item

◆ setRounding()

virtual void setRounding ( double  zonedata)
pure virtual

Sets the robot movement smoothing accuracy (also known as zone data value).

Parameters
rounding_mmRounding value (double) (robot dependent, set to -1 for accurate/fine movements)

◆ setRunType()

virtual void setRunType ( int  program_run_type)
pure virtual

Sets if the program will be run in simulation mode or on the real robot (same flag obtained when right clicking a program and checking/unchecking the "Run on robot" option). Use: "PROGRAM_RUN_ON_SIMULATOR" to set the program to run on the simulator only or "PROGRAM_RUN_ON_ROBOT" to force the program to run on the robot.

Returns
number of instructions that can be executed

◆ setSpeed()

virtual void setSpeed ( double  speed_linear,
double  accel_linear = -1,
double  speed_joints = -1,
double  accel_joints = -1 
)
pure virtual

Sets the speed and/or the acceleration of a robot.

Parameters
speed_linearlinear speed in mm/s (-1 = no change)
accel_linearlinear acceleration in mm/s2 (-1 = no change)
speed_jointsjoint speed in deg/s (-1 = no change)
accel_jointsjoint acceleration in deg/s2 (-1 = no change)

◆ setVisible()

virtual void setVisible ( bool  visible,
int  visible_frame = -1 
)
pure virtual

Sets the item visiblity status

Parameters
visible
visible_referenceset the visible reference frame (1) or not visible (0)

◆ ShowInstructions()

virtual void ShowInstructions ( bool  visible = true)
pure virtual

Show or hide instruction items of a program in the RoboDK tree

Parameters
show

◆ ShowSequence()

virtual void ShowSequence ( tMatrix2D sequence)
pure virtual

Displays a sequence of joints

Parameters
sequencejoint sequence as a 6xN matrix or instruction sequence as a 7xN matrix

◆ ShowTargets()

virtual void ShowTargets ( bool  visible = true)
pure virtual

Show or hide targets of a program in the RoboDK tree

Parameters
show

◆ SimulatorJoints()

virtual tJoints SimulatorJoints ( )
pure virtual

Return the current joint position of a robot (only from the simulator, never from the real robot).

This should be used only when RoboDK is connected to the real robot and only the simulated robot needs to be retrieved (for example, if we want to move the robot using a spacemouse).

Returns
double x n: joints matrix

◆ SolveFK()

virtual Mat SolveFK ( const tJoints joints,
const Mat tool_pose = nullptr,
const Mat reference_pose = nullptr 
)
pure virtual

Computes the forward kinematics of the robot for the provided joints. The tool and the reference frame are not taken into account.

Parameters
joints
Returns
4x4 homogeneous matrix: pose of the robot flange with respect to the robot base

◆ SolveIK()

virtual tJoints SolveIK ( const Mat pose,
const tJoints joints_close = nullptr,
const Mat tool_pose = nullptr,
const Mat reference_pose = nullptr 
)
pure virtual

Computes the inverse kinematics for the specified robot and pose. The joints returned are the closest to the current robot configuration (see SolveIK_All())

Parameters
pose4x4 matrix -> pose of the robot flange with respect to the robot base frame
joints_closeAproximate joints solution to choose among the possible solutions. Leave this value empty to return the closest match to the current robot position.
tool_poseOptionally provide a tool pose, otherwise, the robot flange is used. Tip: use robot.PoseTool() to retrieve the active robot tool.
reference_poseOptionally provide a reference pose, otherwise, the robot base is used. Tip: use robot.PoseFrame() to retrieve the active robot reference frame.
Returns
array of joints

◆ SolveIK_All()

virtual QList< tJoints > SolveIK_All ( const Mat pose,
const Mat tool_pose = nullptr,
const Mat reference_pose = nullptr 
)
pure virtual

Computes the inverse kinematics for the specified robot and pose. The function returns all available joint solutions as a 2D matrix.

Parameters
pose4x4 matrix -> pose of the robot tool with respect to the robot frame
tool_poseOptionally provide a tool pose, otherwise, the robot flange is used. Tip: use robot.PoseTool() to retrieve the active robot tool.
reference_poseOptionally provide a reference pose, otherwise, the robot base is used. Tip: use robot.PoseFrame() to retrieve the active robot reference frame.
Returns
double x n x m -> joint list (2D matrix)

◆ Update()

virtual double Update ( double  out_nins_time_dist[4],
int  collision_check = RoboDK::COLLISION_OFF,
double  mm_step = -1,
double  deg_step = -1 
)
pure virtual

Updates a program and returns the estimated time and the number of valid instructions. An update can also be applied to a robot machining project. The update is performed on the generated program.

Parameters
collision_checkcheck_collisions: Check collisions (COLLISION_ON -yes- or COLLISION_OFF -no-)
timeout_secMaximum time to wait for the update to complete (in seconds)
out_nins_time_distoptional double array [3] = [valid_instructions, program_time, program_distance]
mm_stepMaximum step in millimeters for linear movements (millimeters). Set to -1 to use the default, as specified in Tools-Options-Motion.
deg_stepMaximum step for joint movements (degrees). Set to -1 to use the default, as specified in Tools-Options-Motion.
Returns
1.0 if there are no problems with the path or less than 1.0 if there is a problem in the path (ratio of problem)

◆ Visible()

virtual bool Visible ( )
pure virtual

Returns 1 if the item is visible, otherwise, returns 0

Returns
true if visible, false if not visible

◆ waitDI()

virtual void waitDI ( const QString &  io_var,
const QString &  io_value,
double  timeout_ms = -1 
)
pure virtual

Waits for an input io_id to attain a given value io_value. Optionally, a timeout can be provided.

Parameters
io_vario_var -> digital output (string or number)
io_valueio_value -> value (string or number)
timeout_msint (optional) -> timeout in miliseconds

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