Features
This function returns a new user cartesian coordinate system by using up to 4 input poses ([x1]~[x4]), input mode [mod] and the reference coordinate system [ref]. The input mode is only valid when the number of input robot poses is 2.
In the case that the number of input poses is 1, the coordinate system is calculated using the position and orientation of x1.
In the case that the number of input poses is 2 and the input mode is 0, X-axis is defined by the direction from x1 to x2, and Z-axis is defined by the projection of the current Tool-Z direction onto the plane orthogonal to the x-axis. The origin is the position of x1.
In the case that the number of input poses is 2 and the input mode is 1, X-axis is defined by the direction from x1 to x2, and Z-axis is defined by the projection of the z direction of x1 onto the plane orthogonal to the X-axis. The origin is the position of x1.
In the case that the number of input poses is 3, X-axis is defined by the direction from x1 to x2. If a vector v is the direction from x1 to x3, Z-axis is defined by the cross product of X-axis and v (X-axis cross v). The origin is the position of x1.
In the case that the number of input poses is 4, the definition of axes is identical to the case that the number of input poses is 3, but the origin is the position of x4.
This function is only available in M2.5 version or higher.
Parameter
|
Parameter Name |
Data Type |
Default Value |
Description |
|
nCnt |
unsigned short |
- |
input count |
|
nInputMode |
unsigned short |
- |
input mode (only valid when the number of input poses is 2)
0: defining z-axis based on the current Tool-z direction
1: defining z-axis based on the z direction of x1 |
|
eTargetRef |
enum.COORDINATE_SYSTEM |
COORDINATE_SYSTEM_BASE |
Refer to the Definition of Constant and Enumeration Type |
|
fTargetPos1 |
float[6] |
|
Target task location for six axes |
|
fTargetPos2 |
float[6] |
|
Target task location for six axes |
|
fTargetPos3 |
float[6] |
|
Target task location for six axes |
|
fTargetPos4 |
float[6] |
|
Target task location for six axes |
Return
|
Value |
Description |
|
enum.ROBOT_POSE |
Refer to the Definition of Constant and Enumeration Type |
Example
float pos1[6] = {500, 30, 500, 0, 0, 0};
float pos2[6] = {400, 30, 500, 0, 0, 0};
float pos3[6] = {500, 30, 600, 45, 180, 45};
float pos4[6] = {500, -30, 600, 0, 180, 0};
ROBOT_POSE* pose_user1 = Drfl.calc_coord(4, 0, COORDINATE_SYSTEM_BASE, pos1, pos2, pos3, pos4);
for (int i=0; i<NUM_TASK; i++)
{
cout << pose_user1->_fPosition[i] << endl;
}