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< Item > | Childs ()=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< tJoints > | SolveIK_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 ¶ms="")=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 ¶m, 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< Mat > | JointPoses (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... | |
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.
anonymous enum |
Tree item types.
Adds an empty tool to the robot provided the tool pose (4x4 Matrix) and the tool name.
tool_pose | TCP as a 4x4 Matrix (pose of the tool frame) |
tool_name | New tool name |
|
pure virtual |
Attach the closest object to the tool. Returns the item that was attached.
|
pure virtual |
Checks if a robot or program is currently running (busy or moving)
|
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.
|
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)
id | Optionally retrieve the index of the object (used for robot joints) |
|
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.
cmd | Command Name, such as Trace, Threads or Window. |
value | Comand value (optional, not all commands require a value) |
|
pure virtual |
Connect to a real robot using the corresponding robot driver.
robot_ip | IP of the robot to connect. Leave empty to use the one defined in RoboDK |
|
pure virtual |
Retrieve the robot connection status.
msg | pass a non null pointer to retrieve a readable message (same message seen in the roboto connection status bar) |
|
pure virtual |
Returns the robot connection parameters
robotIP | Robot IP |
port | Communication port |
remote_path | Remote path to place sent programs |
FTP_user | FTP User |
FTP_pass | FTP Password |
|
pure virtual |
Add a custom instruction. This instruction will execute a Python file or an executable file.
name | |
path_run | path to run(relative to RoboDK/bin folder or absolute path) |
path_icon | icon path(relative to RoboDK/bin folder or absolute path) |
blocking | True if blocking, 0 if it is a non blocking executable trigger |
cmd_run_on_robot | Command to run through the driver when connected to the robot |
:param name: digital input (string or number)
Detach the closest object attached to the tool (see also setParentStatic).
|
pure virtual |
Disconnect from a real robot (when the robot driver is used)
|
pure virtual |
Returns the position (pose) the object geometry with respect to its own reference frame. This procedure works for tools and objects.
|
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.
io_var | Digital Input (string or number) |
|
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.
type_linked | type of linked object to retrieve |
|
pure virtual |
Returns the program instruction at position id
ins_id | |
name | |
instype | |
movetype | |
isjointtarget | |
target | |
joints |
|
pure virtual |
Returns the number of instructions of a program.
|
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.
instructions | the matrix of instructions |
|
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.
error_msg | Returns a human readable error message (if any) |
joint_list | Returns 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]
mm_step | Maximum step in millimeters for linear movements (millimeters) |
deg_step | Maximum step for joint movements (degrees) |
collision_check | Check for collisions |
result_flag | set 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). |
|
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.
ins_id |
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).
|
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.
|
pure virtual |
Returns the robot configuration state for a set of robot joints.
joints | array of joints |
config | configuration status as [REAR, LOWERARM, FLIP] |
|
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"
|
pure virtual |
Saves a program to a file.
filename | File path of the program |
run_mode | RUNMODE_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. |
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.
itemtarget1 | Intermediate target to move to as a target item (target item) |
itemtarget2 | Final target to move to as a target item (target item) |
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.
target1 | Intermediate pose target to move to. It must be a 4x4 Homogeneous matrix |
target2 | Final pose target to move to. It must be a 4x4 Homogeneous matrix |
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.
joints1 | Intermediate joint target to move to. |
joints2 | Final joint target to move to. |
|
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.
target | Target to move to as a target item (RoboDK target item) |
|
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.
target | Pose target to move to. It must be a 4x4 Homogeneous matrix |
|
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.
target | Robot joints to move to |
|
pure virtual |
Checks if a joint movement is possible and, optionally, free of collisions.
j1 | Start joints |
j2 | Destination joints |
minstep_deg | Maximum joint step in degrees. If this value is not provided it will use the path step defined in Tools-Options-Motion (degrees). |
|
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.
itemtarget | Target to move to as a target item (RoboDK target item) |
|
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.
target | Pose target to move to. It must be a 4x4 Homogeneous matrix |
|
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.
joints | Robot joints to move to |
|
pure virtual |
Checks if a linear movement is free of issues and, optionally, collisions.
joints1 | Start joints |
pose2 | Destination pose (active tool with respect to the active reference frame) |
minstep_mm | Maximum joint step in mm. If this value is not provided it will use the path step defined in Tools-Options-Motion (mm). |
|
pure virtual |
Returns the name of an item. The name of the item is always displayed in the RoboDK station tree
|
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.
link_id | link index(0 for the robot base, 1 for the first link, ...) |
|
pure virtual |
Return the parent item of this item
|
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.
time_ms | Time in milliseconds |
|
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
|
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.
|
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.
|
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.
|
pure virtual |
Adds a program call, code, message or comment inside a program.
code | <string of the code or program to run/param>
|
|
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
|
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.
|
pure virtual |
Save a station, a robot, a tool or an object to a file
filename | path and file name |
|
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.
ins_id |
|
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).
scale | scale to apply as [scale_x, scale_y, scale_z] |
|
pure virtual |
Returns true if the item is selected by the user (in the tree or the screen)
|
pure virtual |
Set an Analog Output (AO).
io_var | analog output (string or number) |
io_value | value (string or number) |
|
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)
clr | color to set |
|
pure virtual |
Set the robot connection parameters
robotIP | Robot IP |
port | Communication port |
remote_path | Remote path to place sent programs |
FTP_user | FTP User |
FTP_pass | FTP Password |
|
pure virtual |
Sets a variable (output) to a given value. This can also be used to set any variables to a desired value.
io_var | io_var -> digital output (string or number) |
io_value | io_value -> value (string or number) |
|
pure virtual |
Sets the position (pose) the object geometry with respect to its own reference frame. This procedure works for tools and objects.
pose | 4x4 homogeneous matrix |
apply_movement | Apply the movement to the inner geometry and not as a pose shift |
|
pure virtual |
Sets the program instruction at position id
ins_id | |
name | |
instype | |
movetype | |
isjointtarget | |
target | |
joints |
|
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.
ncfile | path to the NC (G-code/APT/Point cloud) file to load (optional) |
part_obj | object holding curves or points to automatically set up a curve/point follow project (optional) |
options | Additional options (optional) |
|
pure virtual |
Set the name of a RoboDK item.
name | New item name |
|
pure virtual |
Attaches the item to a new parent while maintaining the relative position with its parent. The absolute position is changed.
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.
parent | parent item to attach this item to |
|
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.
pose | 4x4 homogeneous matrix |
|
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.
pose | 4x4 homogeneous matrix (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.
pose | 4x4 homogeneous matrix (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).
frame_pose | 4x4 homogeneous matrix (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.
tool_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.
tool_pose | 4x4 homogeneous matrix (pose) |
|
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.
robot | Robot item |
|
pure virtual |
Sets the robot movement smoothing accuracy (also known as zone data value).
rounding_mm | Rounding value (double) (robot dependent, set to -1 for accurate/fine movements) |
|
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.
|
pure virtual |
Sets the speed and/or the acceleration of a robot.
speed_linear | linear speed in mm/s (-1 = no change) |
accel_linear | linear acceleration in mm/s2 (-1 = no change) |
speed_joints | joint speed in deg/s (-1 = no change) |
accel_joints | joint acceleration in deg/s2 (-1 = no change) |
|
pure virtual |
Sets the item visiblity status
visible | |
visible_reference | set the visible reference frame (1) or not visible (0) |
|
pure virtual |
Show or hide instruction items of a program in the RoboDK tree
show |
|
pure virtual |
Displays a sequence of joints
sequence | joint sequence as a 6xN matrix or instruction sequence as a 7xN matrix |
|
pure virtual |
Show or hide targets of a program in the RoboDK tree
show |
|
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).
|
pure virtual |
Computes the forward kinematics of the robot for the provided joints. The tool and the reference frame are not taken into account.
joints |
|
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())
pose | 4x4 matrix -> pose of the robot flange with respect to the robot base frame |
joints_close | Aproximate joints solution to choose among the possible solutions. Leave this value empty to return the closest match to the current robot position. |
tool_pose | Optionally provide a tool pose, otherwise, the robot flange is used. Tip: use robot.PoseTool() to retrieve the active robot tool. |
reference_pose | Optionally provide a reference pose, otherwise, the robot base is used. Tip: use robot.PoseFrame() to retrieve the active robot reference frame. |
|
pure virtual |
Computes the inverse kinematics for the specified robot and pose. The function returns all available joint solutions as a 2D matrix.
pose | 4x4 matrix -> pose of the robot tool with respect to the robot frame |
tool_pose | Optionally provide a tool pose, otherwise, the robot flange is used. Tip: use robot.PoseTool() to retrieve the active robot tool. |
reference_pose | Optionally provide a reference pose, otherwise, the robot base is used. Tip: use robot.PoseFrame() to retrieve the active robot reference frame. |
|
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.
collision_check | check_collisions: Check collisions (COLLISION_ON -yes- or COLLISION_OFF -no-) |
timeout_sec | Maximum time to wait for the update to complete (in seconds) |
out_nins_time_dist | optional double array [3] = [valid_instructions, program_time, program_distance] |
mm_step | Maximum step in millimeters for linear movements (millimeters). Set to -1 to use the default, as specified in Tools-Options-Motion. |
deg_step | Maximum step for joint movements (degrees). Set to -1 to use the default, as specified in Tools-Options-Motion. |
|
pure virtual |
Returns 1 if the item is visible, otherwise, returns 0
|
pure virtual |
Waits for an input io_id to attain a given value io_value. Optionally, a timeout can be provided.
io_var | io_var -> digital output (string or number) |
io_value | io_value -> value (string or number) |
timeout_ms | int (optional) -> timeout in miliseconds |