RoboDK API - Documentation
RoboDK_API Namespace Reference

All RoboDK API functions are wrapped in the RoboDK_API namespace. If you prefer to forget about the RoboDK_API you can define RDK_SKIP_NAMESPACE (add the define: RDK_SKIP_NAMESPACE) More...

Classes

struct  Color
 The Color struct represents an RGBA color (each color component should be in the range [0-1]) More...
 
class  Item
 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...
 
class  Mat
 The Mat class represents a 4x4 pose matrix. The main purpose of this object is to represent a pose in the 3D space (position and orientation). In other words, a pose is a 4x4 matrix that represents the position and orientation of one reference frame with respect to another one, in the 3D space. Poses are commonly used in robotics to place objects, reference frames and targets with respect to each other.
\( transl(x,y,z) rotx(r) roty(p) rotz(w) = \\ \begin{bmatrix} n_x & o_x & a_x & x \\ n_y & o_y & a_y & y \\ n_z & o_z & a_z & z \\ 0 & 0 & 0 & 1 \end{bmatrix} \). More...
 
class  RoboDK
 This class is the iterface to the RoboDK API. With the RoboDK API you can automate certain tasks and operate on items. Interactions with items in the station tree are made through Items (IItem). An item is an object in the RoboDK tree (it can be either a robot, an object, a tool, a frame, a program, ...). More...
 
class  tJoints
 The tJoints class represents a joint position of a robot (robot axes). More...
 
struct  tMatrix2D
 The tMatrix2D struct represents a variable size 2d Matrix. Use the Matrix2D_... functions to oeprate on this variable sized matrix. This type of data can be used to get/set a program as a list. This is also useful for backwards compatibility functions related to RoKiSim. More...
 

Typedefs

typedef double tXYZWPR[6]
 Six doubles that represent robot joints (usually in degrees) More...
 
typedef double tXYZ[3]
 tXYZ (mm) represents a position or a vector in mm More...
 
typedef double tConfig[RDK_SIZE_MAX_CONFIG]
 The robot configuration defines a specific state of the robot without crossing any singularities. Changing the configuration requires crossing a singularity. There are 2x2x2=8 different configurations. A robot configurations is also known by "Assembly mode" The robot configuration is defined as an array of 3 doubles: [FACING REAR, LOWER ARM, WRIST FLIP]. FACING REAR=0 means FACING FRONT LOWER ARM=0 means ELBOW UP WRIST FLIP=0 means WRIST NON FLIP the 4th value is reserved. More...
 

Functions

Mat transl (double x, double y, double z)
 Translation matrix class: Mat::transl. More...
 
Mat rotx (double rx)
 Translation matrix class: Mat::rotx. More...
 
Mat roty (double ry)
 Translation matrix class: Mat::roty. More...
 
Mat rotz (double rz)
 Translation matrix class: Mat::rotz. More...
 
void emxInit_real_T (tMatrix2D **pEmxArray, int numDimensions)
 
tMatrix2DMatrix2D_Create ()
 Creates a new 2D matrix tMatrix2D.. Use Matrix2D_Delete to delete the matrix (to free the memory). The Procedure Debug_Matrix2D shows an example to read data from a tMatrix2D. More...
 
void emxFree_real_T (tMatrix2D **pEmxArray)
 
void Matrix2D_Delete (tMatrix2D **mat)
 Deletes a tMatrix2D. More...
 
void emxEnsureCapacity (tMatrix2D *emxArray, int oldNumel, unsigned int elementSize)
 
void Matrix2D_Set_Size (tMatrix2D *mat, int rows, int cols)
 Sets the size of a tMatrix2D. More...
 
int Matrix2D_Size (const tMatrix2D *mat, int dim)
 Sets the size of a tMatrix2D. More...
 
int Matrix2D_Get_ncols (const tMatrix2D *var)
 Returns the number of columns of a tMatrix2D. More...
 
int Matrix2D_Get_nrows (const tMatrix2D *var)
 Returns the number of rows of a tMatrix2D. More...
 
double Matrix2D_Get_ij (const tMatrix2D *var, int i, int j)
 Returns the value at location [i,j] of a tMatrix2D. More...
 
void Matrix2D_SET_ij (const tMatrix2D *var, int i, int j, double value)
 
double * Matrix2D_Get_col (const tMatrix2D *var, int col)
 Returns the pointer of a column of a tMatrix2D. A column has Matrix2D_Get_nrows values that can be accessed/modified from the returned pointer continuously. More...
 
void Matrix2D_Add (tMatrix2D *var, const double *array, int numel)
 
void Matrix2D_Add (tMatrix2D *var, const tMatrix2D *varadd)
 
void Debug_Array (const double *array, int arraysize)
 Show an array through STDOUT Given an array of doubles, it generates a string. More...
 
void Debug_Matrix2D (const tMatrix2D *mat)
 Display the content of a tMatrix2D through STDOUT. This is only intended for debug purposes. More...
 
QDebug operator<< (QDebug dbg, const Mat &m)
 Displays the content of a Mat through STDOUT. This is only intended for debug purposes. More...
 
QDebug operator<< (QDebug dbg, const tJoints &jnts)
 
QDebug operator<< (QDebug dbg, const Item &itm)
 
QDebug operator<< (QDebug dbg, const Mat *m)
 
QDebug operator<< (QDebug dbg, const tJoints *jnts)
 
QDebug operator<< (QDebug dbg, const Item *itm)
 

Detailed Description

All RoboDK API functions are wrapped in the RoboDK_API namespace. If you prefer to forget about the RoboDK_API you can define RDK_SKIP_NAMESPACE (add the define: RDK_SKIP_NAMESPACE)

Typedef Documentation

◆ tConfig

typedef double tConfig[RDK_SIZE_MAX_CONFIG]

The robot configuration defines a specific state of the robot without crossing any singularities. Changing the configuration requires crossing a singularity. There are 2x2x2=8 different configurations. A robot configurations is also known by "Assembly mode" The robot configuration is defined as an array of 3 doubles: [FACING REAR, LOWER ARM, WRIST FLIP]. FACING REAR=0 means FACING FRONT LOWER ARM=0 means ELBOW UP WRIST FLIP=0 means WRIST NON FLIP the 4th value is reserved.

Definition at line 310 of file robodk_api.h.

◆ tXYZ

typedef double tXYZ[3]

tXYZ (mm) represents a position or a vector in mm

Definition at line 299 of file robodk_api.h.

◆ tXYZWPR

typedef double tXYZWPR[6]

Six doubles that represent robot joints (usually in degrees)

tXYZWPR (mm, rad) holds the same information as a tMatrix4x4 pose but represented as XYZ position (in mm) and WPR orientation (in rad) (XYZWPR = [X,Y,Z,W,P,R]) This type of variable is easier to read and it is what most robot controllers use to input a pose. However, for internal calculations it is better to use a 4x4 pose matrix as it is faster and more accurate. To calculate a 4x4 matrix: pose4x4 = transl(X,Y,Z)*rotx(W)*roty(P)*rotz(R) See POSE_2_XYZWPR and XYZWPR_2_POSE to exchange between tMatrix4x4 and tXYZWPR

Definition at line 296 of file robodk_api.h.

Function Documentation

◆ Debug_Array()

ROBODK void Debug_Array ( const double *  array,
int  arraysize 
)

Show an array through STDOUT Given an array of doubles, it generates a string.

Definition at line 4066 of file robodk_api.cpp.

◆ Debug_Matrix2D()

ROBODK void Debug_Matrix2D ( const tMatrix2D mat)

Display the content of a tMatrix2D through STDOUT. This is only intended for debug purposes.

Parameters
[in]matPointer to the matrix

Definition at line 4080 of file robodk_api.cpp.

◆ emxEnsureCapacity()

void RoboDK_API::emxEnsureCapacity ( tMatrix2D emxArray,
int  oldNumel,
unsigned int  elementSize 
)

Definition at line 3960 of file robodk_api.cpp.

◆ emxFree_real_T()

void RoboDK_API::emxFree_real_T ( tMatrix2D **  pEmxArray)

Definition at line 3943 of file robodk_api.cpp.

◆ emxInit_real_T()

void RoboDK_API::emxInit_real_T ( tMatrix2D **  pEmxArray,
int  numDimensions 
)

Definition at line 3920 of file robodk_api.cpp.

◆ Matrix2D_Add() [1/2]

void RoboDK_API::Matrix2D_Add ( tMatrix2D var,
const double *  array,
int  numel 
)

Definition at line 4035 of file robodk_api.cpp.

◆ Matrix2D_Add() [2/2]

void RoboDK_API::Matrix2D_Add ( tMatrix2D var,
const tMatrix2D varadd 
)

Definition at line 4048 of file robodk_api.cpp.

◆ Matrix2D_Create()

ROBODK tMatrix2D * Matrix2D_Create ( )

Creates a new 2D matrix tMatrix2D.. Use Matrix2D_Delete to delete the matrix (to free the memory). The Procedure Debug_Matrix2D shows an example to read data from a tMatrix2D.

Definition at line 3936 of file robodk_api.cpp.

◆ Matrix2D_Delete()

ROBODK void Matrix2D_Delete ( tMatrix2D **  mat)

Deletes a tMatrix2D.

Parameters
[in]matPointer of the pointer to the matrix

Definition at line 3954 of file robodk_api.cpp.

◆ Matrix2D_Get_col()

ROBODK double * Matrix2D_Get_col ( const tMatrix2D var,
int  col 
)

Returns the pointer of a column of a tMatrix2D. A column has Matrix2D_Get_nrows values that can be accessed/modified from the returned pointer continuously.

Parameters
[in]matPointer to the matrix
[in]colColumn to retreive. /return double array (internal pointer) to the column

Definition at line 4030 of file robodk_api.cpp.

◆ Matrix2D_Get_ij()

ROBODK double Matrix2D_Get_ij ( const tMatrix2D var,
int  i,
int  j 
)

Returns the value at location [i,j] of a tMatrix2D.

Parameters
[in]matPointer to the matrix Returns the value of the cell

Definition at line 4023 of file robodk_api.cpp.

◆ Matrix2D_Get_ncols()

ROBODK int Matrix2D_Get_ncols ( const tMatrix2D var)

Returns the number of columns of a tMatrix2D.

Parameters
[in]matPointer to the matrix Returns the number of columns (Second dimension)

Definition at line 4017 of file robodk_api.cpp.

◆ Matrix2D_Get_nrows()

ROBODK int Matrix2D_Get_nrows ( const tMatrix2D var)

Returns the number of rows of a tMatrix2D.

Parameters
[in]matPointer to the matrix Returns the number of rows (First dimension)

Definition at line 4020 of file robodk_api.cpp.

◆ Matrix2D_SET_ij()

void RoboDK_API::Matrix2D_SET_ij ( const tMatrix2D var,
int  i,
int  j,
double  value 
)

Definition at line 4026 of file robodk_api.cpp.

◆ Matrix2D_Set_Size()

ROBODK void Matrix2D_Set_Size ( tMatrix2D mat,
int  rows,
int  cols 
)

Sets the size of a tMatrix2D.

Parameters
[in/out]mat: Pointer to the matrix
[in]rowsThe number of rows.
[in]colsThe number of columns.

Definition at line 3996 of file robodk_api.cpp.

◆ Matrix2D_Size()

ROBODK int Matrix2D_Size ( const tMatrix2D mat,
int  dim 
)

Sets the size of a tMatrix2D.

Parameters
[in/out]mat: Pointer to the matrix
[in]dimDimension (1 or 2)

Definition at line 4009 of file robodk_api.cpp.

◆ operator<<() [1/6]

QDebug RoboDK_API::operator<< ( QDebug  dbg,
const Item itm 
)
inline

Definition at line 2568 of file robodk_api.h.

◆ operator<<() [2/6]

QDebug RoboDK_API::operator<< ( QDebug  dbg,
const Item itm 
)
inline

Definition at line 2572 of file robodk_api.h.

◆ operator<<() [3/6]

QDebug RoboDK_API::operator<< ( QDebug  dbg,
const Mat m 
)
inline

Displays the content of a Mat through STDOUT. This is only intended for debug purposes.

Parameters
[in]matpose matrix
[in]show_full_poseset to false to display the 6 values of the pose as XYZWPR instead of the 4x4 matrix

Definition at line 2566 of file robodk_api.h.

◆ operator<<() [4/6]

QDebug RoboDK_API::operator<< ( QDebug  dbg,
const Mat m 
)
inline

Definition at line 2570 of file robodk_api.h.

◆ operator<<() [5/6]

QDebug RoboDK_API::operator<< ( QDebug  dbg,
const tJoints jnts 
)
inline

Definition at line 2567 of file robodk_api.h.

◆ operator<<() [6/6]

QDebug RoboDK_API::operator<< ( QDebug  dbg,
const tJoints jnts 
)
inline

Definition at line 2571 of file robodk_api.h.

◆ rotx()

ROBODK Mat rotx ( double  rx)

Translation matrix class: Mat::rotx.

Definition at line 177 of file robodk_api.cpp.

◆ roty()

ROBODK Mat roty ( double  ry)

Translation matrix class: Mat::roty.

Definition at line 181 of file robodk_api.cpp.

◆ rotz()

ROBODK Mat rotz ( double  rz)

Translation matrix class: Mat::rotz.

Definition at line 185 of file robodk_api.cpp.

◆ transl()

ROBODK Mat transl ( double  x,
double  y,
double  z 
)

Translation matrix class: Mat::transl.

Definition at line 173 of file robodk_api.cpp.