RoboDK API - Documentation
Item Class Reference

TheItemclass represents an item inRoboDK年代tation. An item can be a robot, a frame, a tool, an object, a target, ... any item visible in the年代tation 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 <robodk_api.h>

Public Member Functions

Item(RoboDK*rdk=nullptr, quint64 ptr=0, qint32 type=-1)
Item(constItem&other)
Item& operator=(constItem&x)=default
QString ToString() const
RoboDK* RDK()
Returns theRoboDKlink Robolink().More...
void NewLink()
Create a new communication link forRoboDK. Use this for robots if you use a multithread application running multiple robots at the same time.More...
int Type() const
Itemtype (object, robot, tool, reference, robot machining project, ...)More...
void Save(const QString &filename)
Save a station, a robot, a tool or an object to a fileMore...
void 删除()
删除年代an item and its childs from the station.More...
bool Valid(bool check_pointer=false) const
Check if an item is valid (not null and available in the open station)More...
void 年代etParent(Itemparent)
Attaches the item to a new parent while maintaining the relative position with its parent. The absolute position is changed.More...
void 年代etParentStatic(Itemparent)
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...
Item AttachClosest()
Attach the closest object to the tool. Returns the item that was attached.More...
Item DetachClosest(Itemparent)
Detach the closest object attached to the tool (see also setParentStatic).More...
void DetachAll(Itemparent)
Detach any object attached to a tool.More...
Item Parent() const
Return the parent item of this itemMore...
QList<Item> Childs() const
Returns a list of the item childs that are attached to the provided item.More...
bool Visible() const
Returns 1 if the item is visible, otherwise, returns 0.More...
void 年代etVisible(bool visible, int visible_frame=-1)
Sets the item visiblity statusMore...
QString Name() const
Returns the name of an item. The name of the item is always displayed in theRoboDK年代tation treeMore...
void 年代etName(const QString &name)
Set the name of aRoboDKitem.More...
void 年代etPose(constMatpose)
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...
Mat Pose() const
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 efectorMore...
void 年代etGeometryPose(constMatpose)
Sets the position (pose) the object geometry with respect to its own reference frame. This procedure works for tools and objects.More...
Mat GeometryPose()
Returns the position (pose) the object geometry with respect to its own reference frame. This procedure works for tools and objects.More...
Mat PoseTool()
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...
Mat PoseFrame()
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...
void 年代etPoseFrame(constMatframe_pose)
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...
void 年代etPoseFrame(constItemframe_item)
设置一个机器人的工具或工具对象(Ce的工具nter 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...
void 年代etPoseTool(constMattool_pose)
设置一个机器人的工具或工具对象(Ce的工具nter 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...
void 年代etPoseTool(constItemtool_item)
设置一个机器人的工具或工具对象(Ce的工具nter 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...
void 年代etPoseAbs(constMatpose)
Sets the global position (pose) of an item. For example, the position of an object/frame/target with respect to the station origin.More...
Mat PoseAbs()
Returns the global position (pose) of an item. For example, the position of an object/frame/target with respect to the station origin.More...
void 年代etColor(double colorRGBA[4])
Changes the color of a robot/object/tool. A color must must in the format COLOR=[R,G,B,(A=1)] where all values range from 0 to 1. Alpha (A) defaults to 1 (100% opaque). Set A to 0 to make an object transparent.More...
void Scale(double scale)
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).More...
void Scale(double scale_xyz[3])
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...
Item 年代etMachiningParameters(QString ncfile="",Itempart_obj=nullptr, QString options="")
Update the robot milling path input and parameters. Parameter input can be an NC file (G-code or APT file) or an object item inRoboDK. A curve or a point follow project will be automatically set up for a robot manufacturing project.
Tip: UsegetLink()and setLink() to get/set the robot tool, reference frame, robot and program linked to the project.
Tip: Use年代etPose()and年代etJoints()to update the path to tool orientation or the preferred start joints.
Tip: Use年代etPoseTool()and年代etPoseFrame()to link to the corresponding tool and reference frames.More...
void 年代etAsCartesianTarget()
Sets a target as a cartesian target. A cartesian target moves to cartesian coordinates.More...
void 年代etAsJointTarget()
Sets a target as a joint target. A joint target moves to a joints position without regarding the cartesian coordinates.More...
bool isJointTarget() const
Returns True if a target is a joint target (green icon). Otherwise, the target is a Cartesian target (red icon).More...
tJoints Joints() const
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...
tJoints JointsHome() const
Returns the home joints of a robot. These joints can be manually set in the robot "Parameters" menu, then select "Set home position"More...
void 年代etJointsHome(consttJoints&jnts)
Set robot joints for the home positionMore...
Item ObjectLink(int link_id=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...
Item getLink(int type_linked=RoboDK::ITEM_TYPE_ROBOT)
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...
void 年代etJoints(consttJoints&jnts)
Set robot joints or the joints of a targetMore...
void JointLimits(tJoints*lower_limits,tJoints*upper_limits)
Retrieve the joint limits of a robotMore...
void 年代etJointLimits(consttJoints&lower_limits, consttJoints&upper_limits)
Set the joint limits of a robotMore...
void 年代etRobot(constItem&robot)
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...
Item AddTool(constMat&tool_pose, const QString &tool_name="New TCP")
Adds an empty tool to the robot provided the tool pose (4x4 Matrix) and the tool name.More...
Mat SolveFK(consttJoints&joints, constMat*tool=nullptr, constMat*ref=nullptr)
Computes the forward kinematics of the robot for the provided joints. The tool and the reference frame are not taken into account.More...
void JointsConfig(consttJoints&joints,tConfigconfig)
Returns the robot configuration state for a set of robot joints.More...
tJoints SolveIK(constMat&pose, constMat*tool=nullptr, constMat*ref=nullptr)
This function calculates the inverse kinematics for a pose. The joints returned are the closest to the current robot configuration (seeSolveIK_All()). If the pose is not reachable, the length of the returned joints is 0.More...
tJoints SolveIK(constMatpose,tJointsjoints_approx, constMat*tool=nullptr, constMat*ref=nullptr)
Computes the inverse kinematics for the specified robot and pose. The joints returned are the closest to the current robot configuration (seeSolveIK_All())More...
tMatrix2D* SolveIK_All_Mat2D(constMat&pose, constMat*tool=nullptr, constMat*ref=nullptr)
Computes the inverse kinematics for the specified robot and pose. The function returns all available joint solutions as a 2D matrix.More...
QList<tJoints> SolveIK_All(constMat&pose, constMat*tool=nullptr, constMat*ref=nullptr)
Computes the inverse kinematics for the specified robot and pose. The function returns all available joint solutions as a 2D matrix.More...
bool Connect(const QString &robot_ip="")
Connect to a real robot using the corresponding robot driver.More...
bool Disconnect()
Disconnect from a real robot (when the robot driver is used)More...
void MoveJ(constItem&itemtarget, bool blocking=true)
Moves a robot to a specific target ("Move Joint" mode). By default, this function blocks until the robot finishes its movements. Given a target item, MoveJ can also be applied to programs and a new movement instruction will be added.More...
void MoveJ(consttJoints&joints, bool blocking=true)
Moves a robot to a specific target ("Move Joint" mode). By default, this function blocks until the robot finishes its movements.More...
void MoveJ(constMat&target, bool blocking=true)
Moves a robot to a specific target ("Move Joint" mode). By default, this function blocks until the robot finishes its movements.More...
void MoveL(constItem&itemtarget, bool blocking=true)
Moves a robot to a specific target ("Move Linear" mode). By default, this function blocks until the robot finishes its movements. Given a target item, MoveL can also be applied to programs and a new movement instruction will be added.More...
void MoveL(consttJoints&joints, bool blocking=true)
Moves a robot to a specific target ("Move Linear" mode). By default, this function blocks until the robot finishes its movements.More...
void MoveL(constMat&target, bool blocking=true)
Moves a robot to a specific target ("Move Linear" mode). By default, this function blocks until the robot finishes its movements.More...
void MoveC(constItem&itemtarget1, constItem&itemtarget2, bool blocking=true)
Moves a robot to a specific target ("Move Circular" mode). By default, this function blocks until the robot finishes its movements.More...
void MoveC(consttJoints&joints1, consttJoints&joints2, bool blocking=true)
Moves a robot to a specific target ("Move Circular" mode). By default, this function blocks until the robot finishes its movements.More...
void MoveC(constMat&target1, constMat&target2, bool blocking=true)
Moves a robot to a specific target ("Move Circular" mode). By default, this function blocks until the robot finishes its movements.More...
int MoveJ_Test(consttJoints&j1, consttJoints&j2, double minstep_deg=-1)
Checks if a joint movement is possible and, optionally, free of collisions.More...
int MoveL_Test(consttJoints&joints1, constMat&pose2, double minstep_mm=-1)
Checks if a linear movement is free of issues and, optionally, collisions.More...
void 年代etSpeed(double speed_linear, double accel_linear=-1, double speed_joints=-1, double accel_joints=-1)
Sets the speed and/or the acceleration of a robot.More...
void 年代etRounding(double zonedata)
Sets the robot movement smoothing accuracy (also known as zone data value).More...
void ShowSequence(tMatrix2D*sequence)
Displays a sequence of jointsMore...
bool Busy()
Checks if a robot or program is currently running (busy or moving)More...
void Stop()
Stops a program or a robotMore...
void WaitMove(double timeout_sec=300) const
Waits (blocks) until the robot finishes its movement.More...
void 年代etAccuracyActive(int accurate=1)
集机器人活动或非活动的准确性。A robot must have been calibrated to properly use this option.More...
bool MakeProgram(const QString &filename)
Saves a program to a file.More...
void 年代etRunType(int program_run_type)
Sets if the program will be run in simulation mode or on the real robot. 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...
int RunProgram()
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 theRoboDKGUIMore...
int RunCode(const QString ¶meters)
Runs a program. It returns the number of instructions that can be executed successfully (a quick program check is performed before the program starts) Program parameters can be provided for Python calls. 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 theRoboDKGUIMore...
int RunInstruction(const QString代码,int run_type =RoboDK::INSTRUCTION_CALL_PROGRAM)
Adds a program call, code, message or comment inside a program.More...
void Pause(double time_ms=-1)
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...
void 年代etDO(const QString &io_var, const QString &io_value)
Sets a variable (output) to a given value. This can also be used to set any variables to a desired value.More...
void 年代etAO(const QString &io_var, const QString &io_value)
Set an analog OutputMore...
QString getDI(const QString &io_var)
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...
QString getAI(const QString &io_var)
Get an Analog Input (AI). 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 (0-1 or other range depending on the robot driver). This function returns an empty string if the script is not executed on the robot.More...
void waitDI(const QString &io_var, const QString &io_value, double timeout_ms=-1)
Waits for an input io_id to attain a given value io_value. Optionally, a timeout can be provided.More...
void customInstruction(const QString &name, const QString &path_run, const QString &path_icon="", bool blocking=true, const QString &cmd_run_on_robot="")
Add a custom instruction. This instruction will execute a Python file or an executable file.More...
void ShowInstructions(bool visible=true)
Show or hide instruction items of a program in theRoboDKtreeMore...
void ShowTargets(bool visible=true)
Show or hide targets of a program in theRoboDKtreeMore...
int InstructionCount()
Returns the number of instructions of a program.More...
void Instruction(int ins_id, QString &name, int &instype, int &movetype, bool &isjointtarget,Mat&target,tJoints&joints)
Returns the program instruction at position idMore...
void 年代etInstruction(int ins_id, const QString &name, int instype, int movetype, bool isjointtarget, constMat&target, consttJoints&joints)
Sets the program instruction at position idMore...
int InstructionList(tMatrix2D*instructions)
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...
double Update(int collision_check=RoboDK::COLLISION_OFF, int timeout_sec=3600, double *out_nins_time_dist=nullptr, double mm_step=-1, double deg_step=-1)
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...
int InstructionListJoints(QString &error_msg,tMatrix2D**joint_list, double mm_step=10.0, double deg_step=5.0, const QString &save_to_file="", bool collision_check=false, int flags=0, double time_step_s=0.1)
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...
QString 年代etParam(const QString ¶m, const QString &value)
Set a specific item parameter. SelectTools-Run Script-Show Commandsto see all available commands for items and the station. Note: For parameters (commands) that require a JSON string value you can also provide a dict.More...
bool Finish()
Disconnect from theRoboDKAPI. This flushes any pending program generation.More...
quint64 GetID()
Get the item pointer.

Private Attributes

RoboDK* _RDK
Pointer toRoboDKlink object.
quint64 _PTR
指针里面的物品RoboDK.
qint32 _TYPE
Itemtype.

Friends

class RoboDK_API::RoboDK

Detailed Description

TheItemclass represents an item inRoboDK年代tation. An item can be a robot, a frame, a tool, an object, a target, ... any item visible in the年代tation 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 line1739of filerobodk_api.h.

Member Function Documentation

AddTool()

ItemAddTool ( constMat& tool_pose,
const QString & tool_name="New TCP"
)

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

Parameters
tool_pose TCP as a 4x4 Matrix (pose of the tool frame)
tool_name New tool name
Returns
new item created
Parameters
tool_pose pose -> TCP as a 4x4 Matrix (pose of the tool frame)
tool_name New tool name
Returns
new item created

Definition at line1222of filerobodk_api.cpp.

AttachClosest()

ItemAttachClosest ( )

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

Returns
Attached item

Definition at line672of filerobodk_api.cpp.

Busy()

bool Busy ( )

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

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

Definition at line1583of filerobodk_api.cpp.

Childs()

QList<Item> Childs ( ) const

Returns a list of the item childs that are attached to the provided item.

Returns
item x n: list of child items

add more methods

Returns
item x n -> list of child items

Definition at line726of filerobodk_api.cpp.

Connect()

bool Connect ( const QString & robot_ip="" )

Connect to a real robot using the corresponding robot driver.

Connect to a real robot using the robot driver.

Parameters
robot_ip IP of the robot to connect. Leave empty to use the one defined inRoboDK
Returns
true if connected successfully, false if connection failed
Parameters
robot_ip IP of the robot to connect. Leave empty to use the one defined inRoboDK
Returns
年代tatus -> true if connected successfully, false if connection failed

Definition at line1366of filerobodk_api.cpp.

customInstruction()

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

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

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

Definition at line1826of filerobodk_api.cpp.

删除()

无效的删除 ( )

删除年代an item and its childs from the station.

Definition at line624of filerobodk_api.cpp.

DetachAll()

void DetachAll ( Item parent )

Detach any object attached to a tool.

Definition at line698of filerobodk_api.cpp.

DetachClosest()

ItemDetachClosest ( Item parent )

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

Returns
Detached item

Definition at line685of filerobodk_api.cpp.

Disconnect()

bool Disconnect ( )

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.
Returns
年代tatus -> true if disconnected successfully, false if it failed. It can fail if it was previously disconnected manually for example.

Definition at line1380of filerobodk_api.cpp.

Finish()

bool Finish ( )

Disconnect from theRoboDKAPI. This flushes any pending program generation.

Returns

Definition at line2075of filerobodk_api.cpp.

GeometryPose()

MatGeometryPose ( )

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)

Definition at line840of filerobodk_api.cpp.

getAI()

QString getAI ( const QString & io_var )

Get an Analog Input (AI). 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 (0-1 or other range depending on the robot driver). This function returns an empty string if the script is not executed on the robot.

Parameters
io_var io_var -> analog input (string or number as a string)

Definition at line1790of filerobodk_api.cpp.

getDI()

QString getDI ( const QString & io_var )

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_var io_var -> digital input (string or number as a string)

Definition at line1776of filerobodk_api.cpp.

getLink()

ItemgetLink ( int type_linked=RoboDK::ITEM_TYPE_ROBOT )

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.

Returns an item pointer (Itemclass) to a robot, object, tool or program. This is useful to retrieve the relationship between programs, robots, tools and other specific projects.

Parameters
type_linked type of linked object to retrieve
Returns
Linked object
Parameters
type_linked type of linked object to retrieve
Returns

Definition at line1149of filerobodk_api.cpp.

Instruction()

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

Returns the program instruction at position id

Parameters
ins_id
name
instype
movetype
isjointtarget
target
joints

Definition at line1916of filerobodk_api.cpp.

InstructionCount()

int InstructionCount ( )

Returns the number of instructions of a program.

Returns

ADD MORE METHODS

Returns

Definition at line1897of filerobodk_api.cpp.

InstructionList()

int InstructionList ( tMatrix2D* instructions )

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
instructions the matrix of instructions
Returns
Returns 0 if success

Definition at line1969of filerobodk_api.cpp.

InstructionListJoints()

int InstructionListJoints ( QString & error_msg,
tMatrix2D** joint_list,
double mm_step=10.0,
double deg_step=5.0,
const QString & 年代ave_to_file="",
bool 上校lision_check=false,
int result_flag=0,
double time_step_s=0.1
)

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_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]

Parameters
mm_step Maximum step in millimeters for linear movements (millimeters)
deg_step Maximum step for joint movements (degrees)
年代ave_to_file Provide a file name to directly save the output to a file. If the file name is not provided it will return the matrix. If step values are very small, the returned matrix can be very large.
上校lision_check Check for collisions
result_flag 年代et 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
Parameters
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
mm_step Maximum step in millimeters for linear movements (millimeters)
deg_step Maximum step for joint movements (degrees)
年代ave_to_file Provide a file name to directly save the output to a file. If the file name is not provided it will return the matrix. If step values are very small, the returned matrix can be very large.
上校lision_check Check for collisions
result_flag 年代et 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

Definition at line2030of filerobodk_api.cpp.

isJointTarget()

bool isJointTarget ( ) const

Returns True if a target is a joint target (green icon). Otherwise, the target is a Cartesian target (red icon).

Definition at line1075of filerobodk_api.cpp.

JointLimits()

void JointLimits ( tJoints* lower_limits,
tJoints* upper_limits
)

Retrieve the joint limits of a robot

Returns the joint limits of a robot

Parameters
lower_limits
upper_limits

Definition at line1177of filerobodk_api.cpp.

Joints()

tJointsJoints ( ) const

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
Returns
double x n -> joints matrix

Definition at line1090of filerobodk_api.cpp.

JointsConfig()

void JointsConfig ( consttJoints& joints,
tConfig config
)

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

Parameters
joints array of joints
config configuration status as [REAR, LOWERARM, FLIP]
Parameters
joints array of joints
Returns
3-array -> configuration status as [REAR, LOWERARM, FLIP]

Definition at line1260of filerobodk_api.cpp.

JointsHome()

tJointsJointsHome ( ) const

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
Returns
double x n -> joints array

Definition at line1106of filerobodk_api.cpp.

MakeProgram()

bool MakeProgram ( const QString & filename )

Saves a program to a file.

Parameters
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.
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)
Parameters
filename File path of the program
Returns
年代uccess

Definition at line1645of filerobodk_api.cpp.

MoveC()[1/3]

void MoveC ( constItem& itemtarget1,
constItem& itemtarget2,
bool blocking=true
)

Moves a robot to a specific target ("Move Circular" mode). By default, this function blocks until the robot finishes its movements.

Parameters
itemtarget1 Intermediate target to move to as a target item (RoboDKtarget item)
itemtarget2 Final target to move to as a target item (RoboDKtarget item)
Parameters
itemtarget1 target -> intermediate target to move to as a target item (RoboDKtarget item)
itemtarget2 target -> final target to move to as a target item (RoboDKtarget item)
blocking blocking -> True if we want the instruction to block until the robot finished the movement (default=true)

Definition at line1467of filerobodk_api.cpp.

MoveC()[2/3]

void MoveC ( constMat& target1,
constMat& target2,
bool blocking=true
)

Moves a robot to a specific target ("Move Circular" mode). By default, this function blocks until the robot finishes its movements.

Parameters
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
Parameters
target1 pose -> intermediate pose target to move to. It must be a 4x4 Homogeneous matrix
target2 pose -> final pose target to move to. It must be a 4x4 Homogeneous matrix
blocking blocking -> True if we want the instruction to block until the robot finished the movement (default=true)

Definition at line1487of filerobodk_api.cpp.

MoveC()[3/3]

void MoveC ( consttJoints& joints1,
consttJoints& joints2,
bool blocking=true
)

Moves a robot to a specific target ("Move Circular" mode). By default, this function blocks until the robot finishes its movements.

Parameters
joints1 Intermediate joint target to move to.
joints2 Final joint target to move to.
Parameters
joints1 joints -> intermediate joint target to move to.
joints2 joints -> final joint target to move to.
blocking blocking -> True if we want the instruction to block until the robot finished the movement (default=true)

Definition at line1477of filerobodk_api.cpp.

MoveJ()[1/3]

void MoveJ ( constItem& itemtarget,
bool blocking=true
)

Moves a robot to a specific target ("Move Joint" mode). By default, this function blocks until the robot finishes its movements. Given a target item, MoveJ can also be applied to programs and a new movement instruction will be added.

Moves a robot to a specific target ("Move Joint" mode). By default, this function blocks until the robot finishes its movements.

Parameters
target Target to move to as a target item (RoboDKtarget item)
Parameters
target target -> target to move to as a target item (RoboDKtarget item)
blocking blocking -> True if we want the instruction to block until the robot finished the movement (default=true)

Definition at line1394of filerobodk_api.cpp.

MoveJ()[2/3]

void MoveJ ( constMat& target,
bool blocking=true
)

Moves a robot to a specific target ("Move Joint" mode). By default, this function blocks until the robot finishes its movements.

Parameters
target Pose target to move to. It must be a 4x4 Homogeneous matrix
Parameters
target pose -> pose target to move to. It must be a 4x4 Homogeneous matrix
blocking blocking -> True if we want the instruction to block until the robot finished the movement (default=true)

Definition at line1421of filerobodk_api.cpp.

MoveJ()[3/3]

void MoveJ ( consttJoints& joints,
bool blocking=true
)

Moves a robot to a specific target ("Move Joint" mode). By default, this function blocks until the robot finishes its movements.

Parameters
target Robot joints to move to
Parameters
target joints -> joint target to move to.
blocking blocking -> True if we want the instruction to block until the robot finished the movement (default=true)

Definition at line1412of filerobodk_api.cpp.

MoveJ_Test()

int MoveJ_Test ( consttJoints& j1,
consttJoints& j2,
double minstep_deg=-1
)

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

Checks if a joint movement is free of collision.

Parameters
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).
Returns
上校lision : 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.
Parameters
j1 joints -> start joints
j2 joints -> destination joints
minstep_deg (optional): maximum joint step in degrees
Returns
上校lision : 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.

Definition at line1498of filerobodk_api.cpp.

MoveL()[1/3]

void MoveL ( constItem& itemtarget,
bool blocking=true
)

Moves a robot to a specific target ("Move Linear" mode). By default, this function blocks until the robot finishes its movements. Given a target item, MoveL can also be applied to programs and a new movement instruction will be added.

Moves a robot to a specific target ("Move Linear" mode). By default, this function blocks until the robot finishes its movements.

Parameters
itemtarget Target to move to as a target item (RoboDKtarget item)
Parameters
itemtarget target -> target to move to as a target item (RoboDKtarget item)
blocking blocking -> True if we want the instruction to block until the robot finished the movement (default=true)

Definition at line1430of filerobodk_api.cpp.

MoveL()[2/3]

void MoveL ( constMat& target,
bool blocking=true
)

Moves a robot to a specific target ("Move Linear" mode). By default, this function blocks until the robot finishes its movements.

Parameters
target Pose target to move to. It must be a 4x4 Homogeneous matrix
Parameters
target pose -> pose target to move to. It must be a 4x4 Homogeneous matrix
blocking blocking -> True if we want the instruction to block until the robot finished the movement (default=true)

Definition at line1457of filerobodk_api.cpp.

MoveL()[3/3]

void MoveL ( consttJoints& joints,
bool blocking=true
)

Moves a robot to a specific target ("Move Linear" mode). By default, this function blocks until the robot finishes its movements.

Parameters
joints Robot joints to move to
Parameters
joints joints -> joint target to move to.
blocking blocking -> True if we want the instruction to block until the robot finished the movement (default=true)

Definition at line1448of filerobodk_api.cpp.

MoveL_Test()

int MoveL_Test ( consttJoints& j1,
constMat& pose2,
double minstep_deg=-1
)

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

Checks if a linear movement is free of collision.

Parameters
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).
Returns
上校lision : 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.
Parameters
j1 joints -> start joints
pose2 joints -> destination pose (active tool with respect to the active reference frame)
minstep_mm (optional): maximum joint step in degrees
Returns
上校lision : 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.

Definition at line1519of filerobodk_api.cpp.

Name()

QString Name ( ) const

Returns the name of an item. The name of the item is always displayed in theRoboDK年代tation tree

Returns
name of the item

Definition at line774of filerobodk_api.cpp.

NewLink()

void NewLink ( )

Create a new communication link forRoboDK. Use this for robots if you use a multithread application running multiple robots at the same time.

Definition at line593of filerobodk_api.cpp.

ObjectLink()

ItemObjectLink ( int link_id=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.

Returns an item pointer (:class:.Item) to a robot link. This is useful to show/hide certain robot links or alter their geometry.

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

Definition at line1134of filerobodk_api.cpp.

Parent()

ItemParent ( ) const

Return the parent item of this item

Returns
Parent item

Definition at line711of filerobodk_api.cpp.

Pause()

void Pause ( double time_ms=-1 )

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_ms Time in milliseconds

Definition at line1736of filerobodk_api.cpp.

Pose()

MatPose ( ) const

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)

Definition at line815of filerobodk_api.cpp.

PoseAbs()

MatPoseAbs ( )

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)

Definition at line970of filerobodk_api.cpp.

PoseFrame()

MatPoseFrame ( )

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)

Definition at line892of filerobodk_api.cpp.

PoseTool()

MatPoseTool ( )

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)

Definition at line879of filerobodk_api.cpp.

RDK()

RoboDK* RDK ( )

Returns theRoboDKlink Robolink().

Returns

Definition at line586of filerobodk_api.cpp.

RunCode()

int RunCode ( const QString & parameters )

Runs a program. It returns the number of instructions that can be executed successfully (a quick program check is performed before the program starts) Program parameters can be provided for Python calls. 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 theRoboDKGUI

Parameters
parameters Number of instructions that can be executed

Definition at line1701of filerobodk_api.cpp.

RunInstruction()

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

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

Parameters
code
Parameters
run_type INSTRUCTION_* variable to specify if the code is a progra

Definition at line1721of filerobodk_api.cpp.

RunProgram()

int RunProgram ( )

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 theRoboDKGUI

Returns
True if successful
Returns
number of instructions that can be executed

Definition at line1682of filerobodk_api.cpp.

Save()

void Save ( const QString & filename )

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

Save a station or object to a file

Parameters
filename path and file name
Parameters
filename

Definition at line617of filerobodk_api.cpp.

Scale()[1/2]

void Scale ( double 年代cale )

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

------------------------------— add curve, scale, recolor, ...

Parameters
年代cale 年代cale to apply as scale or [scale_x, scale_y, scale_z]

Definition at line1003of filerobodk_api.cpp.

Scale()[2/2]

void Scale ( double 年代cale_xyz[3] )

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
年代cale 年代cale to apply as [scale_x, scale_y, scale_z]

Definition at line1016of filerobodk_api.cpp.

年代etAccuracyActive()

void setAccuracyActive ( int accurate=1 )

集机器人活动或非活动的准确性。A robot must have been calibrated to properly use this option.

Parameters
accurate 年代et to 1 to use the accurate model or 0 to use the nominal model

Definition at line1627of filerobodk_api.cpp.

年代etAO()

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

Set an analog Output

Parameters
io_var Analog Output
io_value Value as a string

Definition at line1763of filerobodk_api.cpp.

年代etAsCartesianTarget()

void setAsCartesianTarget ( )

Sets a target as a cartesian target. A cartesian target moves to cartesian coordinates.

Definition at line1055of filerobodk_api.cpp.

年代etAsJointTarget()

void setAsJointTarget ( )

Sets a target as a joint target. A joint target moves to a joints position without regarding the cartesian coordinates.

Definition at line1065of filerobodk_api.cpp.

年代etColor()

void setColor ( double 上校orRGBA[4] )

Changes the color of a robot/object/tool. A color must must in the format COLOR=[R,G,B,(A=1)] where all values range from 0 to 1. Alpha (A) defaults to 1 (100% opaque). Set A to 0 to make an object transparent.

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.

Parameters
tocolor 上校or to change to
fromcolor filter by this color
tolerance optional tolerance to use if a color filter is used (defaults to 0.1)

Definition at line983of filerobodk_api.cpp.

年代etDO()

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

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

Parameters
io_var io_var -> digital output (string or number)
io_value io_value -> value (string or number)

Definition at line1750of filerobodk_api.cpp.

年代etGeometryPose()

void setGeometryPose ( constMat pose )

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

Parameters
pose 4x4 homogeneous matrix
apply_movement Apply the movement to the inner geometry and not as a pose shift
Parameters
pose 4x4 homogeneous matrix

Definition at line828of filerobodk_api.cpp.

年代etInstruction()

void setInstruction ( int ins_id,
const QString & name,
int instype,
int movetype,
bool isjointtarget,
constMat& target,
consttJoints& joints
)

Sets the program instruction at position id

Parameters
ins_id
name
instype
movetype
isjointtarget
target
joints

Definition at line1946of filerobodk_api.cpp.

年代etJointLimits()

void setJointLimits ( consttJoints& lower_limits,
consttJoints& upper_limits
)

Set the joint limits of a robot

Parameters
lower_limits
upper_limits

Definition at line1192of filerobodk_api.cpp.

年代etJoints()

void setJoints ( consttJoints& jnts )

Set robot joints or the joints of a target

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

Parameters
joints

Definition at line1164of filerobodk_api.cpp.

年代etJointsHome()

void setJointsHome ( consttJoints& jnts )

Set robot joints for the home position

Sets the joint position of the "home" joints for a robot.

Parameters
joints

Definition at line1121of filerobodk_api.cpp.

年代etMachiningParameters()

Item年代etMachiningParameters ( QString ncfile="",
Item part_obj=nullptr,
QString options=""
)

Update the robot milling path input and parameters. Parameter input can be an NC file (G-code or APT file) or an object item inRoboDK. A curve or a point follow project will be automatically set up for a robot manufacturing project.
Tip: UsegetLink()and setLink() to get/set the robot tool, reference frame, robot and program linked to the project.
Tip: Use年代etPose()and年代etJoints()to update the path to tool orientation or the preferred start joints.
Tip: Use年代etPoseTool()and年代etPoseFrame()to link to the corresponding tool and reference frames.

Update the robot milling path input and parameters. Parameter input can be an NC file (G-code or APT file) or an object item inRoboDK. A curve or a point follow project will be automatically set up for a robot manufacturing project. Tip: UsegetLink()and setLink() to get/set the robot tool, reference frame, robot and program linked to the project. Tip: Use年代etPose()and年代etJoints()to update the path to tool orientation or the preferred start joints.

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.年代etPoseFrame(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()
RoboDK * RDK()
Returns the RoboDK link Robolink().
Definition: robodk_api.cpp:586
void setPoseFrame(const Mat frame_pose)
Sets the reference frame of a robot(user frame). The frame can be either an item or a pose....
Definition: robodk_api.cpp:906
@ ITEM_TYPE_TOOL
Item of type tool (.tool).
Definition: robodk_api.h:1329
@ ITEM_TYPE_FRAME
Item of type reference frame.
Definition: robodk_api.h:1326
@ ITEM_TYPE_OBJECT
Item of type object (.stl, .step or .iges for example).
Definition: robodk_api.h:1332
Item ItemUserPick(const QString &message="Pick one item", int itemtype=-1)
Shows a RoboDK popup to select one object from the open RoboDK station. An item type can be specified...
Definition: robodk_api.cpp:2243
Item AddMachiningProject(const QString &name="Curve follow settings", Item *itemrobot=nullptr)
Add a new robot machining project. Machining projects can also be used for 3D printing,...
Definition: robodk_api.cpp:2603
Parameters
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)
Returns
Program (can be null it has not been updated). UseUpdate ()to retrieve the result
Parameters
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)
Returns
Program linked to the project (invalid item if failed to update). UseUpdate ()to retrieve the result

Definition at line1036of filerobodk_api.cpp.

年代etName()

void setName ( const QString & name )

Set the name of aRoboDKitem.

Parameters
name

Definition at line787of filerobodk_api.cpp.

年代etParam()

QString setParam ( const QString & param,
const QString & value
)

Set a specific item parameter. SelectTools-Run Script-Show Commandsto see all available commands for items and the station. Note: For parameters (commands) that require a JSON string value you can also provide a dict.

Parameters
param item parameter
value value
Returns

Definition at line2060of filerobodk_api.cpp.

年代etParent()

void setParent ( Item parent )

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

Parameters
parent

Definition at line647of filerobodk_api.cpp.

年代etParentStatic()

void setParentStatic ( Item parent )

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
parent parent item to attach this item to
Parameters
parent parent item to attach this item

Definition at line660of filerobodk_api.cpp.

年代etPose()

void setPose ( constMat pose )

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
pose 4x4 homogeneous matrix

Definition at line802of filerobodk_api.cpp.

年代etPoseAbs()

void setPoseAbs ( constMat pose )

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

Parameters
pose 4x4 homogeneous matrix (pose)

Definition at line957of filerobodk_api.cpp.

年代etPoseFrame()[1/2]

void setPoseFrame ( constItem frame_item )

设置一个机器人的工具或工具对象(Ce的工具nter 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
pose 4x4 homogeneous matrix (pose)

Definition at line919of filerobodk_api.cpp.

年代etPoseFrame()[2/2]

void setPoseFrame ( constMat frame_pose )

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_pose 4x4 homogeneous matrix (pose)

Definition at line906of filerobodk_api.cpp.

年代etPoseTool()[1/2]

void setPoseTool ( constItem tool_item )

设置一个机器人的工具或工具对象(Ce的工具nter 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_item Tool item

Definition at line945of filerobodk_api.cpp.

年代etPoseTool()[2/2]

void setPoseTool ( constMat tool_pose )

设置一个机器人的工具或工具对象(Ce的工具nter 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_pose 4x4 homogeneous matrix (pose)

Definition at line932of filerobodk_api.cpp.

年代etRobot()

void setRobot ( constItem& robot )

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
robot Robot item

Definition at line1207of filerobodk_api.cpp.

年代etRounding()

void setRounding ( double zonedata )

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

Parameters
rounding_mm Rounding value (double) (robot dependent, set to -1 for accurate/fine movements)
Parameters
zonedata zonedata value (int) (robot dependent, set to -1 for fine movements)

Definition at line1558of filerobodk_api.cpp.

年代etRunType()

void setRunType ( int program_run_type )

Sets if the program will be run in simulation mode or on the real robot. 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

Definition at line1665of filerobodk_api.cpp.

年代etSpeed()

void setSpeed ( double 年代peed_linear,
double accel_linear=-1,
double 年代peed_joints=-1,
double accel_joints=-1
)

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

Parameters
年代peed_linear 线性速度mm / s(1 =没有变化)
accel_linear linear acceleration in mm/s2 (-1 = no change)
年代peed_joints joint speed in deg/s (-1 = no change)
accel_joints joint acceleration in deg/s2 (-1 = no change)

Definition at line1541of filerobodk_api.cpp.

年代etVisible()

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

Sets the item visiblity status

Parameters
visible
visible_reference 年代et the visible reference frame (1) or not visible (0)
Parameters
visible
visible_frame 年代rt the visible reference frame (1) or not visible (0)

Definition at line757of filerobodk_api.cpp.

ShowInstructions()

void ShowInstructions ( bool visible=true )

Show or hide instruction items of a program in theRoboDKtree

Parameters
年代how

Definition at line1871of filerobodk_api.cpp.

ShowSequence()

void ShowSequence ( tMatrix2D* 年代equence )

Displays a sequence of joints

Parameters
年代equence joint sequence as a 6xN matrix or instruction sequence as a 7xN matrix

Definition at line1570of filerobodk_api.cpp.

ShowTargets()

void ShowTargets ( bool visible=true )

Show or hide targets of a program in theRoboDKtree

Parameters
年代how

Definition at line1883of filerobodk_api.cpp.

SolveFK()

MatSolveFK ( consttJoints& joints,
constMat* tool=nullptr,
constMat* ref=nullptr
)

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

Definition at line1238of filerobodk_api.cpp.

SolveIK()[1/2]

tJointsSolveIK ( constMat& pose,
constMat* tool=nullptr,
constMat* ref=nullptr
)

This function calculates the inverse kinematics for a pose. The joints returned are the closest to the current robot configuration (seeSolveIK_All()). If the pose is not reachable, the length of the returned joints is 0.

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

Parameters
pose 4 x4矩阵- >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.
Returns
array of joints
Parameters
pose 4 x4矩阵- >pose of the robot flange with respect to the robot base frame
tool 4 x4矩阵- >Optionally provide a tool, otherwise, the robot flange is used. Tip: use robot.PoseTool() to retrieve the active robot tool.
reference 4 x4矩阵- >选择提供一个参考,其他rwise, the robot base is used. Tip: use robot.PoseFrame() to retrieve the active robot reference frame.
Returns
array of joints

Definition at line1278of filerobodk_api.cpp.

SolveIK()[2/2]

tJointsSolveIK ( constMat pose,
tJoints joints_approx,
constMat* tool=nullptr,
constMat* ref=nullptr
)

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

Parameters
pose 4 x4矩阵- >pose of the robot flange with respect to the robot base frame
joints_approx Aproximate solution. Leave empty to return the closest match to the current robot position.
tool 4 x4矩阵- >Optionally provide a tool, otherwise, the robot flange is used. Tip: use robot.PoseTool() to retrieve the active robot tool.
reference 4 x4矩阵- >选择提供一个参考,其他rwise, the robot base is used. Tip: use robot.PoseFrame() to retrieve the active robot reference frame.
Returns
array of joints

Definition at line1306of filerobodk_api.cpp.

SolveIK_All()

QList<tJoints> SolveIK_All ( constMat& pose,
constMat* tool=nullptr,
constMat* ref=nullptr
)

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

Parameters
pose 4 x4矩阵- >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.
Returns
double x n x m -> joint list (2D matrix)

Definition at line1348of filerobodk_api.cpp.

SolveIK_All_Mat2D()

tMatrix2D* SolveIK_All_Mat2D ( constMat& pose,
constMat* tool=nullptr,
constMat* ref=nullptr
)

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

Parameters
pose 4 x4矩阵- >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.
Returns
double x n x m -> joint list (2D matrix)
Parameters
pose 4 x4矩阵- >pose of the robot tool with respect to the robot frame
Returns
double x n x m -> joint list (2D matrix)

Definition at line1331of filerobodk_api.cpp.

Stop()

void Stop ( )

Stops a program or a robot

Returns

Definition at line1596of filerobodk_api.cpp.

Type()

int Type ( ) const

Itemtype (object, robot, tool, reference, robot machining project, ...)

Returns the type of an item (robot, object, target, reference frame, ...)

GENERIC ITEM CALLS

Returns

Definition at line602of filerobodk_api.cpp.

Update ()

double Update ( int 上校lision_check=RoboDK::COLLISION_OFF,
int timeout_sec=3600,
double * out_nins_time_dist=nullptr,
double mm_step=-1,
double deg_step=-1
)

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
上校lision_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.
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)

Definition at line1991of filerobodk_api.cpp.

Valid()

bool Valid ( bool check_deleted=false ) const

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

Checks if the item is valid. An invalid item will be returned by an unsuccessful function call.

Parameters
item_check Itemto check
Returns
True if the item exists, false otherwise
Returns
true if valid, false if invalid

Definition at line637of filerobodk_api.cpp.

Visible()

bool Visible ( ) const

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

Returns
true if visible, false if not visible

Definition at line744of filerobodk_api.cpp.

waitDI()

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

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

Parameters
io_var io_var -> digital output (string or number)
io_value io_value -> value (string or number)
timeout_ms int (optional) -> timeout in miliseconds

Definition at line1806of filerobodk_api.cpp.

WaitMove()

void WaitMove ( double timeout_sec=300 ) const

Waits (blocks) until the robot finishes its movement.

Parameters
timeout_sec timeout -> Max time to wait for robot to finish its movement (in seconds)

Definition at line1607of filerobodk_api.cpp.


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